import pipeline.h.cli.utils as utils
# docstring and type hints: inherits from hifa.tasks.tsysflag.tsysflag.TsysflagInputs.__init__
[docs]
@utils.cli_wrapper
def hifa_tsysflag(vis=None, caltable=None,
flag_nmedian=None, fnm_limit=None, fnm_byfield=None,
flag_derivative=None, fd_max_limit=None,
flag_edgechans=None, fe_edge_limit=None,
flag_fieldshape=None, ff_refintent=None, ff_max_limit=None,
flag_birdies=None, fb_sharps_limit=None,
flag_toomany=None, tmf1_limit=None, tmef1_limit=None,
metric_order=None, normalize_tsys=None, filetemplate=None,
parallel=None):
"""Flag deviant system temperatures for ALMA interferometry measurements.
This task flags all deviant system temperature measurements in the system
temperature calibration table by running a sequence of flagging tests, each
designed to look for a different type of possible error.
If a file with manual Tsys flags is provided with the ``filetemplate``
parameter, then these flags are applied prior to the evaluation of the
flagging heuristics listed below.
The tests are:
1. Flag Tsys spectra with high median values
2. Flag Tsys spectra with high median derivatives. This is meant to spot
spectra that are 'ringing'.
3. Flag the edge channels of the Tsys spectra in each SpW.
4. Flag Tsys spectra whose shape is different from that associated with
the BANDPASS intent.
5. Flag 'birdies'.
6. Flag the Tsys spectra of all antennas in a timestamp and spw if
proportion of antennas already flagged in this timestamp and spw exceeds
a threshold, and flag Tsys spectra for all antennas and all timestamps
in a spw, if proportion of antennas that are already entirely flagged
in all timestamps exceeds a threshold.
Returns:
The results object for the pipeline task is returned.
Examples:
1. Flag Tsys measurements using currently recommended tests:
>>> hifa_tsysflag()
2. Flag Tsys measurements using all recommended tests apart from that
using the 'fieldshape' metric:
>>> hifa_tsysflag(flag_fieldshape=False)
"""