MHO_EstimatePCManual
Purpose
MHO_EstimatePCManual estimates manual phase calibration and delay offset
values from post-fringe-fit residuals for stations configured
in pc_mode = manual. It computes per-channel phase corrections
(pc_phases), per-channel delay offsets (delay_offs), and an overall
phase offset (pc_phase_offset) that can be used to refine the control file
for a subsequent fringe-fit pass. This is the HOPS4 port of the legacy fearfit
manual estimation code.
Control File Trigger
Keyword:
est_pc_manual(integer parameter, not an operator keyword)Category: manual phase calibration estimation (a descriptive label used only in this document; this operator is not registered under any real pipeline
operator_category, see below)
Bitmask |
Hex |
Action |
|---|---|---|
Estimate phases |
0x001 |
Per-channel phase correction. |
Median channel SBD |
0x002 |
Use median channel single-band delay. |
Average channel SBD |
0x004 |
Use average channel single-band delay. |
Total SBD |
0x008 |
Use total SBD channel delay. |
Measured SBD |
0x010 |
Use original measured SBD values. |
Outlier rejection |
0x020 |
Discard SBD outliers using median-based heuristics. |
Estimate phase offset |
0x040 |
Estimate overall phase offset. |
Phase bias (HOPS_EST_PC_BIAS) |
0x080 |
Apply phase bias from environment variable. |
Post-MDLY SBD adjustment |
0x100 |
Adjust SBD after multi-band delay. |
Estimate on reference station |
sign bit |
When set, also estimate on reference station. |
- There is no dedicated builder for this operator. It is instantiated directly and
driven by the
est_pc_manualparameter value.
Input Data
This operator is an inspecting operator on visibility_type. It additionally
requires:
weight_typefor per-channel, per-AP weights.phasor_typecontaining the fringe-fit residual phasors.MHO_ParameterStorefor control-file parameters and fringe-fit results.Plot data (for SBD box values read from
/PLOT_INFO).
Algorithm
MHO_EstimatePCManual has a trivial InitializeImpl (always returns true); all work occurs in ExecuteImpl.
Execution (``ExecuteImpl``):
Retrieve the
est_pc_manualmode integer from the parameter store and delegate toest_pc_manual(mode).Mode setup: Retrieve station IDs, polarization products, and per-station
pc_mode. The operator only proceeds if both reference and remote stations are inpc_mode = "manual". Decode the mode bitmask to determine which sub-tasks to run: phase estimation (dophs = mode & 0x001), delay estimation (dodly = mode & 0x13e), phase offset (dooff = mode & 0x040), and phase bias (domrp = mode & 0x080). The sign bit determines whether to estimate on the reference station.
Phase Estimation (``est_phases``):
Compute the weighted average phasor per channel:
phi_avg = (1 / sum(w)) * sum(w_j * Phi_j), wherePhi_jis the phasor for APj.Extract the residual phase:
theta_resid = arg(phi_avg).For each channel (sorted by increasing frequency):
Retrieve the net sideband label to determine the sideband multiplier (
sbmult = -1for LSB,+1for USB).Retrieve existing manual phase calibrations for both reference and remote stations:
est_phase = ref_pc - rem_pc.Compute the delay correction from fringe residuals:
delta_delay = resid_mbdwhenmbd_anchor = "model";resid_mbd - resid_sbdwhenmbd_anchor = "sbd";0otherwise.Combine:
est_phase = est_phase + sbmult * theta_resid * (180/pi) + 360 * delta_delay * (f_chan - f_ref).Optionally apply phase bias from
HOPS_EST_PC_BIASenvironment variable.Canonicalize to principal branch
[-180, 180]degrees and adjust relative to the input phase for the target station.
Log the resulting control-file lines with station ID, polarization, channel labels, and estimated phases.
Delay Estimation (``est_delays``):
Read SBD box values from the plot data (
/PLOT_INFO/SbdBox).Convert SBD values from lag units to nanoseconds:
sbd[ch] = (sbd[ch] - N_lags - 1) * sbd_sep * 1000.Negate for the remote station.
Call
adj_delayswhich applies one of five methods based on thehowbitmask:0x02: Use the median channel SBD value.0x04: Use the average channel SBD value.0x08: Use the total SBD value.0x10: Use the measured per-channel SBD values.0x20: Replace outliers (deviation > 3 sigma from median) with the median before computing the average.
Subtract the delta delay and negate for the remote station. Add the existing manual delay offsets and log the control-file lines.
Phase Offset Estimation (``est_offset``):
Retrieve the fringe-fit residual phase from the parameter store.
Retrieve the existing
pcphase_offsetfor the target station (or use 0 if absent).Compute the offset:
ofs = resphase - pcphase_offsetfor the reference station, orofs = -resphase + pcphase_offsetfor the remote station.Log the control-file line.
Effect on Data
This operator does not modify the visibility or weight containers.
It inspects the phasors, weights, and fringe-fit residuals to compute estimated
phase calibration and delay offset values, which are logged as informational
control-file lines. The caller can use these values to update
the pc_phases, delay_offs, and pc_phase_offset parameters for a
subsequent fringe-fit pass.