orca.transform.spectrum ======================= .. py:module:: orca.transform.spectrum .. autoapi-nested-parse:: 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 ---------- .. autoapisummary:: orca.transform.spectrum.logger orca.transform.spectrum.N_CHAN orca.transform.spectrum.REDIS_URL orca.transform.spectrum.REDIS_EXPIRE_S orca.transform.spectrum.REDIS_KEY_PREFIX orca.transform.spectrum.ROW_NUMS Functions --------- .. autoapisummary:: orca.transform.spectrum.gen_spectrum orca.transform.spectrum.dynspec_map orca.transform.spectrum.dynspec_reduce orca.transform.spectrum.test_make_dynspec_fits Module Contents --------------- .. py:data:: logger .. py:data:: N_CHAN :value: 192 .. py:data:: REDIS_URL .. py:data:: REDIS_EXPIRE_S :value: 36000 .. py:data:: REDIS_KEY_PREFIX :value: 'spec-' .. py:data:: ROW_NUMS :value: [('LWA-128&LWA-160', 54282), ('LWA-048&LWA-051', 33335), ('LWA-018&LWA-237', 30360),... .. py:function:: 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) 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. :param ms: The measurement set. :param sourcename: The source for which spectrum is being generated. Used for naming output file. :param data_column: MS data column on which to operate. Default is CORRECTED_DATA. :param timeavg: Average in time. Default is False. :param outdir: Path to where output .npz file should be written. Default is path to input ms. :param 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. .. py:function:: dynspec_map(subband_no: int, scan_no: int, ms: str, bcal: str) -> List[_SnapshotSpectrum] Map task for dynamic spectrum generation. Applies calibration and extracts spectrum data for a single snapshot, storing results in Redis for later reduction. :param subband_no: Subband index (0-15). :param scan_no: Scan/timestamp index. :param ms: Path to the measurement set. :param bcal: Path to bandpass calibration table. :returns: List of _SnapshotSpectrum objects with Redis keys. .. py:function:: dynspec_reduce(spectra: Iterable[List[_SnapshotSpectrum]], start_ts: datetime.datetime, out_dir: str) -> None 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. :param spectra: Iterable of spectrum lists from dynspec_map tasks. :param start_ts: Start timestamp for the observation. :param out_dir: Output directory for FITS files. .. py:function:: test_make_dynspec_fits()