flint.dp3¶
Run DP3 steps against measurement sets through DP3’s Python interface
Attributes¶
Classes¶
Options for the DP3 aoflagger step |
|
Options for the DP3 applycal step |
|
Options for the DP3 ddecal step |
|
Options for the DP3 gaincal step |
|
Options for the DP3 preflagger step. Unset selections are not used. |
Functions¶
|
Raise if any of the given columns is missing from the measurement set. |
|
|
|
The parset to read a measurement set and update it in place. |
|
Apply the solutions in an h5parm, writing the corrected data to |
|
Solve for gains against the model column with ddecal. |
|
Flag a measurement set with aoflagger, after the preflagger if given. |
|
Solve for gains against the model column with gaincal. |
|
Solve against the model column and apply the solutions to |
|
The model column of a measurement set, which calibration needs. |
|
Create the argument parser for the DP3 tasks. |
|
Turn step options into DP3 parset keys and values, skipping unset ones. |
|
Run a DP3 pipeline described by parset keys and values. |
Module Contents¶
- class flint.dp3.DP3AOFlaggerOptions(/, **data: Any)[source]¶
Bases:
flint.options.BaseOptionsOptions for the DP3 aoflagger step
- classmethod check_strategy_is_lua(strategy: pathlib.Path | None) pathlib.Path | None[source]¶
Strategies are lua scripts.
- class flint.dp3.DP3ApplyCalOptions(/, **data: Any)[source]¶
Bases:
flint.options.BaseOptionsOptions for the DP3 applycal step
- correction: list[ParsetWord][source]¶
Soltabs to apply in turn, e.g. [‘phase000’] or [‘rotationmeasure000’]
- interpolation: Interpolation | None = None[source]¶
How solutions are interpolated in time and frequency
- solset: ParsetWord | None = None[source]¶
The solset holding the soltabs. DP3 picks one if unset.
- class flint.dp3.DP3DDECalOptions(/, **data: Any)[source]¶
Bases:
flint.options.BaseOptionsOptions for the DP3 ddecal step
- mode: DDECalMode = 'scalarphase'[source]¶
What to solve for
- class flint.dp3.DP3GainCalOptions(/, **data: Any)[source]¶
Bases:
flint.options.BaseOptionsOptions for the DP3 gaincal step
- caltype: GainCalType = 'scalarphase'[source]¶
What to solve for
- class flint.dp3.DP3PreFlaggerOptions(/, **data: Any)[source]¶
Bases:
flint.options.BaseOptionsOptions for the DP3 preflagger step. Unset selections are not used.
- classmethod check_channel_ranges(chan: list[str] | None) list[str] | None[source]¶
Channel ranges must not run backwards.
- chan: list[ChannelRange] | None = None[source]¶
Channels or inclusive channel ranges to flag, e.g. [‘0..7’, ‘287’]
- corrtype: CorrelationType | None = None[source]¶
Flag only auto or cross correlations
- flint.dp3.check_columns(ms: flint.options.MS, *columns: str | None) None[source]¶
Raise if any of the given columns is missing from the measurement set.
- flint.dp3.create_dp3_parset(ms: flint.options.MS, steps: list[str], output_column: str | None = None) dict[str, str][source]¶
The parset to read a measurement set and update it in place.
- flint.dp3.dp3_applycal(ms: flint.options.MS | pathlib.Path, h5parm: pathlib.Path | None = None, options: DP3ApplyCalOptions | None = None, output_column: str = 'CORRECTED_DATA') flint.options.MS[source]¶
Apply the solutions in an h5parm, writing the corrected data to
output_column.- Parameters:
ms (MS | Path) – The measurement set to correct
h5parm (Path | None, optional) – The solutions to apply. Defaults to
ms.h5parm.options (DP3ApplyCalOptions | None, optional) – Options for applycal. Defaults to None.
output_column (str, optional) – The column to write the corrected data to. Defaults to “CORRECTED_DATA”.
- Raises:
ValueError – Raised if no h5parm is given or set on the measurement set
FileNotFoundError – Raised if the h5parm does not exist
- Returns:
The measurement set with
columnset tooutput_columnandh5parmset- Return type:
- flint.dp3.dp3_ddecal(ms: flint.options.MS | pathlib.Path, options: DP3DDECalOptions | None = None, h5parm: pathlib.Path | None = None) flint.options.MS[source]¶
Solve for gains against the model column with ddecal.
- Parameters:
ms (MS | Path) – The measurement set, with its model column set
options (DP3DDECalOptions | None, optional) – Options for ddecal. Defaults to None.
h5parm (Path | None, optional) – Where to write the solutions. Defaults to the MS path with a
.ddecal.h5suffix.
- Raises:
ValueError – Raised if the model column is not set or missing
- Returns:
The measurement set with
h5parmset to the solutions- Return type:
- flint.dp3.dp3_flag(ms: flint.options.MS | pathlib.Path, aoflagger_options: DP3AOFlaggerOptions | None = None, preflagger_options: DP3PreFlaggerOptions | None = None) flint.options.MS[source]¶
Flag a measurement set with aoflagger, after the preflagger if given.
- Parameters:
ms (MS | Path) – The measurement set, flagging its nominated column
aoflagger_options (DP3AOFlaggerOptions | None, optional) – Options for aoflagger. Defaults to the packaged ASKAP strategy.
preflagger_options (DP3PreFlaggerOptions | None, optional) – If set, run the preflagger first. Defaults to None.
- Returns:
The flagged measurement set
- Return type:
- flint.dp3.dp3_gaincal(ms: flint.options.MS | pathlib.Path, options: DP3GainCalOptions | None = None, h5parm: pathlib.Path | None = None, output_column: str | None = None) flint.options.MS[source]¶
Solve for gains against the model column with gaincal.
- Parameters:
ms (MS | Path) – The measurement set, with its model column set
options (DP3GainCalOptions | None, optional) – Options for gaincal. Defaults to None.
h5parm (Path | None, optional) – Where to write the solutions. Defaults to the MS path with a
.gaincal.h5suffix.output_column (str | None, optional) – If set, also apply the solutions in the same pass, writing to this column. Defaults to None.
- Raises:
ValueError – Raised if the model column is not set or missing
- Returns:
The measurement set with
h5parmset, andcolumnset tooutput_columnif given- Return type:
- flint.dp3.dp3_solve_apply(ms: flint.options.MS | pathlib.Path, options: DP3DDECalOptions | DP3GainCalOptions | None = None, h5parm: pathlib.Path | None = None, output_column: str = 'CORRECTED_DATA') flint.options.MS[source]¶
Solve against the model column and apply the solutions to
output_column.- Parameters:
ms (MS | Path) – The measurement set, with its model column set
options (DP3DDECalOptions | DP3GainCalOptions | None, optional) – Solve with ddecal or gaincal depending on the type. Defaults to ddecal.
h5parm (Path | None, optional) – Where to write the solutions. Defaults to a path next to the MS.
output_column (str, optional) – The column to write the corrected data to. Defaults to “CORRECTED_DATA”.
- Returns:
The measurement set with
columnset tooutput_columnandh5parmset- Return type:
- flint.dp3.get_model_column(ms: flint.options.MS) str[source]¶
The model column of a measurement set, which calibration needs.
- flint.dp3.get_parser() argparse.ArgumentParser[source]¶
Create the argument parser for the DP3 tasks.
- flint.dp3.options_to_parset(step: str, options: flint.options.BaseOptions) dict[str, str][source]¶
Turn step options into DP3 parset keys and values, skipping unset ones.
- flint.dp3.run_dp3(parset: dict[str, str]) None[source]¶
Run a DP3 pipeline described by parset keys and values.
- type flint.dp3.ChannelRange = Annotated[str, StringConstraints(pattern='^\\d+(\\.\\.\\d+)?$')][source]¶
- type flint.dp3.DDECalMode = Literal['scalar', 'scalarphase', 'scalaramplitude', 'diagonal', 'diagonalphase', 'diagonalamplitude', 'fulljones', 'tec', 'tec+delay', 'tec+phase', 'tec+phase+delay', 'rotation', 'rotation+diagonal', 'faradayrotation', 'leakage', 'leakageamplitude'][source]¶