pipeline.hsdn.tasks.restoredata package

Submodules

pipeline.hsdn.tasks.restoredata.ampcal module

class pipeline.hsdn.tasks.restoredata.ampcal.SDAmpCal(inputs)[source]

Bases: pipeline.infrastructure.basetask.StandardTaskTemplate

Inputs

alias of SDAmpCalInputs

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()[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.hsdn.tasks.restoredata.ampcal.SDAmpCalInputs(context, output_dir=None, infiles=None, caltable=None, reffile=None, endpoint=None)[source]

Bases: pipeline.infrastructure.vdp.StandardInputs

Original is pipeline.hsd.tasks.k2jycal.k2jycal.py. This ampcal.py is modified specially for NRO data to correct scale differences between beams of FOREST.

caltable

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

infiles

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

class pipeline.hsdn.tasks.restoredata.ampcal.SDAmpCalResults(vis=None, final=[], pool=[], reffile=None, factors={}, all_ok=False)[source]

Bases: pipeline.infrastructure.basetask.Results

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

pipeline.hsdn.tasks.restoredata.ampcal.export_jyperk(outfile, factors)[source]
pipeline.hsdn.tasks.restoredata.ampcal.rearrange_factors_list(factors_list)[source]

Rearrange scaling factor list to dictionary which looks like {‘MS’: {‘spw’: {‘Ant’: {‘pol’: factor}}}}

pipeline.hsdn.tasks.restoredata.csvfilereader module

pipeline.hsdn.tasks.restoredata.csvfilereader.read(context, filename)[source]

Original is pipeline.hsd.tasks.k2jycal.jyperkreader.py. This csvfilereader.py is simplified specially for NRO data to read reference file (reffile=nroscalefile.csv). Reads factors from a file and returns a string list of [[‘MS’,’ant’,’spwid’,’polid’,’factor’], …]

pipeline.hsdn.tasks.restoredata.csvfilereader.read_ms_based(reffile)[source]

pipeline.hsdn.tasks.restoredata.renderer module

class pipeline.hsdn.tasks.restoredata.renderer.ApplycalAmpVsFreqPlotRenderer(context, result, plots)[source]

Bases: pipeline.infrastructure.renderer.basetemplates.JsonPlotRenderer

class pipeline.hsdn.tasks.restoredata.renderer.ApplycalAmpVsFreqSciencePlotRenderer(context, result, plots)[source]

Bases: pipeline.infrastructure.renderer.basetemplates.JsonPlotRenderer

class pipeline.hsdn.tasks.restoredata.renderer.ApplycalAmpVsTimePlotRenderer(context, result, plots)[source]

Bases: pipeline.infrastructure.renderer.basetemplates.JsonPlotRenderer

class pipeline.hsdn.tasks.restoredata.renderer.ApplycalAmpVsUVPlotRenderer(context, result, plots)[source]

Bases: pipeline.infrastructure.renderer.basetemplates.JsonPlotRenderer

class pipeline.hsdn.tasks.restoredata.renderer.ApplycalAmpVsUVSciencePlotRenderer(context, result, plots)[source]

Bases: pipeline.infrastructure.renderer.basetemplates.JsonPlotRenderer

class pipeline.hsdn.tasks.restoredata.renderer.ApplycalPhaseVsFreqPlotRenderer(context, result, plots)[source]

Bases: pipeline.infrastructure.renderer.basetemplates.JsonPlotRenderer

class pipeline.hsdn.tasks.restoredata.renderer.ApplycalPhaseVsTimePlotRenderer(context, result, plots)[source]

Bases: pipeline.infrastructure.renderer.basetemplates.JsonPlotRenderer

class pipeline.hsdn.tasks.restoredata.renderer.ApplycalPhaseVsUVPlotRenderer(context, result, plots)[source]

Bases: pipeline.infrastructure.renderer.basetemplates.JsonPlotRenderer

pipeline.hsdn.tasks.restoredata.renderer.FlagTotal

alias of pipeline.hsdn.tasks.restoredata.renderer.FlagSummary

class pipeline.hsdn.tasks.restoredata.renderer.JyperKTR(spw, msname, antenna, pol, factor)

Bases: tuple

property antenna

Alias for field number 2

property factor

Alias for field number 4

property msname

Alias for field number 1

property pol

Alias for field number 3

property spw

Alias for field number 0

class pipeline.hsdn.tasks.restoredata.renderer.JyperKTRV(virtualspw, msname, realspw, antenna, pol, factor)

Bases: tuple

property antenna

Alias for field number 3

property factor

Alias for field number 5

property msname

Alias for field number 1

property pol

Alias for field number 4

property realspw

Alias for field number 2

property virtualspw

Alias for field number 0

class pipeline.hsdn.tasks.restoredata.renderer.T2_4MDetailsNRORestoreDataRenderer(uri='hsdn_restoredata.mako', description='Restoredata with scale adjustment between beams for NRO FOREST data.', always_rerender=False)[source]

Bases: pipeline.infrastructure.renderer.basetemplates.T2_4MDetailsDefaultRenderer

calapps_for_result(result)[source]
caltypes_for_result(result)[source]
create_single_dish_science_plots(context, results)[source]

Create plots for the science targets, returning two dictionaries of vis:[Plots]. MODIFIED for single dish

flags_by_intent(ms, summaries)[source]
flags_by_science_spws(ms, summaries)[source]
flags_for_result(result, context)[source]
get_gain_solution_type(gaintable)[source]
plots_for_result(context, result, plotter_cls, intents, renderer_cls=None, **kwargs)[source]
static science_plots_for_result(context, result, plotter_cls, fields, uvrange=None, renderer_cls=None)[source]
update_mako_context(ctx, context, results)[source]

pipeline.hsdn.tasks.restoredata.restoredata module

class pipeline.hsdn.tasks.restoredata.restoredata.NRORestoreData(inputs)[source]

Bases: pipeline.h.tasks.restoredata.restoredata.RestoreData

Inputs

alias of NRORestoreDataInputs

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.hsdn.tasks.restoredata.restoredata.NRORestoreDataInputs(context, vis=None, caltable=None, reffile=None, products_dir=None, rawdata_dir=None, output_dir=None)[source]

Bases: pipeline.h.tasks.restoredata.restoredata.RestoreDataInputs

caltable

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

class pipeline.hsdn.tasks.restoredata.restoredata.NRORestoreDataResults(importdata_results=None, applycal_results=None, ampcal_results=None)[source]

Bases: pipeline.h.tasks.restoredata.restoredata.RestoreDataResults

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

pipeline.hsdn.tasks.restoredata.worker module

class pipeline.hsdn.tasks.restoredata.worker.SDAmpCalWorker(inputs)[source]

Bases: pipeline.infrastructure.basetask.StandardTaskTemplate

Per MS caltable creation

Inputs

alias of SDAmpCalWorkerInputs

analyse(result)[source]

Define factors actually used and analyze if the factors are provided to all relevant data in MS.

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.hsdn.tasks.restoredata.worker.SDAmpCalWorkerInputs(context, output_dir, vis, caltable, factors)[source]

Bases: pipeline.infrastructure.vdp.StandardInputs

caltype

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

to_casa_args()[source]

Express these inputs as a dictionary of CASA arguments. The values in the dictionary are in a format suitable for CASA and can be directly passed to the CASA task.

Return type

a dictionary of string/??? kw/val pairs

class pipeline.hsdn.tasks.restoredata.worker.SDAmpCalWorkerResults(vis, calapp=None, factors={})[source]

Bases: pipeline.infrastructure.basetask.Results

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

Module contents