orca.transform.spectrum
Spectrum extraction from visibility data.
Provides functions for generating dynamic spectra and time series from measurement set visibility data. Supports phase shifting, weighting, beam correction, and DFT-based spectrum extraction.
Attributes
Functions
|
Generate spectrum (I,V,XX,XY,YX,YY) from the visibilities; if target_coordinates not assigned, assumes source of interest |
|
Map task for dynamic spectrum generation. |
|
Reduce task to combine spectrum data into FITS files. |
Module Contents
- orca.transform.spectrum.ROW_NUMS = [('LWA-128&LWA-160', 54282), ('LWA-048&LWA-051', 33335), ('LWA-018&LWA-237', 30360),...[source]
- orca.transform.spectrum.gen_spectrum(ms: str, sourcename: str, data_column: str = 'CORRECTED_DATA', timeavg: bool = False, outdir: str = None, target_coordinates: str = None, apply_weights: str = None, apply_beam: bool = False)[source]
Generate spectrum (I,V,XX,XY,YX,YY) from the visibilities; if target_coordinates not assigned, assumes source of interest is already at phase center; if apply_weights not assigned, no weights applied.
- Parameters:
ms – The measurement set.
sourcename – The source for which spectrum is being generated. Used for naming output file.
data_column – MS data column on which to operate. Default is CORRECTED_DATA.
timeavg – Average in time. Default is False.
outdir – Path to where output .npz file should be written. Default is path to input ms.
apply_weights – Imaging weights npy file (from wsclean-2.5 -store-imaging-weights, IMAGING_WEIGHT_SPECTRUM column).
- Returns:
Path to output .npz file containing spectrum.
- orca.transform.spectrum.dynspec_map(subband_no: int, scan_no: int, ms: str, bcal: str) List[_SnapshotSpectrum][source]
Map task for dynamic spectrum generation.
Applies calibration and extracts spectrum data for a single snapshot, storing results in Redis for later reduction.
- Parameters:
subband_no – Subband index (0-15).
scan_no – Scan/timestamp index.
ms – Path to the measurement set.
bcal – Path to bandpass calibration table.
- Returns:
List of _SnapshotSpectrum objects with Redis keys.
- orca.transform.spectrum.dynspec_reduce(spectra: Iterable[List[_SnapshotSpectrum]], start_ts: datetime.datetime, out_dir: str) None[source]
Reduce task to combine spectrum data into FITS files.
Collects spectrum data from Redis, combines across time and frequency, and writes output FITS files with proper WCS headers.
- Parameters:
spectra – Iterable of spectrum lists from dynspec_map tasks.
start_ts – Start timestamp for the observation.
out_dir – Output directory for FITS files.