pipeline.hifa.tasks.fluxscale package

Submodules

pipeline.hifa.tasks.fluxscale.display module

class pipeline.hifa.tasks.fluxscale.display.GFluxscaleSummaryChart(context, output_dir, calto, intent='', ydatacolumn='model', ant='', uvrange='', **overrides)[source]

Bases: pipeline.hif.tasks.setmodel.display.BasebandSummaryChart

Create an amplitude vs UV distance plot for baseband.

pipeline.hifa.tasks.fluxscale.fluxes module

pipeline.hifa.tasks.fluxscale.fluxes.export_flux_from_fit_result(results, context, filename, fieldids_with_spix=None)[source]

Export flux densities from a set of results to a CSV file. Optional merge in spix values for fields in mergefields.

pipeline.hifa.tasks.fluxscale.gcorfluxscale module

class pipeline.hifa.tasks.fluxscale.gcorfluxscale.GcorFluxscale(inputs)[source]

Bases: pipeline.infrastructure.basetask.StandardTaskTemplate

Inputs

alias of GcorFluxscaleInputs

analyse(result)[source]

Determine the best parameters by analysing the given jobs before returning any final jobs to execute.

Parameters

jobs (a list ofJobRequest) – the job requests generated by prepare()

Return type

Result

prepare(**parameters)[source]

Prepare job requests for execution.

Parameters

parameters – the parameters to pass through to the subclass. Refer to the implementing subclass for specific information on what these parameters are.

Return type

a class implementing Result

class pipeline.hifa.tasks.fluxscale.gcorfluxscale.GcorFluxscaleInputs(context, output_dir=None, vis=None, caltable=None, fluxtable=None, reffile=None, reference=None, transfer=None, refspwmap=None, refintent=None, transintent=None, solint=None, phaseupsolint=None, minsnr=None, refant=None, hm_resolvedcals=None, antenna=None, uvrange=None, peak_fraction=None)[source]

Bases: pipeline.hif.tasks.fluxscale.fluxscale.FluxscaleInputs

antenna

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:

  1. 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.

  2. If a user has overridden the value (eg. inputs.solint = 123), that value will be retrieved.

  3. 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])

hm_resolvedcals

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:

  1. 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.

  2. If a user has overridden the value (eg. inputs.solint = 123), that value will be retrieved.

  3. 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])

minsnr

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:

  1. 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.

  2. If a user has overridden the value (eg. inputs.solint = 123), that value will be retrieved.

  3. 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])

peak_fraction

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:

  1. 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.

  2. If a user has overridden the value (eg. inputs.solint = 123), that value will be retrieved.

  3. 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])

phaseupsolint

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:

  1. 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.

  2. If a user has overridden the value (eg. inputs.solint = 123), that value will be retrieved.

  3. 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])

refant

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:

  1. 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.

  2. If a user has overridden the value (eg. inputs.solint = 123), that value will be retrieved.

  3. 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])

reffile

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:

  1. 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.

  2. If a user has overridden the value (eg. inputs.solint = 123), that value will be retrieved.

  3. 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])

refspwmap

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:

  1. 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.

  2. If a user has overridden the value (eg. inputs.solint = 123), that value will be retrieved.

  3. 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])

solint

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:

  1. 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.

  2. If a user has overridden the value (eg. inputs.solint = 123), that value will be retrieved.

  3. 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])

transintent

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:

  1. 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.

  2. If a user has overridden the value (eg. inputs.solint = 123), that value will be retrieved.

  3. 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])

uvrange

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:

  1. 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.

  2. If a user has overridden the value (eg. inputs.solint = 123), that value will be retrieved.

  3. 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.hifa.tasks.fluxscale.gcorfluxscale.GcorFluxscaleResults(vis, resantenna=None, uvrange=None, measurements=None, fluxscale_measurements=None, applies_adopted=False)[source]

Bases: pipeline.h.tasks.common.commonfluxresults.FluxCalibrationResults

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.

Parameters

context (Context) – the target Context

class pipeline.hifa.tasks.fluxscale.gcorfluxscale.SessionGcorFluxscale(inputs)[source]

Bases: pipeline.infrastructure.basetask.StandardTaskTemplate

Inputs

alias of SessionGcorFluxscaleInputs

analyse(assessed)[source]

Determine the best parameters by analysing the given jobs before returning any final jobs to execute.

Parameters

jobs (a list ofJobRequest) – the job requests generated by prepare()

Return type

Result

is_multi_vis_task = True
prepare()[source]

Prepare job requests for execution.

Parameters

parameters – the parameters to pass through to the subclass. Refer to the implementing subclass for specific information on what these parameters are.

Return type

a class implementing Result

class pipeline.hifa.tasks.fluxscale.gcorfluxscale.SessionGcorFluxscaleInputs(context, output_dir=None, vis=None, caltable=None, fluxtable=None, reffile=None, reference=None, transfer=None, refspwmap=None, refintent=None, transintent=None, solint=None, phaseupsolint=None, minsnr=None, refant=None, hm_resolvedcals=None, antenna=None, uvrange=None, peak_fraction=None, parallel=None)[source]

Bases: pipeline.hifa.tasks.fluxscale.gcorfluxscale.GcorFluxscaleInputs

property parallel

pipeline.hifa.tasks.fluxscale.qa module

class pipeline.hifa.tasks.fluxscale.qa.BandInfo(name, number, nominal_tsys, sensitivity)

Bases: tuple

property name

Alias for field number 0

property nominal_tsys

Alias for field number 2

property number

Alias for field number 1

property sensitivity

Alias for field number 3

class pipeline.hifa.tasks.fluxscale.qa.CaltableWrapper(filename, data, table_keywords, column_keywords)[source]

Bases: object

filter(spw=None, antenna=None, scan=None, field=None, **kwargs)[source]
class pipeline.hifa.tasks.fluxscale.qa.CaltableWrapperFactory[source]

Bases: object

static create_param_wrapper(path)[source]
static from_caltable(filename)[source]
class pipeline.hifa.tasks.fluxscale.qa.GcorFluxscaleListQAHandler[source]

Bases: pipeline.infrastructure.pipelineqa.QAPlugin

QA handler for a list containing FluxCalibrationResults.

child_cls

alias of pipeline.h.tasks.common.commonfluxresults.FluxCalibrationResults

generating_task

alias of pipeline.hifa.tasks.fluxscale.gcorfluxscale.GcorFluxscale

handle(context, result)[source]
result_cls

alias of collections.abc.Iterable

class pipeline.hifa.tasks.fluxscale.qa.GcorFluxscaleQAHandler[source]

Bases: pipeline.infrastructure.pipelineqa.QAPlugin

child_cls = None
generating_task

alias of pipeline.hifa.tasks.fluxscale.gcorfluxscale.GcorFluxscale

handle(context, result)[source]
result_cls

alias of pipeline.h.tasks.common.commonfluxresults.FluxCalibrationResults

pipeline.hifa.tasks.fluxscale.qa.compute_aggregate_bandwidth(spws)[source]

Computes the aggregate bandwidth for a list of spws of a measurement set. Accounts correctly for overlap. Called by gaincalSNR(). spw: an integer list, or comma-delimited string list of spw IDs

pipeline.hifa.tasks.fluxscale.qa.frequency_min_max_after_aliasing(spw)[source]
pipeline.hifa.tasks.fluxscale.qa.gaincalSNR(context, ms, tsysTable, flux, field, spws, intent='PHASE', required_snr=25, edge_fraction=0.03125, min_snr=10)[source]

Computes the per-antenna SNR expected for gaincal(solint=’inf’) on a per-spw basis and recommends whether bandwidth transfer and/or combine=’spw’ is needed.

This function is based upon the analysisUtils gaincalSNR code by Todd Hunter.

Parameters
  • context – pipeline Context

  • ms – MeasurementSet domain object

  • tsysTable (str) – path to Tsys caltable

  • flux ([FluxDensity, ..]) – the list of flux measurements to use

  • field (Field) – the field to use

  • spws ([SpectralWindow, ..]) – the spectral windows to make predictions for

  • intent (str) – observing intent to use for the calibrator

  • required_snr – threshold for which to make decisions (default=25)

  • edge_fraction – the fraction of bandwidth to ignore on each edge of a TDM window (default=0.03125)

  • min_snr – threshold for when even aggregate bandwidth is expected to fail (default=10)

Returns

a dictionary keyed by spectral window ID

pipeline.hifa.tasks.fluxscale.qa.get_dtype(tb, col)[source]

Get the numpy data type for a CASA caltable column.

Parameters
  • tb – CASA table tool with caltable open.

  • col – name of column to process

Returns

3-tuple of column name, NumPy dtype, column shape

pipeline.hifa.tasks.fluxscale.qa.median(data, start)[source]
pipeline.hifa.tasks.fluxscale.qa.median_channel_width(spw)[source]
pipeline.hifa.tasks.fluxscale.qa.median_scan_duration(scans)[source]
pipeline.hifa.tasks.fluxscale.qa.score_kspw(context, result)[source]

pipeline.hifa.tasks.fluxscale.renderer module

Created on 23 Oct 2014

@author: sjw

class pipeline.hifa.tasks.fluxscale.renderer.AdoptedTR(vis, fields)

Bases: tuple

property fields

Alias for field number 1

property vis

Alias for field number 0

class pipeline.hifa.tasks.fluxscale.renderer.FluxTR(vis, field, spw, freqbw, i, q, u, v, fluxratio, spix)

Bases: tuple

property field

Alias for field number 1

property fluxratio

Alias for field number 8

property freqbw

Alias for field number 3

property i

Alias for field number 4

property q

Alias for field number 5

property spix

Alias for field number 9

property spw

Alias for field number 2

property u

Alias for field number 6

property v

Alias for field number 7

property vis

Alias for field number 0

class pipeline.hifa.tasks.fluxscale.renderer.T2_4MDetailsGFluxscaleRenderer(uri='gfluxscale.mako', description='Transfer fluxscale from amplitude calibrator', always_rerender=False)[source]

Bases: pipeline.infrastructure.renderer.basetemplates.T2_4MDetailsDefaultRenderer

static create_flux_comparison_plots(context, results)[source]
create_plots(context, results, plotter_cls, intents, renderer_cls=None)[source]

Create plots and return a dictionary of vis:[Plots]. No antenna or UVrange selection.

create_plots_ants(context, results, plotter_cls, intents, renderer_cls=None)[source]

Create plots and return a dictionary of vis:[Plots]. Antenna and UVrange selection determined by heuristics.

static plots_for_result(context, result, plotter_cls, intents, renderer_cls=None, ant='', uvrange='')[source]
static sort_plots_by_baseband(d)[source]
update_mako_context(mako_context, pipeline_context, results)[source]
pipeline.hifa.tasks.fluxscale.renderer.create_flux_comparison_plots(context, output_dir, result, showatm=True)[source]
pipeline.hifa.tasks.fluxscale.renderer.make_adopted_table(results)[source]
pipeline.hifa.tasks.fluxscale.renderer.make_flux_table(context, results)[source]
pipeline.hifa.tasks.fluxscale.renderer.scale_flux(f1, s1, f2, spix)[source]

Returns flux at a frequency by extrapolating via the spectral index.

Parameters
  • f1 – frequency 1

  • s1 – flux density at frequency 1

  • f2 – frequency 2

  • spix – spectral index

Returns

flux density at frequency 2

Module contents