HOPS
HOPS class reference
Public Types | Public Member Functions | List of all members
hops::MHO_FringePass Class Reference

Encapsulates a single-baseline, single-pol-product fringe-fitting pass/run. More...

#include <MHO_FringePass.hh>

Public Types

using ControlEvaluatorFn = std::function< bool(MHO_ParameterStore *, const mho_json &, mho_json &) >
 Signature of a Python control-file evaluator, matching MHO_PyControlEvaluator::Evaluate. Injected from outside so that MHO_Fringe does not link against pybind11. More...
 

Public Member Functions

 MHO_FringePass ()
 
virtual ~MHO_FringePass ()=default
 
bool Configure ()
 Evaluate the control file and apply the resulting statements. Detects .py vs DSL extension automatically. More...
 
void CopyCommandLineParams (const MHO_ParameterStore &cmdline_params)
 Bulk-copy a command-line parameter store. Populates the /cmdline/* keys consumed by downstream helpers. Call this first, then use the per-pass setters below to supply any pass-specific fields. More...
 
void FlushProfileEvents ()
 Collect profiler events and store them at /profile/events in the pass parameter store. Call after Run() completes. More...
 
MHO_FringeDataGetFringeData ()
 
bool Initialize ()
 Open the scan directory, load vex data, and populate the parameter store. More...
 
bool IsSkipped ()
 
bool Run (const std::vector< MHO_FringeFitterVisitor * > &plugin_visitors={}, const std::vector< MHO_FringeFitterVisitor * > &output_visitors={}, const std::vector< MHO_FringePlotVisitor * > &plot_visitors={})
 Construct the fringe fitter, register plugin visitors, run the fit loop, finalize, and dispatch output/plot visitors. More...
 
void SetBaseline (const std::string &baseline)
 
void SetBuildTimestamp (const std::string &ts)
 
void SetControlFile (const std::string &path)
 Override the control-file path. If not set, the path from /cmdline/control_file (populated by CopyCommandLineParams) is used. More...
 
void SetFrequencyGroup (const std::string &fgroup)
 
void SetPolProduct (const std::string &polprod)
 
void SetPythonControlEvaluator (ControlEvaluatorFn fn)
 Inject a Python control evaluator so that MHO_Fringe itself does not need to link against pybind11. Must be called before Configure() if .py control files are to be supported. More...
 
void SetRootFile (const std::string &root_file)
 
void SetScanDirectory (const std::string &dir)
 
void SetScanName (const std::string &scan)
 

Detailed Description

Encapsulates a single-baseline, single-pol-product fringe-fitting pass/run.

Author
J. Barrett - barre.nosp@m.ttj@.nosp@m.mit.e.nosp@m.du
Date

MHO_FringePass owns a MHO_FringeData and drives the full per-pass lifecycle: data initialization, control-file evaluation, fringe-fitter construction, run loop, and visitor dispatch. It is the reusable core shared between fourfit4 (command-line driver) and the Python library API.

Typical usage (from fourfit4)

pass.CopyCommandLineParams(cmdline_params);
pass.SetScanDirectory(spec["input_directory"]);
pass.SetBaseline(spec["baseline"]);
pass.SetPolProduct(spec["polprod"]);
pass.SetFrequencyGroup(spec["frequency_group"]);
pass.SetScanName(spec["scan"]);
pass.SetBuildTimestamp(HOPS_BUILD_TIMESTAMP);
if (!pass.Initialize()) continue;
if (!pass.Configure()) continue;
pass.Run(plugin_visitors, output_visitors, plot_visitors);
if (pass.IsSkipped()) continue;
#define HOPS_BUILD_TIMESTAMP
Definition: blingfit.cc:50
MHO_FringePass()
Definition: MHO_FringePass.cc:17
Note
MHO_FringePass does not depend on pybind11 (and we do not want this dependency here)! Python control files (.py extension) have to be injected as a functor via SetPythonControlEvaluator() before calling Configure().

Member Typedef Documentation

◆ ControlEvaluatorFn

Signature of a Python control-file evaluator, matching MHO_PyControlEvaluator::Evaluate. Injected from outside so that MHO_Fringe does not link against pybind11.

Constructor & Destructor Documentation

◆ MHO_FringePass()

hops::MHO_FringePass::MHO_FringePass ( )

◆ ~MHO_FringePass()

virtual hops::MHO_FringePass::~MHO_FringePass ( )
virtualdefault

Member Function Documentation

◆ Configure()

bool hops::MHO_FringePass::Configure ( )

Evaluate the control file and apply the resulting statements. Detects .py vs DSL extension automatically.

Returns
false on parse/evaluation failure or if the pass was marked skipped by a 'skip' control statement.

◆ CopyCommandLineParams()

void hops::MHO_FringePass::CopyCommandLineParams ( const MHO_ParameterStore cmdline_params)

Bulk-copy a command-line parameter store. Populates the /cmdline/* keys consumed by downstream helpers. Call this first, then use the per-pass setters below to supply any pass-specific fields.

◆ FlushProfileEvents()

void hops::MHO_FringePass::FlushProfileEvents ( )

Collect profiler events and store them at /profile/events in the pass parameter store. Call after Run() completes.

◆ GetFringeData()

MHO_FringeData* hops::MHO_FringePass::GetFringeData ( )
inline

◆ Initialize()

bool hops::MHO_FringePass::Initialize ( )

Open the scan directory, load vex data, and populate the parameter store.

Returns
false if the scan directory or requested baseline is invalid.

◆ IsSkipped()

bool hops::MHO_FringePass::IsSkipped ( )

◆ Run()

bool hops::MHO_FringePass::Run ( const std::vector< MHO_FringeFitterVisitor * > &  plugin_visitors = {},
const std::vector< MHO_FringeFitterVisitor * > &  output_visitors = {},
const std::vector< MHO_FringePlotVisitor * > &  plot_visitors = {} 
)

Construct the fringe fitter, register plugin visitors, run the fit loop, finalize, and dispatch output/plot visitors.

Parameters
plugin_visitorsVisitors registered on the fitter before Configure() - typically the Python plugin operators. Accepted before ffit->Configure().
output_visitorsFile-output visitors accepted after Finalize(). Pass an empty vector to suppress file output.
plot_visitorsPlot visitors accepted after output visitors.
Returns
false only on hard errors (fitter construction failure); a skipped pass returns true, will check IsSkipped() afterwards.

◆ SetBaseline()

void hops::MHO_FringePass::SetBaseline ( const std::string &  baseline)

◆ SetBuildTimestamp()

void hops::MHO_FringePass::SetBuildTimestamp ( const std::string &  ts)

◆ SetControlFile()

void hops::MHO_FringePass::SetControlFile ( const std::string &  path)

Override the control-file path. If not set, the path from /cmdline/control_file (populated by CopyCommandLineParams) is used.

◆ SetFrequencyGroup()

void hops::MHO_FringePass::SetFrequencyGroup ( const std::string &  fgroup)

◆ SetPolProduct()

void hops::MHO_FringePass::SetPolProduct ( const std::string &  polprod)

◆ SetPythonControlEvaluator()

void hops::MHO_FringePass::SetPythonControlEvaluator ( ControlEvaluatorFn  fn)

Inject a Python control evaluator so that MHO_Fringe itself does not need to link against pybind11. Must be called before Configure() if .py control files are to be supported.

◆ SetRootFile()

void hops::MHO_FringePass::SetRootFile ( const std::string &  root_file)

◆ SetScanDirectory()

void hops::MHO_FringePass::SetScanDirectory ( const std::string &  dir)

◆ SetScanName()

void hops::MHO_FringePass::SetScanName ( const std::string &  scan)

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