pipeline.h.tasks.common package¶
Subpackages¶
- pipeline.h.tasks.common.displays package
- Submodules
- pipeline.h.tasks.common.displays.applycal module
- pipeline.h.tasks.common.displays.bandpass module
- pipeline.h.tasks.common.displays.common module
- pipeline.h.tasks.common.displays.flagging module
- pipeline.h.tasks.common.displays.image module
- pipeline.h.tasks.common.displays.sky module
- pipeline.h.tasks.common.displays.slice module
- pipeline.h.tasks.common.displays.tsys module
- Module contents
Submodules¶
pipeline.h.tasks.common.arrayflaggerbase module¶
-
class
pipeline.h.tasks.common.arrayflaggerbase.
FlagCmd
(filename=None, rulename=None, ruleaxis=None, spw=None, antenna=None, intent=None, pol=None, time=None, field=None, axisnames=None, flagcoords=None, channel_axis=None, reason=None, extendfields=None, antenna_id_to_name=None)[source]¶ Bases:
object
- Create a flagcmd.
Added detailed docs here.
-
property
flagchannels
¶ Return list of channels flagged.
-
pipeline.h.tasks.common.arrayflaggerbase.
channel_ranges
(channels)[source]¶ Given a list of channels will return a list of ranges that describe them.
pipeline.h.tasks.common.atmutil module¶
-
class
pipeline.h.tasks.common.atmutil.
AtmType
[source]¶ Bases:
object
-
midLatitudeSummer
= 2¶
-
midLatitudeWinter
= 3¶
-
subarcticSummer
= 4¶
-
subarcticWinter
= 5¶
-
tropical
= 1¶
-
-
pipeline.h.tasks.common.atmutil.
get_spw_spec
(vis, spw_id)[source]¶ vis: MS name spw_id: spw id
return: center frequency [GHz], number of channels, and resolution [GHz]
-
pipeline.h.tasks.common.atmutil.
get_transmission
(vis, antenna_id=0, spw_id=0, doplot=False)[source]¶ calculate atmospheric transmission assuming PWV=1mm.
vis – MS name antenna_id – antenna ID spw_id – spw ID
- Returns
(frequency array [GHz], atm transmission)
-
pipeline.h.tasks.common.atmutil.
init_at
(at, humidity=20.0, temperature=270.0, pressure=560.0, atmtype=3, altitude=5000.0, fcenter=100.0, nchan=4096, resolution=0.001)[source]¶ at: atmosphere tool humidity: relative humidity [%] temperature: temperature [K] pressure: pressure [mbar] atmtype: AtmType enum altitude: altitude [m] fcenter: center frequency [GHz] nchan: number of channels resolution: channel width [GHz]
pipeline.h.tasks.common.calibrationtableaccess module¶
-
class
pipeline.h.tasks.common.calibrationtableaccess.
CalibrationTableData
(name)[source]¶ Bases:
object
CalibrationTableData holds the name of a CASA calibration table and its contents.
-
property
rows
¶
-
property
pipeline.h.tasks.common.commonfluxresults module¶
-
class
pipeline.h.tasks.common.commonfluxresults.
FluxCalibrationResults
(vis, resantenna=None, uvrange=None, measurements=None)[source]¶ Bases:
pipeline.infrastructure.basetask.Results
TODO: refactor this results structure. We’re falling into the dictionaries of dictionaries trap again..
-
merge_with_context
(context)[source]¶ Merge these results with the given context.
This method will be called during the execution of accept(). For calibration tasks, a typical implementation will register caltables with the pipeline callibrary.
At this point the result is deemed safe to merge, so no further checks on the context need be performed.
-
pipeline.h.tasks.common.commonhelpermethods module¶
pipeline.h.tasks.common.commonresultobjects module¶
-
class
pipeline.h.tasks.common.commonresultobjects.
ImageResult
(filename, data, datatype, axes, flag=None, nodata=None, intent=None, field_id=None, field_name=None, spw=None, pol=None, ant=None, units=None, time=None)[source]¶ Bases:
pipeline.h.tasks.common.commonresultobjects.ResultBase
-
class
pipeline.h.tasks.common.commonresultobjects.
ResultAxis
(name, units, data, channel_width=None)[source]¶ Bases:
object
-
class
pipeline.h.tasks.common.commonresultobjects.
ResultBase
[source]¶ Bases:
object
-
property
description
¶
-
property
fieldname
¶
-
property
-
class
pipeline.h.tasks.common.commonresultobjects.
SpectrumResult
(data, datatype, data_mad=None, axis=None, flag=None, nodata=None, noisychannels=None, filename=None, intent=None, field_id=None, field_name=None, spw=None, pol=None, ant=None, units=None, time=None, normalise=False)[source]¶ Bases:
pipeline.h.tasks.common.commonresultobjects.ResultBase
pipeline.h.tasks.common.flaggableviewresults module¶
pipeline.h.tasks.common.flagging_renderer_utils module¶
Created on 25 Nov 2014
@author: sjw
-
pipeline.h.tasks.common.flagging_renderer_utils.
FlagTotal
¶ alias of
pipeline.h.tasks.common.flagging_renderer_utils.FlagSummary
-
pipeline.h.tasks.common.flagging_renderer_utils.
adjust_non_science_totals
(flagtotals, non_science_agents=None)[source]¶ Return a copy of the FlagSummary dictionaries, with totals reduced to account for flagging performed by non-science flagging agents.
The incoming flagtotals report how much data was flagged per agent per data selection. These flagtotals are divided into two groups: those whose agent should be considered ‘non-science’ (and are indicated as such in the non_science_agents argument) and the remainder. The total number of rows flagged due to non-science agents is calculated and subtracted from the total for each of the remainder agents.
-
pipeline.h.tasks.common.flagging_renderer_utils.
flags_by_intent
(ms, summaries, intents=None)[source]¶
-
pipeline.h.tasks.common.flagging_renderer_utils.
flags_for_result
(result, context: pipeline.infrastructure.launcher.Context, intents_to_summarise: Optional[List[str]] = None, non_science_agents: Optional[List[str]] = None)[source]¶
-
pipeline.h.tasks.common.flagging_renderer_utils.
intents_to_summarise
(context: pipeline.infrastructure.launcher.Context) → List[str][source]¶
pipeline.h.tasks.common.manifest module¶
-
class
pipeline.h.tasks.common.manifest.
PipelineManifest
(ouss_id)[source]¶ Bases:
object
Class for creating the pipeline data product manifest
-
static
add_antennapos_file
(ous, antennapos_file)[source]¶ Add the antenna positions file to the OUS element Remove at some point
-
static
add_asdm
(session, asdm_name, flags_file, calapply_file)[source]¶ Add an ASDM element to a SESSION element
-
static
add_asdm_imlist
(session, asdm_name, ms_file, flags_file, calapply_file, imagelist, imtype)[source]¶ Add an ASDM element to a SESSION element
-
static
add_aux_products_file
(ous, auxproducts_file)[source]¶ Add the auxiliary products file. Is one enough ?
-
static
add_auxasdm
(session, asdm_name, calapply_file)[source]¶ Add an ASDM element to a SESSION element
-
static
add_cont_file
(ous, cont_file)[source]¶ Add the continuum frequency ranges file to the OUS element Remove at some point
-
static
add_flux_file
(ous, flux_file)[source]¶ Add the flux file to the OUS element Remove at some point.
-
static
add_images
(ous, imagelist, imtype)[source]¶ Add a list of images to the OUS element. Note that this does not have to be an ous element, e.d. an asdm element will do
-
static
add_pipescript
(ous, pipescript)[source]¶ Add the pipeline processing script to the OUS element
-
static
add_pprfile
(ous, ppr_file)[source]¶ Add the pipeline processing request file to the OUS element
-
static
add_restorescript
(ous, restorescript)[source]¶ Add the pipeline restore script to the OUS element
-
get_ous
()[source]¶ Currently this assumes there is only one ous as is the case for member ous processing
-
static
get_session
(ous, session_name)[source]¶ Get a SESSION element in an OUS element and return it
-
static
pipeline.h.tasks.common.ozone module¶
-
pipeline.h.tasks.common.ozone.
get_ozone_channels_for_spw
(ms, spwid)[source]¶ For given spectral window in measurement set, compute an array of booleans where each element corresponds to a channel in the spectral window and signifies whether that channel falls inside a known atmospheric ozone line.
- Parameters
ms (
MeasurementSet
) – measurement set to inspectspwid (int) – spectral window id to inspect
- Returns
Numpy array of booleans, representing mask of channels where channels corresponding to ozone lines are set to True.
- Return type
numpy.array[boolean]
pipeline.h.tasks.common.sensitivity module¶
pipeline.h.tasks.common.viewflaggers module¶
-
class
pipeline.h.tasks.common.viewflaggers.
MatrixFlagger
(inputs)[source]¶ Bases:
pipeline.infrastructure.basetask.StandardTaskTemplate
-
Inputs
¶ alias of
MatrixFlaggerInputs
-
analyse
(result)[source]¶ Determine the best parameters by analysing the given jobs before returning any final jobs to execute.
- Parameters
jobs (a list of
JobRequest
) – the job requests generated byprepare()
- Return type
Result
-
flag_reason_index
= {'bad antenna': 9, 'bad quadrant': 8, 'high outlier': 5, 'low outlier': 6, 'max abs': 1, 'min abs': 2, 'nmedian': 3, 'outlier': 4, 'too many entirely flagged': 10, 'too many flags': 7}¶
-
flag_reason_key
= {1: 'max abs', 2: 'min abs', 3: 'nmedian', 4: 'outlier', 5: 'high outlier', 6: 'low outlier', 7: 'too many flags', 8: 'bad quadrant', 9: 'bad antenna', 10: 'too many entirely flagged'}¶
-
generate_flags
(matrix, rules)[source]¶ Calculate the statistics of a matrix and flag the data according to a list of specified rules.
Keyword arguments: matrix - ImageResult object containing data to be flagged. rules - Rules to be applied.
-
static
make_flag_rules
(flag_hilo=False, fhl_limit=5.0, fhl_minsample=5, flag_hi=False, fhi_limit=5.0, fhi_minsample=5, flag_lo=False, flo_limit=5.0, flo_minsample=5, flag_tmf1=False, tmf1_axis='Time', tmf1_limit=1.0, tmf1_excess_limit=10000000, flag_tmf2=False, tmf2_axis='Time', tmf2_limit=1.0, tmf2_excess_limit=10000000, flag_tmef1=False, tmef1_axis='Antenna1', tmef1_limit=1.0, flag_nmedian=False, fnm_lo_limit=0.7, fnm_hi_limit=1.3, flag_maxabs=False, fmax_limit=0.1, flag_minabs=False, fmin_limit=0.0, flag_bad_quadrant=False, fbq_hilo_limit=7.0, fbq_antenna_frac_limit=0.5, fbq_baseline_frac_limit=0.5, flag_bad_antenna=False, fba_lo_limit=7.0, fba_frac_limit=0.05, fba_number_limit=3, fba_minsample=5)[source]¶ Generate a list of flagging rules from a set of flagging parameters. Added detailed docs here.
-
-
class
pipeline.h.tasks.common.viewflaggers.
MatrixFlaggerInputs
(context, output_dir=None, vis=None, datatask=None, viewtask=None, flagsettertask=None, rules=None, niter=None, extendfields=None, extendbaseband=None, iter_datatask=None, use_antenna_names=None, prepend=None, skip_fully_flagged=None)[source]¶ Bases:
pipeline.infrastructure.vdp.StandardInputs
-
prepend
¶ VisDependentProperty is a Python data descriptor that standardises the behaviour of pipeline Inputs properties and lets them create default values more easily.
On reading a VisDependentProperty (ie. using the dot prefix: inputs.solint), one of two things happens:
If a NullMarker is found - signifying that no user input has been provided - and a ‘getter’ function has been defined, the getter function will be called to provide a default value for that measurement set.
If a user has overridden the value (eg. inputs.solint = 123), that value will be retrieved.
The value, either the default from step 1 or user-provided from step 2, is run through the optional postprocess function, which gives a final opportunity to change the value depending on the state/value of other properties.
A VisDependentProperty can be made read-only by specifying ‘readonly=True’ when creating the instance.
A VisDependentProperty can be hidden from the containing Inputs string representation by setting ‘hidden=True’ when creating the instance. This will hide the property from the web log and CLI getInputs calls.
Each VisDependentProperty has a set of values it considers equivalent to null. When the user sets the VDP value to one of these null values, the VDP machinery converts this to a private NullObject marker that signifies the property is now unset, resulting in the default value being returned next time the property is read. Developers can specify which values should be converted to NullObject by specifying null_input at creation time, e.g.,
solint = @VisDependentProperty(default=5, null_input=[None, ‘’, ‘RESET’, -1])
-
skip_fully_flagged
¶ VisDependentProperty is a Python data descriptor that standardises the behaviour of pipeline Inputs properties and lets them create default values more easily.
On reading a VisDependentProperty (ie. using the dot prefix: inputs.solint), one of two things happens:
If a NullMarker is found - signifying that no user input has been provided - and a ‘getter’ function has been defined, the getter function will be called to provide a default value for that measurement set.
If a user has overridden the value (eg. inputs.solint = 123), that value will be retrieved.
The value, either the default from step 1 or user-provided from step 2, is run through the optional postprocess function, which gives a final opportunity to change the value depending on the state/value of other properties.
A VisDependentProperty can be made read-only by specifying ‘readonly=True’ when creating the instance.
A VisDependentProperty can be hidden from the containing Inputs string representation by setting ‘hidden=True’ when creating the instance. This will hide the property from the web log and CLI getInputs calls.
Each VisDependentProperty has a set of values it considers equivalent to null. When the user sets the VDP value to one of these null values, the VDP machinery converts this to a private NullObject marker that signifies the property is now unset, resulting in the default value being returned next time the property is read. Developers can specify which values should be converted to NullObject by specifying null_input at creation time, e.g.,
solint = @VisDependentProperty(default=5, null_input=[None, ‘’, ‘RESET’, -1])
-
use_antenna_names
¶ VisDependentProperty is a Python data descriptor that standardises the behaviour of pipeline Inputs properties and lets them create default values more easily.
On reading a VisDependentProperty (ie. using the dot prefix: inputs.solint), one of two things happens:
If a NullMarker is found - signifying that no user input has been provided - and a ‘getter’ function has been defined, the getter function will be called to provide a default value for that measurement set.
If a user has overridden the value (eg. inputs.solint = 123), that value will be retrieved.
The value, either the default from step 1 or user-provided from step 2, is run through the optional postprocess function, which gives a final opportunity to change the value depending on the state/value of other properties.
A VisDependentProperty can be made read-only by specifying ‘readonly=True’ when creating the instance.
A VisDependentProperty can be hidden from the containing Inputs string representation by setting ‘hidden=True’ when creating the instance. This will hide the property from the web log and CLI getInputs calls.
Each VisDependentProperty has a set of values it considers equivalent to null. When the user sets the VDP value to one of these null values, the VDP machinery converts this to a private NullObject marker that signifies the property is now unset, resulting in the default value being returned next time the property is read. Developers can specify which values should be converted to NullObject by specifying null_input at creation time, e.g.,
solint = @VisDependentProperty(default=5, null_input=[None, ‘’, ‘RESET’, -1])
-
-
class
pipeline.h.tasks.common.viewflaggers.
MatrixFlaggerResults
(vis=None)[source]¶ Bases:
pipeline.infrastructure.basetask.Results
,pipeline.h.tasks.common.flaggableviewresults.FlaggableViewResults
-
merge_with_context
(context)[source]¶ Merge these results with the given context.
This method will be called during the execution of accept(). For calibration tasks, a typical implementation will register caltables with the pipeline callibrary.
At this point the result is deemed safe to merge, so no further checks on the context need be performed.
-
-
class
pipeline.h.tasks.common.viewflaggers.
VectorFlagger
(inputs)[source]¶ Bases:
pipeline.infrastructure.basetask.StandardTaskTemplate
-
Inputs
¶ alias of
VectorFlaggerInputs
-
analyse
(result)[source]¶ Determine the best parameters by analysing the given jobs before returning any final jobs to execute.
- Parameters
jobs (a list of
JobRequest
) – the job requests generated byprepare()
- Return type
Result
-
generate_flags
(vector)[source]¶ Calculate the statistics of a vector and flag the data according to a list of specified rules.
Keyword arguments: vector - SpectrumResult object containing data to be flagged. rules - Rules to be applied.
-
static
make_flag_rules
(flag_edges=False, edge_limit=2.0, flag_minabs=False, fmin_limit=0.0, flag_nmedian=False, fnm_lo_limit=0.7, fnm_hi_limit=1.3, flag_hilo=False, fhl_limit=5.0, fhl_minsample=5, flag_sharps=False, sharps_limit=0.05, flag_diffmad=False, diffmad_limit=10, diffmad_nchan_limit=4, flag_tmf=None, tmf_frac_limit=0.1, tmf_nchan_limit=4)[source]¶ Generate a list of flagging rules from a set of flagging parameters. Added detailed docs here.
-
-
class
pipeline.h.tasks.common.viewflaggers.
VectorFlaggerInputs
(context, output_dir=None, vis=None, datatask=None, viewtask=None, flagsettertask=None, rules=None, niter=None, iter_datatask=None, use_antenna_names=None, prepend=None)[source]¶ Bases:
pipeline.infrastructure.vdp.StandardInputs
-
prepend
¶ VisDependentProperty is a Python data descriptor that standardises the behaviour of pipeline Inputs properties and lets them create default values more easily.
On reading a VisDependentProperty (ie. using the dot prefix: inputs.solint), one of two things happens:
If a NullMarker is found - signifying that no user input has been provided - and a ‘getter’ function has been defined, the getter function will be called to provide a default value for that measurement set.
If a user has overridden the value (eg. inputs.solint = 123), that value will be retrieved.
The value, either the default from step 1 or user-provided from step 2, is run through the optional postprocess function, which gives a final opportunity to change the value depending on the state/value of other properties.
A VisDependentProperty can be made read-only by specifying ‘readonly=True’ when creating the instance.
A VisDependentProperty can be hidden from the containing Inputs string representation by setting ‘hidden=True’ when creating the instance. This will hide the property from the web log and CLI getInputs calls.
Each VisDependentProperty has a set of values it considers equivalent to null. When the user sets the VDP value to one of these null values, the VDP machinery converts this to a private NullObject marker that signifies the property is now unset, resulting in the default value being returned next time the property is read. Developers can specify which values should be converted to NullObject by specifying null_input at creation time, e.g.,
solint = @VisDependentProperty(default=5, null_input=[None, ‘’, ‘RESET’, -1])
-
use_antenna_names
¶ VisDependentProperty is a Python data descriptor that standardises the behaviour of pipeline Inputs properties and lets them create default values more easily.
On reading a VisDependentProperty (ie. using the dot prefix: inputs.solint), one of two things happens:
If a NullMarker is found - signifying that no user input has been provided - and a ‘getter’ function has been defined, the getter function will be called to provide a default value for that measurement set.
If a user has overridden the value (eg. inputs.solint = 123), that value will be retrieved.
The value, either the default from step 1 or user-provided from step 2, is run through the optional postprocess function, which gives a final opportunity to change the value depending on the state/value of other properties.
A VisDependentProperty can be made read-only by specifying ‘readonly=True’ when creating the instance.
A VisDependentProperty can be hidden from the containing Inputs string representation by setting ‘hidden=True’ when creating the instance. This will hide the property from the web log and CLI getInputs calls.
Each VisDependentProperty has a set of values it considers equivalent to null. When the user sets the VDP value to one of these null values, the VDP machinery converts this to a private NullObject marker that signifies the property is now unset, resulting in the default value being returned next time the property is read. Developers can specify which values should be converted to NullObject by specifying null_input at creation time, e.g.,
solint = @VisDependentProperty(default=5, null_input=[None, ‘’, ‘RESET’, -1])
-
-
class
pipeline.h.tasks.common.viewflaggers.
VectorFlaggerResults
(vis=None)[source]¶ Bases:
pipeline.infrastructure.basetask.Results
,pipeline.h.tasks.common.flaggableviewresults.FlaggableViewResults
-
merge_with_context
(context)[source]¶ Merge these results with the given context.
This method will be called during the execution of accept(). For calibration tasks, a typical implementation will register caltables with the pipeline callibrary.
At this point the result is deemed safe to merge, so no further checks on the context need be performed.
-