HOPS
HOPS class reference
Public Member Functions | List of all members
hops_control.config.Config Class Reference

Public Member Functions

def __init__ (self, dict format_dict)
 
def __getattr__ (self, str name)
 
str __repr__ (self)
 
list available_keywords (self)
 
_ConditionBuilder IF (self)
 
_ConditionBuilder if_baseline (self, str b)
 
_ConditionBuilder if_fgroup (self, str fg)
 
_ConditionBuilder if_scan_after (self, str scan)
 
_ConditionBuilder if_scan_before (self, str scan)
 
_ConditionBuilder if_scan_between (self, str lo, str hi)
 
_ConditionBuilder if_source (self, str s)
 
_ConditionBuilder if_station (self, str s)
 
list to_json (self)
 

Detailed Description

Accumulator for fringe-fitter control statements.

Constructed by ``MHO_PyControlEvaluator`` and passed as the second argument
to the user's ``configure()`` function.

Each keyword from the control-file format (e.g. ``ref_freq``, ``pc_phases``,
``notches``, ...) is available as a method::

    cfg.ref_freq(215000.0)
    cfg.pc_mode("manual")
    cfg.pc_phases_l("abcde", [1.0, -2.0, 3.0, -4.0, 5.0])

Use ``cfg.IF()`` to open a conditional block::

    with cfg.IF().station("G"):
        cfg.sampler_delay_x([-140, 180, 180, 180])

    with cfg.IF().source("3C279").AND().fgroup("X"):
        cfg.ref_freq(86000.0)

convenience shortcuts are provided for the common single-predicate case::

    with cfg.if_station("G"):       # same as cfg.IF().station("G")
        cfg.sampler_delay_x(...)

Calling an unknown keyword raises :exc:`AttributeError`.
Call :meth:`available_keywords` to see the full list.

Constructor & Destructor Documentation

◆ __init__()

def hops_control.config.Config.__init__ (   self,
dict  format_dict 
)

Member Function Documentation

◆ __getattr__()

def hops_control.config.Config.__getattr__ (   self,
str  name 
)

◆ __repr__()

str hops_control.config.Config.__repr__ (   self)

◆ available_keywords()

list hops_control.config.Config.available_keywords (   self)
Return a sorted list of all usable keyword names.

◆ IF()

_ConditionBuilder hops_control.config.Config.IF (   self)
Return a fresh :class:`_ConditionBuilder` for this config.

◆ if_baseline()

_ConditionBuilder hops_control.config.Config.if_baseline (   self,
str  b 
)
Shortcut for ``cfg.IF().baseline(b)``.

◆ if_fgroup()

_ConditionBuilder hops_control.config.Config.if_fgroup (   self,
str  fg 
)
Shortcut for ``cfg.IF().fgroup(fg)``.

◆ if_scan_after()

_ConditionBuilder hops_control.config.Config.if_scan_after (   self,
str  scan 
)
Shortcut for ``cfg.IF().scan_after(scan)``.

◆ if_scan_before()

_ConditionBuilder hops_control.config.Config.if_scan_before (   self,
str  scan 
)
Shortcut for ``cfg.IF().scan_before(scan)``.

◆ if_scan_between()

_ConditionBuilder hops_control.config.Config.if_scan_between (   self,
str  lo,
str  hi 
)
Shortcut for ``cfg.IF().scan_between(lo, hi)``.

◆ if_source()

_ConditionBuilder hops_control.config.Config.if_source (   self,
str  s 
)
Shortcut for ``cfg.IF().source(s)``.

◆ if_station()

_ConditionBuilder hops_control.config.Config.if_station (   self,
str  s 
)
Shortcut for ``cfg.IF().station(s)``.

◆ to_json()

list hops_control.config.Config.to_json (   self)
Serialise accumulated blocks into the conditional-block format
expected by ``MHO_ParameterManager`` / ``MHO_OperatorBuilderManager``.

Returns a list of conditional blocks in emission order.  Each block has
the ``value`` array that preserves the original condition tokens so that
downstream operator builders (e.g. ``MHO_StationDelayCorrectionBuilder``)
can read ``fConditions["value"]`` to determine which station / baseline
an operator applies to.

The documentation for this class was generated from the following file: