Skip to main content

Skarabina (dungbeetle): An all purpose 1GC flagger

Project description

Skarabina

skarabina: a basic 1GC radio astronomy RFI flagger

Author: Tim Molteno (tim@elec.ac.nz)

Intended to reduce I/O costs by performing the standard flagging during 1GC efficiently, and with low memory requirements. Skarabina is named after the latin name Skarabinae, the genus of many interesting beetles (uncluding the dungbeetle) in Africa.

Install

pip install skarabina

skarabina-analyze

Analyze a measurement set and recommend an image size:

skarabina-analyze --ms foo.ms --image-fov 2.5 --oversampling-factor 5

Computes the angular resolution from the longest baseline and highest frequency, then recommends pixel dimensions given the field-of-view and oversampling factor (pixels per synthesised beam).

Usage

Command-line options

  --ms MS                       Input measurement set (required)
  --summary / --no-summary      Print flagging summary with histogram,
                                field list, spectral window info, and
                                fringe-rotation integration time limits
  --barber / --no-barber        Run barber flagging report
  --barber-pol INTEGER          Polarization for barber
  --flag-uv-above FLOAT         Flag baselines longer than this (metres)
  --flag-nan / --no-flag-nan    Flag NaN visibilities
  --flag-clip TUPLE             Flag visibilities outside [min, max]
  --flag-spectral-window FILE   YAML file with frequency ranges and
                                optional UV constraints to flag
  --time-average-factor INTEGER Combine every N consecutive rows by
                                averaging (before --optimize)
  --frequency-average-factor INTEGER Combine every N consecutive frequency
                                channels by averaging
  --field-of-view FLOAT         Half-width from phase centre in degrees
                                (default 1.0).  Used for fringe-rotation
                                integration time limit.
  --optimize / --no-optimize    Remove fully-flagged rows and channels
  --apply / --no-apply          Modify input MS in place
  --clobber / --no-clobber      Overwrite existing output
  --msout MS                    Output measurement set path
  --debug / --no-debug          Verbose debug output
  --version                     Print version and exit

Barber flagging

Generate a report (in the style of barber).

skarabina --ms foo.ms --barber

Clip and Nan Flagging

This will flag a measurement set, and modify it in-place.

skarabina --ms test.ms --flag-nan --flag-clip [0,100] --apply --clobber

The following will write a new measurement set.

skarabina --ms test.ms --flag-nan --flag-clip [0,100] --apply --clobber --msout bar.ms

Spectral-window flagging

Flag known RFI frequency ranges from a YAML file:

skarabina --ms test.ms --flag-spectral-window spectral-flags.example.yml --msout cleaned.ms

See spectral-flags.example.yml for the format — a list of entries with spw frequency ranges in MHz and optional uv_below / uv_above constraints.

Time averaging

Reduce data volume by averaging consecutive integrations:

skarabina --ms test.ms --time-average-factor 4 --optimize --msout averaged.ms

This averages every 4 rows (mean for DATA/UVW, OR for FLAG, sum for INTERVAL), discarding any trailing rows that don't form a complete block.

Full pipeline example

skarabina --ms raw.ms \
    --flag-uv-above 4000 \
    --flag-nan \
    --flag-spectral-window spectral-flags.yml \
    --time-average-factor 3 \
    --optimize \
    --field-of-view 1.5 \
    --summary \
    --msout clean.ms \
    --clobber

Build

Install uv, then sync the project (creates a virtual environment and installs skarabina in editable mode):

uv sync

Build distributables:

uv build

Stimela

skarabina is available as a stimela package. You can include it in your pipeline (after installing skarabina) thusly

_include:
    - (skarabina):
        - skarabina.yml
        
my-recpipe:
    info: "Print a flagging summary using skarabina"
    inputs:
        ms: MS

    steps:
        flag-summary:
            cab: skarabina
            params:
                ms: =recipe.ms
                summary: true

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

skarabina-0.5.0.tar.gz (98.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

skarabina-0.5.0-py3-none-any.whl (28.6 kB view details)

Uploaded Python 3

File details

Details for the file skarabina-0.5.0.tar.gz.

File metadata

  • Download URL: skarabina-0.5.0.tar.gz
  • Upload date:
  • Size: 98.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for skarabina-0.5.0.tar.gz
Algorithm Hash digest
SHA256 d94c684c1c9c49b95bf65e89404ff0b986641fbbd5099b194f873e269fce2a86
MD5 5421b2766608568fd8313caff9d8d312
BLAKE2b-256 d38aa6bc1c88512aa1d255149f9c6194e7366ba4457e05a574cd1f38fdfbb3c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for skarabina-0.5.0.tar.gz:

Publisher: deploy_module.yaml on tmolteno/skarabina

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file skarabina-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: skarabina-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 28.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for skarabina-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 df0fd59246bba61fe08ee8e9a7b4d13950e0d032c9bad3efcae33d80bfcaf1ab
MD5 6a70d67bad5f96e4127992caa60fea7f
BLAKE2b-256 c3dac1d40c982b4b3af37caae1b13e988fab60a3c1ff52b6ec6dd380b62bfd80

See more details on using hashes here.

Provenance

The following attestation bundles were made for skarabina-0.5.0-py3-none-any.whl:

Publisher: deploy_module.yaml on tmolteno/skarabina

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page