hsd_restoredata¶
- hsd_restoredata(vis: list[str] = None, session: str | None = None, products_dir: str | None = None, copytoraw: bool | None = None, rawdata_dir: str | None = None, lazy: bool | None = None, bdfflags: bool | None = None, ocorr_mode: str | None = None, asis: str | None = None, hm_rasterscan: str | None = None) Results[source]¶
Restore flagged and calibrated single-dish MeasurementSets from archived pipeline products.
Restores flagged and calibrated MeasurementSets from archived ASDMs and pipeline flagging and calibration data products. This task is called at the beginning of single-dish imaging-only pipeline recipes.
Assumes ASDMs are present in the directory given by
rawdata_dir(default:'../rawdata'). By default (copytoraw=True), the pipeline products are copied fromproducts_dir(default:'../products') torawdata_dirat the start of the task. Ifcopytoraw=False, the products are expected to already be inrawdata_dir.When converting an ASDM to MS, if the output MS already exists in the output directory, the
importasdmstep is skipped and the existing MS is imported instead.The expected products per ASDM are:
a compressed tar file of the final flag versions, e.g.
uid___A002_X30a93d_X43e.ms.flagversions.tar.gza text file with applycal instructions, e.g.
uid___A002_X30a93d_X43e.ms.calapply.txta compressed tar file with session caltables, e.g.
uid___A001_X74_X29.session_3.caltables.tar.gz
The task performs the following operations:
Imports the ASDM(s) to MS.
Removes the default MS.flagversions directory created by the filler.
Restores the final MS.flagversions directory stored by the pipeline.
Restores the final set of pipeline flags to the MS.
Restores the final calibration state of the MS.
Restores the final calibration tables for each MS.
Applies the calibration tables to each MS.
- Parameters:
vis --
List of raw visibility data files to be restored. Assumed to be in the directory specified by rawdata_dir.
Example:
vis=['uid___A002_X30a93d_X43e']session --
List of sessions one per visibility file.
Example:
session=['session_3']products_dir --
Name of the data products directory to copy calibration products from. The parameter is effective only when
copytoraw=True. Whencopytoraw=False, calibration products inrawdata_dirwill be used.Example: products_dir='myproductspath'
Default:
None(equivalent to'../products')copytoraw --
Copy calibration and flagging tables from
products_dirtorawdata_dirdirectory.Example:
copytoraw=FalseDefault:
None(equivalent toTrue)rawdata_dir --
Name of the raw data directory.
Example:
rawdata_dir='myrawdatapath'Default:
None(equivalent to'../rawdata')lazy --
Use the lazy filler option.
Example:
lazy=TrueDefault:
None(equivalent toFalse)bdfflags --
Apply BDF flags on import.
Example:
bdfflags=FalseDefault:
None(equivalent toTrue)ocorr_mode --
Selection of baseline correlation to import. Valid only if input visibility is ASDM. See a document of CASA, casatasks::importasdm, for available options.
Example:
ocorr_mode='ca'Default:
None(equivalent to'ao')asis --
Creates verbatim copies of the ASDM tables in the output MS. The value given to this option must be a list of table names separated by space characters. Default value, None, is equivalent to the following list.
'SBSummary ExecBlock Annotation Antenna Station Receiver Source CalAtmosphere CalWVR SpectralWindow'Example:
asis='Source Receiver'hm_rasterscan --
Heuristics method for raster scan analysis. Two analysis modes, time-domain analysis ('time') and direction analysis ('direction'), are available.
Default:
None(equivalent to'time')
- Returns:
The results object for the pipeline task is returned.
Examples
Restore pipeline results for a single ASDM in a single session:
>>> hsd_restoredata(vis=['uid___A002_X30a93d_X43e'], session=['session_1'], ocorr_mode='ao')