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

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.4.1.tar.gz (97.1 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.4.1-py3-none-any.whl (27.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for skarabina-0.4.1.tar.gz
Algorithm Hash digest
SHA256 c852dfb3269bbef3f3b7a81b4786222ac708f5a1dd29a8a4d0e737fc0ad1b20c
MD5 e6768cb19aea12440ad42387e9ba6f35
BLAKE2b-256 9d88fefabbf7e89da9e0362a5872a16598f530b73f2be8ed54c60148c6111524

See more details on using hashes here.

Provenance

The following attestation bundles were made for skarabina-0.4.1.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.4.1-py3-none-any.whl.

File metadata

  • Download URL: skarabina-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 27.3 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.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 21934fbed7edf03998e916c009008818fa75388350eb662ec82326471472094f
MD5 15755eeaeb4c673fa28e7f3c2603b09b
BLAKE2b-256 b3c9a36f87ce38bb8bff8c11713482da283a4cad06a6ac163ed9df4f52873f3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for skarabina-0.4.1-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