HOPS
HOPS class reference
Classes | Public Member Functions | List of all members
hops::MHO_DiFXBaselineProcessor Class Reference

Class MHO_DiFXBaselineProcessor. More...

#include <MHO_DiFXBaselineProcessor.hh>

Public Member Functions

 MHO_DiFXBaselineProcessor ()
 
virtual ~MHO_DiFXBaselineProcessor ()
 
void AddRecord (MHO_DiFXVisibilityRecord *record)
 Adds a visibility record (chunk of difx data) to the processor if it matches baseline and selection criteria. More...
 
void Clear ()
 
void ConstructVisibilityFileObjects ()
 Constructs visibility file objects by organizing data and setting tags for visibilities and weights. More...
 
const std::vector< std::pair< int, mho_json > > & GetBaselineFreqs () const
 Read-only access to the ordered (ascending sky_freq) list of channels this baseline will export. Populated by Organize(). Each element is (difx_freq_idx, fInput["freq"][...]). More...
 
int GetBaselineID () const
 Getter for (difx) baseline id. More...
 
std::string GetBaselineShortName () const
 
std::string GetRefStationMk4Id () const
 Getter for reference station mk4id. More...
 
std::string GetRemStationMk4Id () const
 Getter for remote station mk4id. More...
 
visibility_store_typeGetVisibilities ()
 
bool IsAutoCorr () const
 Checks if reference station is equal to remote station. More...
 
void Organize ()
 Build the per-baseline derived state (fFreqIndexSet -> fBaselineFreqs, AP counts, scan times, source name, etc). Idempotent. Exposed publicly so MHO_DiFXScanProcessor can collect each baseline's sky_freq list before computing the scan-wide global grid that has to be injected back into both this processor and the channel-name constructor. More...
 
void SetAttachDiFXInputFalse ()
 Setter for attach difx input false (do not attach difx .input info to visibilities) More...
 
void SetAttachDiFXInputTrue ()
 Setter for attach difx .input true (attaches json object containing difx .input info to visibilities) More...
 
void SetCorrelationDate (std::string corrdate)
 Setter for correlation date. More...
 
void SetDiFXCodes2VexCodes (const std::map< std::string, std::string > &d2v_map)
 Setter for difx station codes to vex codes (2 char -> 2 char), but difx uses all caps. More...
 
void SetDiFXCodes2VexNames (const std::map< std::string, std::string > &d2v_map)
 Setter for difx codes to vex names (difx 2 char code to canonical station names (8 char)) More...
 
void SetDiFXInputData (const mho_json *input)
 Setter for difx .input data (needed for processing visibilities) More...
 
void SetExportAsMark4False ()
 
void SetExportAsMark4True ()
 
void SetFreqGroups (std::vector< std::string > fgroups)
 
void SetFrequencyBands (std::vector< std::tuple< std::string, double, double > > fbands)
 
void SetGlobalSkyFreqGrid (const std::vector< double > &grid_MHz, double tol=MHO_SkyFreqGrid::DEFAULT_TOL_MHZ)
 Provides a precomputed global sky-frequency grid (MHz, sorted ascending, deduplicated over freq) used to number channel ids for mark4 t101 chan_id strings. When set, the chidx embedded in ref_chan_id / rem_chan_id (and the mk4_channel_id label) is the position of the channel's sky_freq in this grid, instead of its dense position within this baseline's fBaselineFreqs. This keeps the mark4 chan_ids aligned with MHO_DiFXChannelNameConstructor's chan_def.channel_name across heterogeneous-bandwidth station combinations. More...
 
void SetOnlyBandwidth (double bw)
 
void SetRescaleFalse ()
 Setter for rescale false - Do NOT apply mk4 style visibility normalization. More...
 
void SetRescaleTrue ()
 Setter for rescale true - apply mk4 style visibility normalization. More...
 
void SetRootCode (std::string rcode)
 Setter for (hops) root code. More...
 
void SetScanIndex (std::size_t idx)
 Setter for scan index. More...
 
void SetStationCodes (MHO_StationCodeMap *code_map)
 Setter for station codes (2 characater -> 1 character) More...
 
void SetZoomFreqIndices (const std::set< int > &zoom_indices)
 
void WriteVisibilityObjects (std::string output_dir)
 Writes visibility objects in HOPS4 format to an output directory. More...
 

Detailed Description

Class MHO_DiFXBaselineProcessor.

accumulates visbility records from a single baseline, sorts and re-packs them into a visbility container

Author
J. Barrett - barre.nosp@m.ttj@.nosp@m.mit.e.nosp@m.du
Date
Tue Mar 1 16:44:37 2022 -0500

Constructor & Destructor Documentation

◆ MHO_DiFXBaselineProcessor()

hops::MHO_DiFXBaselineProcessor::MHO_DiFXBaselineProcessor ( )

◆ ~MHO_DiFXBaselineProcessor()

hops::MHO_DiFXBaselineProcessor::~MHO_DiFXBaselineProcessor ( )
virtual

Member Function Documentation

◆ AddRecord()

void hops::MHO_DiFXBaselineProcessor::AddRecord ( MHO_DiFXVisibilityRecord record)

Adds a visibility record (chunk of difx data) to the processor if it matches baseline and selection criteria.

Parameters
recordInput MHO_DiFXVisibilityRecord to be added

◆ Clear()

void hops::MHO_DiFXBaselineProcessor::Clear ( )

◆ ConstructVisibilityFileObjects()

void hops::MHO_DiFXBaselineProcessor::ConstructVisibilityFileObjects ( )

Constructs visibility file objects by organizing data and setting tags for visibilities and weights.

◆ GetBaselineFreqs()

const std::vector< std::pair< int, mho_json > >& hops::MHO_DiFXBaselineProcessor::GetBaselineFreqs ( ) const
inline

Read-only access to the ordered (ascending sky_freq) list of channels this baseline will export. Populated by Organize(). Each element is (difx_freq_idx, fInput["freq"][...]).

◆ GetBaselineID()

int hops::MHO_DiFXBaselineProcessor::GetBaselineID ( ) const
inline

Getter for (difx) baseline id.

Returns
The current baseline ID as an integer.

◆ GetBaselineShortName()

std::string hops::MHO_DiFXBaselineProcessor::GetBaselineShortName ( ) const
inline

◆ GetRefStationMk4Id()

std::string hops::MHO_DiFXBaselineProcessor::GetRefStationMk4Id ( ) const
inline

Getter for reference station mk4id.

Returns
Reference station Mk4 ID as a std::string.

◆ GetRemStationMk4Id()

std::string hops::MHO_DiFXBaselineProcessor::GetRemStationMk4Id ( ) const
inline

Getter for remote station mk4id.

Returns
The Mk4 ID of the remote station as a string.

◆ GetVisibilities()

visibility_store_type* hops::MHO_DiFXBaselineProcessor::GetVisibilities ( )
inline

◆ IsAutoCorr()

bool hops::MHO_DiFXBaselineProcessor::IsAutoCorr ( ) const
inline

Checks if reference station is equal to remote station.

Returns
True if stations are equal, false otherwise.

◆ Organize()

void hops::MHO_DiFXBaselineProcessor::Organize ( )

Build the per-baseline derived state (fFreqIndexSet -> fBaselineFreqs, AP counts, scan times, source name, etc). Idempotent. Exposed publicly so MHO_DiFXScanProcessor can collect each baseline's sky_freq list before computing the scan-wide global grid that has to be injected back into both this processor and the channel-name constructor.

◆ SetAttachDiFXInputFalse()

void hops::MHO_DiFXBaselineProcessor::SetAttachDiFXInputFalse ( )
inline

Setter for attach difx input false (do not attach difx .input info to visibilities)

◆ SetAttachDiFXInputTrue()

void hops::MHO_DiFXBaselineProcessor::SetAttachDiFXInputTrue ( )
inline

Setter for attach difx .input true (attaches json object containing difx .input info to visibilities)

◆ SetCorrelationDate()

void hops::MHO_DiFXBaselineProcessor::SetCorrelationDate ( std::string  corrdate)
inline

Setter for correlation date.

Parameters
corrdateNew correlation date as string

◆ SetDiFXCodes2VexCodes()

void hops::MHO_DiFXBaselineProcessor::SetDiFXCodes2VexCodes ( const std::map< std::string, std::string > &  d2v_map)
inline

Setter for difx station codes to vex codes (2 char -> 2 char), but difx uses all caps.

Parameters
d2v_mapInput map of DiFX to Vex station codes

◆ SetDiFXCodes2VexNames()

void hops::MHO_DiFXBaselineProcessor::SetDiFXCodes2VexNames ( const std::map< std::string, std::string > &  d2v_map)
inline

Setter for difx codes to vex names (difx 2 char code to canonical station names (8 char))

Parameters
d2v_mapInput map of DiFX codes to Vex names

◆ SetDiFXInputData()

void hops::MHO_DiFXBaselineProcessor::SetDiFXInputData ( const mho_json input)
inline

Setter for difx .input data (needed for processing visibilities)

Parameters
inputInput mho_json object containing DiFX data

◆ SetExportAsMark4False()

void hops::MHO_DiFXBaselineProcessor::SetExportAsMark4False ( )
inline

◆ SetExportAsMark4True()

void hops::MHO_DiFXBaselineProcessor::SetExportAsMark4True ( )
inline

◆ SetFreqGroups()

void hops::MHO_DiFXBaselineProcessor::SetFreqGroups ( std::vector< std::string >  fgroups)
inline

◆ SetFrequencyBands()

void hops::MHO_DiFXBaselineProcessor::SetFrequencyBands ( std::vector< std::tuple< std::string, double, double > >  fbands)
inline

◆ SetGlobalSkyFreqGrid()

void hops::MHO_DiFXBaselineProcessor::SetGlobalSkyFreqGrid ( const std::vector< double > &  grid_MHz,
double  tol = MHO_SkyFreqGrid::DEFAULT_TOL_MHZ 
)
inline

Provides a precomputed global sky-frequency grid (MHz, sorted ascending, deduplicated over freq) used to number channel ids for mark4 t101 chan_id strings. When set, the chidx embedded in ref_chan_id / rem_chan_id (and the mk4_channel_id label) is the position of the channel's sky_freq in this grid, instead of its dense position within this baseline's fBaselineFreqs. This keeps the mark4 chan_ids aligned with MHO_DiFXChannelNameConstructor's chan_def.channel_name across heterogeneous-bandwidth station combinations.

Parameters
grid_MHzSorted, deduped sky frequencies in MHz
tolMatch tolerance in MHz (default 0.001)

◆ SetOnlyBandwidth()

void hops::MHO_DiFXBaselineProcessor::SetOnlyBandwidth ( double  bw)
inline

◆ SetRescaleFalse()

void hops::MHO_DiFXBaselineProcessor::SetRescaleFalse ( )
inline

Setter for rescale false - Do NOT apply mk4 style visibility normalization.

◆ SetRescaleTrue()

void hops::MHO_DiFXBaselineProcessor::SetRescaleTrue ( )
inline

Setter for rescale true - apply mk4 style visibility normalization.

◆ SetRootCode()

void hops::MHO_DiFXBaselineProcessor::SetRootCode ( std::string  rcode)
inline

Setter for (hops) root code.

Parameters
rcodeNew root code as string

◆ SetScanIndex()

void hops::MHO_DiFXBaselineProcessor::SetScanIndex ( std::size_t  idx)
inline

Setter for scan index.

Parameters
idxIndex value of type std::size_t

◆ SetStationCodes()

void hops::MHO_DiFXBaselineProcessor::SetStationCodes ( MHO_StationCodeMap code_map)

Setter for station codes (2 characater -> 1 character)

Parameters
code_mapPointer to an MHO_StationCodeMap object containing station codes.

◆ SetZoomFreqIndices()

void hops::MHO_DiFXBaselineProcessor::SetZoomFreqIndices ( const std::set< int > &  zoom_indices)
inline

◆ WriteVisibilityObjects()

void hops::MHO_DiFXBaselineProcessor::WriteVisibilityObjects ( std::string  output_dir)

Writes visibility objects in HOPS4 format to an output directory.

Parameters
output_dirOutput directory path for writing files.

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