flint.options¶
Contains the core of the option class containers that are used to hold stateful properties throughout the flint codebase.
Attributes¶
Classes¶
Options related to predicting a continuum model during the SubtractFieldOptions workflow. |
|
Container for options related to archiving products from flint workflows |
|
Container that represents the flint related options that |
|
A base class that Options style flint classes can |
|
Container that represents the flint related options that |
|
Container of opptions used to combine images into a single cube using the fitscube package. |
|
Helper to keep track of measurement set information |
|
Container that represents the flint related options that |
|
Container for options related to the |
Functions¶
|
Convert a pydantic Field into |
|
Given an established argument parser and a class derived |
Given a |
|
|
Dump the supplied instance of FieldOptions to a yaml file |
|
Helper function to convert an Options type class to a dictionary. |
Module Contents¶
- class flint.options.AddModelSubtractFieldOptions(/, **data: Any)[source]¶
Bases:
BaseOptionsOptions related to predicting a continuum model during the SubtractFieldOptions workflow. Specifically these options deal with identifying the wsclean produced source list model, which may be used by
admodelto predict model visibilities. See utilities around theaocalibratefunctions and routines.- addmodel_cluster_config: pathlib.Path | None = None[source]¶
Specify a new cluster configuration file different to the preferred on. If None, drawn from preferred cluster config
- class flint.options.ArchiveOptions(/, **data: Any)[source]¶
Bases:
BaseOptionsContainer for options related to archiving products from flint workflows
- class flint.options.BandpassOptions(/, **data: Any)[source]¶
Bases:
BaseOptionsContainer that represents the flint related options that might be used throughout the processing of bandpass calibration data.
In its present form this BandpassOptions class is not intended to contain properties of the data that arebeing processed, rather how these data will be processed.
These settings are not meant to be adjustabled throughout a single bandpass pipeline run
- calibrate_container: pathlib.Path | None = None[source]¶
Path to the singularity calibrate container
- flag_calibrate_rounds: int = 3[source]¶
The number of times the bandpass will be calibrated, flagged, then recalibrated
- minuv: float | None = None[source]¶
The minimum baseline length, in meters, for data to be included in bandpass calibration stage
- preflagger_ant_mean_tolerance: float = 0.2[source]¶
Tolerance that the mean x/y antenna gain ratio test before the antenna is flagged
- preflagger_jones_max_amplitude: float | None = None[source]¶
Flag Jones matrix if any amplitudes with a Jones are above this value
- preflagger_mesh_ant_flags: bool = False[source]¶
Share channel flags from bandpass solutions between all antenna
- class flint.options.BaseOptions(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelA base class that Options style flint classes can inherit from. This is derived from
pydantic.BaseModel, and can be used for validation of supplied values.Class derived from
BaseOptionsare immutable by default, and have the docstrings of attributes extracted.
- class flint.options.FieldOptions(/, **data: Any)[source]¶
Bases:
BaseOptionsContainer that represents the flint related options that might be used throughout components related to the actual pipeline.
In its present form this FieldOptions class is not intended to contain properties of the data that are being processed, rather how those data will be processed.
These settings are not meant to be adjustable throughout rounds of self-calibration.
- beam_cutoff: float = 150[source]¶
Cutoff in arcseconds to use when calculating the common beam to convol to
- calibrate_container: pathlib.Path | None = None[source]¶
Path to the singularity calibrate container
- coadd_cubes: bool = False[source]¶
Co-add cubes formed throughout imaging together. Cubes will be smoothed channel-wise to a common resolution. Only performed on final set of images
- fixed_beam_shape: tuple[float, float, float] | None = None[source]¶
Specify the final beamsize of linmos field images in (arcsec, arcsec, deg)
- holofile: pathlib.Path | None = None[source]¶
Path to the holography FITS cube that will be used when co-adding beams
- imaging_strategy: pathlib.Path | None = None[source]¶
Path to a FLINT imaging yaml file that contains settings to use throughout imaging
- reference_catalogue_directory: pathlib.Path | None = None[source]¶
Path to the directory container the reference catalogues, used to generate validation plots
- rename_ms: bool = False[source]¶
Rename MSs throughout rounds of imaging and self-cal instead of creating copies. This will delete data-columns throughout.
- sbid_archive_path: pathlib.Path | None = None[source]¶
Path that SBID archive tarballs will be created under. If None no archive tarballs are created. See ArchiveOptions.
- sbid_copy_path: pathlib.Path | None = None[source]¶
Path that final processed products will be copied into. If None no copying of file products is performed. See ArchiveOptions.
- skip_selfcal_on_rounds: list[int] | None = None[source]¶
Do not perform the derive and apply self-calibration solutions on these rounds
- stokes_v_imaging: bool = False[source]¶
Specifies whether Stokes-V imaging will be carried out after the final round of imagine (whether or not self-calibration is enabled).
- update_model_data_with_source_list: bool = False[source]¶
Attempt to update a MSs MODEL_DATA column with a source list (e.g. source list output from wsclean)
- use_beam_masks: bool = False[source]¶
Construct beam masks from MFS images to use for the next round of imaging.
- use_beam_masks_from: int = 1[source]¶
If use_beam_masks is True, this sets the round where beam masks will be generated from
- use_beam_masks_rounds: list[int] | None = None[source]¶
If use_beam_masks is True, this sets which rounds should have a mask applied
- use_jolly_tukey_tractor: bool = False[source]¶
Use the jolly roger tukey tractor. See the TukeyTractorOptions and the jolly-roger package for more details.
- use_preflagger: bool = False[source]¶
Whether to apply (or search for solutions with) bandpass solutions that have gone through the preflagging operations
- use_smoothed: bool = False[source]¶
Whether to apply (or search for solutions with) a bandpass smoothing operation applied
- class flint.options.FitsCubeOptions(/, **data: Any)[source]¶
Bases:
BaseOptionsContainer of opptions used to combine images into a single cube using the fitscube package. This is particularly useful to manage the larger concatenations.
- class flint.options.MS[source]¶
Bases:
NamedTupleHelper to keep track of measurement set information
This is the class that should be used when describing a measurement set that will be operated on.
- classmethod cast(ms: MS | pathlib.Path) MS[source]¶
Create/return a MS instance given either a Path or MS.
If the input is neither a MS instance or Path, the object will be checked to see if it has a .ms attribute. If it does then this will be used.
- class flint.options.PolFieldOptions(/, **data: Any)[source]¶
Bases:
BaseOptionsContainer that represents the flint related options that might be used throughout components related to the actual pipeline.
In its present form this PolFieldOptions class is not intended to contain properties of the data that are being processed, rather how those data will be processed.
These settings are not meant to be adjustable across different polarisations.
- beam_cutoff: float = 150[source]¶
Cutoff in arcseconds to use when calculating the common beam to convol to
- fixed_beam_shape: tuple[float, float, float] | None = None[source]¶
Specify the final beamsize of linmos field images in (arcsec, arcsec, deg)
- holofile: pathlib.Path | None = None[source]¶
Path to the holography FITS cube that will be used when co-adding beams
- imaging_strategy: pathlib.Path | None = None[source]¶
Path to a FLINT imaging yaml file that contains settings to use throughout imaging
- sbid_copy_path: pathlib.Path | None = None[source]¶
Path that final processed products will be copied into. If None no copying of file products is performed. See ArchiveOptions.
- class flint.options.SubtractFieldOptions(/, **data: Any)[source]¶
Bases:
BaseOptionsContainer for options related to the continuum-subtracted pipeline
- attempt_subtract: bool = False[source]¶
Attempt to subtract the model column from the nominated data column
- beam_cutoff: float = 150[source]¶
Cutoff in arcseconds to use when calculating the common beam to convol to
- data_column: str = 'CORRECTED_DATA'[source]¶
Describe the column that should be imaed and, if requested, have model subtracted from
- fitscube_remove_original_images: bool = False[source]¶
Remove the images that go into forming the fitscube
- holofile: pathlib.Path | None = None[source]¶
Path to the holography FITS cube that will be used when co-adding beams
- imaging_strategy: pathlib.Path | None = None[source]¶
Path to a FLINT imaging yaml file that contains settings to use throughout imaging
- predict_wsclean_model: bool = False[source]¶
Search for the continuum model produced by wsclean and subtract
- stagger_delay_seconds: float | None = None[source]¶
The delay, in seconds, that should be used when submitting items in batches (e.g. looping over channels)
- subtract_data_column: str = 'DATA'[source]¶
Should the continuum model be subtracted, where to store the output. This will update the column to be imaged.
- subtract_model_data: bool = False[source]¶
Subtract the MODEL_DATA column from the nominated data column
- flint.options._create_argparse_options(name: str, field: pydantic.fields.FieldInfo) tuple[str, dict[str, Any]][source]¶
Convert a pydantic Field into
dictto splate into ArgumentParser.add_argument()
- flint.options.add_options_to_parser(parser: argparse.ArgumentParser, options_class: type[BaseOptions], description: str | None = None) argparse.ArgumentParser[source]¶
Given an established argument parser and a class derived from a
pydantic.BaseModel, populate the argument parser with the model properties.- Parameters:
parser (ArgumentParser) – Parser that arguments will be added to
options_class (type[BaseModel]) – A
Optionsstyle class derived fromBaseOptions
- Returns:
Updated argument parser
- Return type:
ArgumentParser
- flint.options.create_options_from_parser(parser_namespace: argparse.Namespace, options_class: type[U]) U[source]¶
Given a
BaseOptionsderived class, extract the corresponding arguments from anargparse.nNamespace. These options correspond to ones generated byadd_options_to_parser.- Parameters:
parser_namespace (Namespace) – The argument parser corresponding to those in the
BaseOptionsclassoptions_class (U) – A
BaseOptionsderived class
- Returns:
An populated options class with arguments drawn from CLI argument parser
- Return type:
U
- flint.options.dump_field_options_to_yaml(output_path: pathlib.Path, field_options: FieldOptions | PolFieldOptions | SubtractFieldOptions, overwrite: bool = False) pathlib.Path[source]¶
Dump the supplied instance of FieldOptions to a yaml file for record keeping.
The parent directory of the output_path will be created if it does not already exist.
- Parameters:
output_path (Path) – Path of the output file.
field_options (FieldOptions) – The FieldOptions class to write.
overwrite (bool, optional) – Overwrite the file if it exists. Defaults to False.
- Raises:
FileExistsError – Raise if output_path already exists and overwrite is False
- Returns:
Output path written to.
- Return type:
Path
- flint.options.options_to_dict(input_options: Any) dict[source]¶
Helper function to convert an Options type class to a dictionary.
Most of flint Option and Result classes used typing.NamedTuples, which carry with it a _asdict method to convert them to a dictionary. Future roadmap plans to move over to pydantic type models. This is a place holder function to help transition to this.
- Parameters:
input_options (Any) – Item to convert to a dictionary
- Raises:
TypeError – Raised if the conversion to a dictionary was not successful
- Returns:
The dictionary version of the input options
- Return type:
Dict
- flint.options.DEFAULT_COPY_RE_PATTERNS = ('.*linmos.*fits', '.*weight\\.fits', '.*png', '.*csv')[source]¶