HOPS
HOPS class reference
Public Member Functions | Public Attributes | List of all members
hops::MHO_ComputePlotData Class Reference

Class MHO_ComputePlotData. More...

#include <MHO_ComputePlotData.hh>

Public Member Functions

 MHO_ComputePlotData ()
 
virtual ~MHO_ComputePlotData ()
 
xpower_amp_type calc_dr ()
 Calculates delay-rate (dr) function (amplitude vs delay rate) More...
 
xpower_amp_type calc_dr_segs_phase (double &coh_avg_phase, phasor_type &phasor_segs)
 Merged computation of delay-rate spectrum, phasor segments, and fringe phase. Single ch->ap pass over fSBDMaxBin replaces three separate passes. DR uses fVRTable; segs and phase use fVRPhaseTable. More...
 
std::string calc_error_code (const mho_json &plot_dict)
 calcuates the fringe error code More...
 
void calc_freqrms (phasor_type &phasors, double coh_avg_phase, double fringe_amp, double total_summed_weights, double snr, double &freqrms_phase, double &freqrms_amp, double &inc_avg_amp_freq)
 Calculates frequency root mean square (phase and amplitude) for given phasors. More...
 
xpower_amp_type calc_mbd ()
 Calculates Multi-Band Delay (MBD) function (amplitude vs. mbd) More...
 
double calc_phase ()
 Calculates fringe phase using weighted sum and fitted (delay, delay-rate) rotation. More...
 
std::string calc_quality_code ()
 calcuates the fringe quality code More...
 
xpower_amp_type calc_sbd ()
 Calculates Single Band Delay (SBD) function (amplitude vs. sbd) More...
 
void calc_sbd_and_xpower_spec (xpower_amp_type &sbd_amp, xpower_type &cp_spectrum)
 Merged computation of SBD amplitude spectrum and cross-power spectrum. Single ch->ap->bin pass replaces two separate bin->ch->ap passes. calc_sbd uses fVRTable; calc_xpower_spec uses fVRPhaseTable. More...
 
phasor_type calc_segs ()
 Calculates and returns time-averaged phasor segments for each channel. More...
 
void calc_timerms (phasor_type &phasors, std::size_t nseg, std::size_t apseg, double coh_avg_phase, double fringe_amp, double total_summed_weights, double snr, double &timerms_phase, double &timerms_amp, double &inc_avg_amp)
 Calculates time-domain measurements (phase, amplitude, average) from phasors data. More...
 
xpower_type calc_xpower_spec ()
 Calculates and returns the cross-power spectrum for a given SBD array. More...
 
void correct_vis ()
 Corrects visibility data by applying fringe solution. More...
 
void DisableOptimizeClosure ()
 Disables optimize closure by setting underlying MHO_FringeRotation (fRot) optimizeClosure to false. More...
 
void dump_manual_pcmodel (mho_json &plot_dict, int station_flag, std::string pol, std::string key_suffix="")
 
void dump_multitone_pcmodel (mho_json &plot_dict, int station_flag, std::string pol, std::string key_suffix="")
 
void DumpInfoToJSON (mho_json &plot_dict)
 Dumps fringe plot data into a JSON object for visualization/consumption by plotting routine. More...
 
void DumpSpectralLineInfoToJSON (mho_json &plot_dict)
 Dumps spectral-line fringe plot data into a JSON object. Uses the 'spec_dr' container (stored by MHO_SpectralLineFringeFitter) instead of the broadband 'sbd' container. Populates DLYRATE/DLYRATE_XAXIS (1-D DR spectrum), SL_FREQ_AMP/SL_FREQ_PHS/SL_FREQ_XAXIS (1-D freq spectrum at peak DR bin), and SL_2D_AMP/SL_2D_DR_AXIS/SL_2D_FREQ_AXIS (2-D amplitude surface at peak channel). More...
 
void EnableOptimizeClosure ()
 Sets optimize closure to true in underlying MHO_FringeRotation (fRot) object. More...
 
void Initialize ()
 Initializes member variables by retrieving values from parameter and container stores. More...
 
void precompute_chan_metadata ()
 Pre-computes per-channel metadata (freq, sideband sign, bandwidth) into flat arrays, eliminating repeated string-keyed label lookups inside the calc_* functions. More...
 
void precompute_vr_tables ()
 Pre-computes vrot lookup tables indexed as [ch * fNAP + ap]. Three tables are built to match the fRot state used by each calc_* function: fVRTable - default SBD params + fMBDelay (calc_sbd, calc_dr) fVRMBD0Table - default SBD params + MBD=0 (calc_mbd) fVRPhaseTable - proper SBD params + fMBDelay (calc_phase, calc_xpower_spec, calc_segs, correct_vis) More...
 
void SetContainerStore (MHO_ContainerStore *cStore)
 Setter for container store. More...
 
void SetMBDAnchor (std::string flag)
 Setter for mbd anchor (either: 'sbd' or 'model') More...
 
void SetOperatorToolbox (MHO_OperatorToolbox *toolbox)
 Setter for operator toolbox. More...
 
void SetParameterStore (MHO_ParameterStore *pStore)
 Setter for parameter store. More...
 
void SetVexInfo (const mho_json &vex_info)
 Setter for vex info. More...
 
void smooth_dr_spectrum_tcohere (std::size_t drsp_size, double ap_delta)
 Applies the t_cohere box-car smoothing to fDRAmpWorkspace in-place, replicating the make_plotdata.c behavior (wrapping, odd window). No-op when t_cohere is not set or <= 0. More...
 

Public Attributes

double fAmp
 
std::vector< double > fChanBandwidth
 
std::vector< double > fChanFreq
 
std::vector< int > fChanSideband
 
MHO_ContainerStorefContainerStore
 
MHO_CyclicRotator< xpower_typefCyclicRotator
 
double fDelayRate
 
xpower_amp_type fDRAmpWorkspace
 
xpower_type fDRWorkspace
 
MHO_MultidimensionalFastFourierTransform< xpower_typefFFTEngine
 
xpower_type fFringe
 
double fFringeRate
 
std::complex< double > fImagUnit
 
xpower_amp_type fMBDAmpWorkspace
 
std::string fMBDAnchor
 
double fMBDelay
 
xpower_type fMBDWorkspace
 
std::size_t fNAP
 
std::size_t fNChan
 
std::vector< int > fNLSBAP
 
std::vector< int > fNUSBAP
 
MHO_ParameterStorefParamStore
 
double fRefFreq
 
MHO_FringeRotation fRot
 
visibility_typefSBDArray
 
std::vector< double > fSBDBox
 
double fSBDelay
 
std::size_t fSBDMaxBin
 
MHO_OperatorToolboxfToolbox
 
double fTotalSummedWeights
 
bool fValid
 
mho_json fVexInfo
 
visibility_typefVisibilities
 
std::vector< std::complex< double > > fVRMBD0Table
 
std::vector< std::complex< double > > fVRPhaseTable
 
std::vector< std::complex< double > > fVRTable
 
weight_typefWeights
 
std::vector< std::vector< double > > seg_frac_lsb
 
std::vector< std::vector< double > > seg_frac_usb
 

Detailed Description

Class MHO_ComputePlotData.

class for computing fringe plot information

Author
J. Barrett - barre.nosp@m.ttj@.nosp@m.mit.e.nosp@m.du
Date
Mon Apr 24 10:01:21 2023 -0400

Constructor & Destructor Documentation

◆ MHO_ComputePlotData()

hops::MHO_ComputePlotData::MHO_ComputePlotData ( )

◆ ~MHO_ComputePlotData()

virtual hops::MHO_ComputePlotData::~MHO_ComputePlotData ( )
inlinevirtual

Member Function Documentation

◆ calc_dr()

xpower_amp_type hops::MHO_ComputePlotData::calc_dr ( )

Calculates delay-rate (dr) function (amplitude vs delay rate)

Returns
xpower_amp_type representing calculated delay-rate

◆ calc_dr_segs_phase()

xpower_amp_type hops::MHO_ComputePlotData::calc_dr_segs_phase ( double &  coh_avg_phase,
phasor_type phasor_segs 
)

Merged computation of delay-rate spectrum, phasor segments, and fringe phase. Single ch->ap pass over fSBDMaxBin replaces three separate passes. DR uses fVRTable; segs and phase use fVRPhaseTable.

Parameters
coh_avg_phaseOutput: coherent average phase (was calc_phase return value)
phasor_segsOutput: phasor segment data (was calc_segs return value)
Returns
xpower_amp_type delay-rate amplitude spectrum (was calc_dr return value)

◆ calc_error_code()

std::string hops::MHO_ComputePlotData::calc_error_code ( const mho_json plot_dict)

calcuates the fringe error code

◆ calc_freqrms()

void hops::MHO_ComputePlotData::calc_freqrms ( phasor_type phasors,
double  coh_avg_phase,
double  fringe_amp,
double  total_summed_weights,
double  snr,
double &  freqrms_phase,
double &  freqrms_amp,
double &  inc_avg_amp_freq 
)

Calculates frequency root mean square (phase and amplitude) for given phasors.

Parameters
phasorsReference to phasor_type object containing channel data
coh_avg_phaseCoherent average phase in radians
fringe_ampFringe amplitude
total_summed_weightsTotal summed weights
snrSignal-to-noise ratio
freqrms_phaseOutput: Frequency RMS phase
freqrms_ampOutput: Frequency RMS amplitude
inc_avg_amp_freqOutput: incoherent average amplitude (over frequency)

◆ calc_mbd()

xpower_amp_type hops::MHO_ComputePlotData::calc_mbd ( )

Calculates Multi-Band Delay (MBD) function (amplitude vs. mbd)

Returns
xpower_amp_type representing the calculated MBD.

◆ calc_phase()

double hops::MHO_ComputePlotData::calc_phase ( )

Calculates fringe phase using weighted sum and fitted (delay, delay-rate) rotation.

Returns
fringe phase as a double value.

◆ calc_quality_code()

std::string hops::MHO_ComputePlotData::calc_quality_code ( )

calcuates the fringe quality code

◆ calc_sbd()

xpower_amp_type hops::MHO_ComputePlotData::calc_sbd ( )

Calculates Single Band Delay (SBD) function (amplitude vs. sbd)

Returns
xpower_amp_type containing SBD power spectrum

◆ calc_sbd_and_xpower_spec()

void hops::MHO_ComputePlotData::calc_sbd_and_xpower_spec ( xpower_amp_type sbd_amp,
xpower_type cp_spectrum 
)

Merged computation of SBD amplitude spectrum and cross-power spectrum. Single ch->ap->bin pass replaces two separate bin->ch->ap passes. calc_sbd uses fVRTable; calc_xpower_spec uses fVRPhaseTable.

Parameters
sbd_ampOutput: SBD amplitude vs delay (was calc_sbd return value)
cp_spectrumOutput: cross-power spectrum (was calc_xpower_spec return value)

◆ calc_segs()

phasor_type hops::MHO_ComputePlotData::calc_segs ( )

Calculates and returns time-averaged phasor segments for each channel.

Returns
phasor_type containing calculated phasor segments.

◆ calc_timerms()

void hops::MHO_ComputePlotData::calc_timerms ( phasor_type phasors,
std::size_t  nseg,
std::size_t  apseg,
double  coh_avg_phase,
double  fringe_amp,
double  total_summed_weights,
double  snr,
double &  timerms_phase,
double &  timerms_amp,
double &  inc_avg_amp 
)

Calculates time-domain measurements (phase, amplitude, average) from phasors data.

Parameters
phasorsInput phasor data
nsegNumber of segments in phasors data
apsegAverage phase segment size
coh_avg_phaseCoherent average phase (degrees)
fringe_ampFringe amplitude
total_summed_weightsTotal summed weights
snrSignal to Noise Ratio
timerms_phaseOutput: Time RMS phase
timerms_ampOutput: Time RMS amplitude
inc_avg_ampOutput: incoherent average amplitude (over time)

◆ calc_xpower_spec()

xpower_type hops::MHO_ComputePlotData::calc_xpower_spec ( )

Calculates and returns the cross-power spectrum for a given SBD array.

Returns
xpower_type containing the calculated cross-power spectrum

◆ correct_vis()

void hops::MHO_ComputePlotData::correct_vis ( )

Corrects visibility data by applying fringe solution.

◆ DisableOptimizeClosure()

void hops::MHO_ComputePlotData::DisableOptimizeClosure ( )
inline

Disables optimize closure by setting underlying MHO_FringeRotation (fRot) optimizeClosure to false.

◆ dump_manual_pcmodel()

void hops::MHO_ComputePlotData::dump_manual_pcmodel ( mho_json plot_dict,
int  station_flag,
std::string  pol,
std::string  key_suffix = "" 
)

◆ dump_multitone_pcmodel()

void hops::MHO_ComputePlotData::dump_multitone_pcmodel ( mho_json plot_dict,
int  station_flag,
std::string  pol,
std::string  key_suffix = "" 
)

◆ DumpInfoToJSON()

void hops::MHO_ComputePlotData::DumpInfoToJSON ( mho_json plot_dict)

Dumps fringe plot data into a JSON object for visualization/consumption by plotting routine.

Parameters
plot_dictJSON object to store fringe plot data.

◆ DumpSpectralLineInfoToJSON()

void hops::MHO_ComputePlotData::DumpSpectralLineInfoToJSON ( mho_json plot_dict)

Dumps spectral-line fringe plot data into a JSON object. Uses the 'spec_dr' container (stored by MHO_SpectralLineFringeFitter) instead of the broadband 'sbd' container. Populates DLYRATE/DLYRATE_XAXIS (1-D DR spectrum), SL_FREQ_AMP/SL_FREQ_PHS/SL_FREQ_XAXIS (1-D freq spectrum at peak DR bin), and SL_2D_AMP/SL_2D_DR_AXIS/SL_2D_FREQ_AXIS (2-D amplitude surface at peak channel).

Parameters
plot_dictJSON object to store spectral-line plot data.

◆ EnableOptimizeClosure()

void hops::MHO_ComputePlotData::EnableOptimizeClosure ( )
inline

Sets optimize closure to true in underlying MHO_FringeRotation (fRot) object.

◆ Initialize()

void hops::MHO_ComputePlotData::Initialize ( )

Initializes member variables by retrieving values from parameter and container stores.

◆ precompute_chan_metadata()

void hops::MHO_ComputePlotData::precompute_chan_metadata ( )

Pre-computes per-channel metadata (freq, sideband sign, bandwidth) into flat arrays, eliminating repeated string-keyed label lookups inside the calc_* functions.

◆ precompute_vr_tables()

void hops::MHO_ComputePlotData::precompute_vr_tables ( )

Pre-computes vrot lookup tables indexed as [ch * fNAP + ap]. Three tables are built to match the fRot state used by each calc_* function: fVRTable - default SBD params + fMBDelay (calc_sbd, calc_dr) fVRMBD0Table - default SBD params + MBD=0 (calc_mbd) fVRPhaseTable - proper SBD params + fMBDelay (calc_phase, calc_xpower_spec, calc_segs, correct_vis)

◆ SetContainerStore()

void hops::MHO_ComputePlotData::SetContainerStore ( MHO_ContainerStore cStore)
inline

Setter for container store.

Parameters
cStorePointer to MHO_ContainerStore object

◆ SetMBDAnchor()

void hops::MHO_ComputePlotData::SetMBDAnchor ( std::string  flag)
inline

Setter for mbd anchor (either: 'sbd' or 'model')

Parameters
flagFlag indicating the MBD anchor type

◆ SetOperatorToolbox()

void hops::MHO_ComputePlotData::SetOperatorToolbox ( MHO_OperatorToolbox toolbox)
inline

Setter for operator toolbox.

Parameters
toolboxPointer to MHO_OperatorToolbox object

◆ SetParameterStore()

void hops::MHO_ComputePlotData::SetParameterStore ( MHO_ParameterStore pStore)
inline

Setter for parameter store.

Parameters
pStorePointer to MHO_ParameterStore object

◆ SetVexInfo()

void hops::MHO_ComputePlotData::SetVexInfo ( const mho_json vex_info)
inline

Setter for vex info.

Parameters
vex_infoConst reference to mho_json object containing VEX information (from root file)

◆ smooth_dr_spectrum_tcohere()

void hops::MHO_ComputePlotData::smooth_dr_spectrum_tcohere ( std::size_t  drsp_size,
double  ap_delta 
)

Applies the t_cohere box-car smoothing to fDRAmpWorkspace in-place, replicating the make_plotdata.c behavior (wrapping, odd window). No-op when t_cohere is not set or <= 0.

Parameters
drsp_sizeNumber of points in the delay-rate spectrum
ap_deltaAccumulation period (s), i.e. time-axis bin width

Member Data Documentation

◆ fAmp

double hops::MHO_ComputePlotData::fAmp

◆ fChanBandwidth

std::vector< double > hops::MHO_ComputePlotData::fChanBandwidth

◆ fChanFreq

std::vector< double > hops::MHO_ComputePlotData::fChanFreq

◆ fChanSideband

std::vector< int > hops::MHO_ComputePlotData::fChanSideband

◆ fContainerStore

MHO_ContainerStore* hops::MHO_ComputePlotData::fContainerStore

◆ fCyclicRotator

MHO_CyclicRotator< xpower_type > hops::MHO_ComputePlotData::fCyclicRotator

◆ fDelayRate

double hops::MHO_ComputePlotData::fDelayRate

◆ fDRAmpWorkspace

xpower_amp_type hops::MHO_ComputePlotData::fDRAmpWorkspace

◆ fDRWorkspace

xpower_type hops::MHO_ComputePlotData::fDRWorkspace

◆ fFFTEngine

MHO_MultidimensionalFastFourierTransform< xpower_type > hops::MHO_ComputePlotData::fFFTEngine

◆ fFringe

xpower_type hops::MHO_ComputePlotData::fFringe

◆ fFringeRate

double hops::MHO_ComputePlotData::fFringeRate

◆ fImagUnit

std::complex< double > hops::MHO_ComputePlotData::fImagUnit

◆ fMBDAmpWorkspace

xpower_amp_type hops::MHO_ComputePlotData::fMBDAmpWorkspace

◆ fMBDAnchor

std::string hops::MHO_ComputePlotData::fMBDAnchor

◆ fMBDelay

double hops::MHO_ComputePlotData::fMBDelay

◆ fMBDWorkspace

xpower_type hops::MHO_ComputePlotData::fMBDWorkspace

◆ fNAP

std::size_t hops::MHO_ComputePlotData::fNAP

◆ fNChan

std::size_t hops::MHO_ComputePlotData::fNChan

◆ fNLSBAP

std::vector< int > hops::MHO_ComputePlotData::fNLSBAP

◆ fNUSBAP

std::vector< int > hops::MHO_ComputePlotData::fNUSBAP

◆ fParamStore

MHO_ParameterStore* hops::MHO_ComputePlotData::fParamStore

◆ fRefFreq

double hops::MHO_ComputePlotData::fRefFreq

◆ fRot

MHO_FringeRotation hops::MHO_ComputePlotData::fRot

◆ fSBDArray

visibility_type* hops::MHO_ComputePlotData::fSBDArray

◆ fSBDBox

std::vector< double > hops::MHO_ComputePlotData::fSBDBox

◆ fSBDelay

double hops::MHO_ComputePlotData::fSBDelay

◆ fSBDMaxBin

std::size_t hops::MHO_ComputePlotData::fSBDMaxBin

◆ fToolbox

MHO_OperatorToolbox* hops::MHO_ComputePlotData::fToolbox

◆ fTotalSummedWeights

double hops::MHO_ComputePlotData::fTotalSummedWeights

◆ fValid

bool hops::MHO_ComputePlotData::fValid

◆ fVexInfo

mho_json hops::MHO_ComputePlotData::fVexInfo

◆ fVisibilities

visibility_type* hops::MHO_ComputePlotData::fVisibilities

◆ fVRMBD0Table

std::vector< std::complex< double > > hops::MHO_ComputePlotData::fVRMBD0Table

◆ fVRPhaseTable

std::vector< std::complex< double > > hops::MHO_ComputePlotData::fVRPhaseTable

◆ fVRTable

std::vector< std::complex< double > > hops::MHO_ComputePlotData::fVRTable

◆ fWeights

weight_type* hops::MHO_ComputePlotData::fWeights

◆ seg_frac_lsb

std::vector< std::vector< double > > hops::MHO_ComputePlotData::seg_frac_lsb

◆ seg_frac_usb

std::vector< std::vector< double > > hops::MHO_ComputePlotData::seg_frac_usb

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