Calibration Solution Product
This module contains classes for handling data products.
- class CalibrationSolutionDataInterfaceV10(logger: Logger | None = None, corrcoeff: List[float] | None = None, residual_max: List[float] | None = None, residual_std: List[float] | None = None, xy_phase: float | None = None, n_masked_initial: int | None = None, n_masked_final: int | None = None, lst: float | None = None, galactic_centre_elevation: float | None = None, sun_elevation: float | None = None, sun_adjustment_factor: float | None = None, masked_antennas: ndarray | None = None, solution: ndarray | None = None, frequency_channel: int | None = None, station_id: int | None = None, acquisition_time: float | None = None)[source]
Calibration Solution structure 1.0.
root
acquisition_time
corrcoeff
frequency_channel
galactic_centre_elevation
lst
masked_antennas
n_masked_final
n_masked_initial
residual_max
residual_std
solution
station_id
sun_adjustment_factor
sun_elevation
xy_phase
- __init__(logger: Logger | None = None, corrcoeff: List[float] | None = None, residual_max: List[float] | None = None, residual_std: List[float] | None = None, xy_phase: float | None = None, n_masked_initial: int | None = None, n_masked_final: int | None = None, lst: float | None = None, galactic_centre_elevation: float | None = None, sun_elevation: float | None = None, sun_adjustment_factor: float | None = None, masked_antennas: ndarray | None = None, solution: ndarray | None = None, frequency_channel: int | None = None, station_id: int | None = None, acquisition_time: float | None = None) None[source]
Initialise a new calibration product.
- Parameters:
logger – An optional logger.
corrcoeff – Stores the correlation coefficients as a list of floats (List[float]). List of Pearson product-moment correlation coefficients for each polarization of the calibrated visibilities and the model.
residual_max – Stores the maximum residuals as a list of floats (List[float]). List of residual visibility maximum absolute deviation.
residual_std – Stores the standard deviation of the residuals as a list of floats (List[float]). List of residual visibility standard deviation per polarization (K).
xy_phase – Stores the XY phase information as a float (float). Estimated XY-phase error (degrees).
n_masked_initial – Stores the initial number of masked data points as an integer (int). Initial number of masked antennas.
n_masked_final – Stores the final number of masked data points as an integer (int). Final number of masked antennas.
lst – Stores the Local Sidereal Time (LST) as a floating-point number (float). Apparent sidereal time at the station (degrees).
galactic_centre_elevation – Stores the elevation of the galactic center in degrees as a floating-point number (float). Elevation of the galactic center (degrees).
sun_elevation – Stores the elevation angle of the Sun as a floating-point number (float). Elevation of the sun (degrees).
sun_adjustment_factor – Stores the sun adjustment factor as a floating-point number (float). Solar adjustment factor (if adjust_solar_model=True, “1” otherwise).
masked_antennas – Stores a list of integers (np.ndarray[np.int_]) representing the IDs of antennas that were masked (excluded) from the solution. List of antennas that have been flagged as bad and should be excluded. This list is indexed by eep, and has length up to nof_antenna.
solution – Stores the calibration solution as a list of floats (List[float]), typically with a length of 2048 or another predefined size. Each unit is a flattened complex matrix of length 8. The solution stored is ordered by eep_idx (1 based)
frequency_channel – Stores the frequency channel used for the calibration as an integer (int). This represents the specific frequency channel this solution is calculated for.
station_id – Stores the station ID as an integer (int). This represents the unique identifier for the station performing the calibration.
acquisition_time – Stores the acquisition time as a float (float) or string. This represents the timestamp at which the data was acquired.
- class CalibrationSolutionDataInterfaceV11(logger: Logger | None = None, corrcoeff: List[float] | None = None, residual_max: List[float] | None = None, residual_std: List[float] | None = None, xy_phase: float | None = None, n_masked_initial: int | None = None, n_masked_final: int | None = None, lst: float | None = None, galactic_centre_elevation: float | None = None, sun_elevation: float | None = None, sun_adjustment_factor: float | None = None, masked_antennas: ndarray | None = None, solution: ndarray | None = None, frequency_channel: int | None = None, station_id: int | None = None, acquisition_time: float | None = None, fitted_gains: ndarray | None = None, cov_matrices: ndarray | None = None, costs: ndarray | None = None)[source]
Calibration Solution structure 1.1.
root
acquisition_time
corrcoeff
frequency_channel
galactic_centre_elevation
lst
masked_antennas
n_masked_final
n_masked_initial
residual_max
residual_std
solution
station_id
sun_adjustment_factor
sun_elevation
xy_phase
fitted_gains
cov_matrices
costs
- __init__(logger: Logger | None = None, corrcoeff: List[float] | None = None, residual_max: List[float] | None = None, residual_std: List[float] | None = None, xy_phase: float | None = None, n_masked_initial: int | None = None, n_masked_final: int | None = None, lst: float | None = None, galactic_centre_elevation: float | None = None, sun_elevation: float | None = None, sun_adjustment_factor: float | None = None, masked_antennas: ndarray | None = None, solution: ndarray | None = None, frequency_channel: int | None = None, station_id: int | None = None, acquisition_time: float | None = None, fitted_gains: ndarray | None = None, cov_matrices: ndarray | None = None, costs: ndarray | None = None) None[source]
Initialise a new calibration product.
- Parameters:
logger – An optional logger.
corrcoeff – Stores the correlation coefficients as a list of floats (List[float]). List of Pearson product-moment correlation coefficients for each polarization of the calibrated visibilities and the model.
residual_max – Stores the maximum residuals as a list of floats (List[float]). List of residual visibility maximum absolute deviation.
residual_std – Stores the standard deviation of the residuals as a list of floats (List[float]). List of residual visibility standard deviation per polarization (K).
xy_phase – Stores the XY phase information as a float (float). Estimated XY-phase error (degrees).
n_masked_initial – Stores the initial number of masked data points as an integer (int). Initial number of masked antennas.
n_masked_final – Stores the final number of masked data points as an integer (int). Final number of masked antennas.
lst – Stores the Local Sidereal Time (LST) as a floating-point number (float). Apparent sidereal time at the station (degrees).
galactic_centre_elevation – Stores the elevation of the galactic center in degrees as a floating-point number (float). Elevation of the galactic center (degrees).
sun_elevation – Stores the elevation angle of the Sun as a floating-point number (float). Elevation of the sun (degrees).
sun_adjustment_factor – Stores the sun adjustment factor as a floating-point number (float). Solar adjustment factor (if adjust_solar_model=True, “1” otherwise).
masked_antennas – Stores a list of integers (np.ndarray[np.int_]) representing the IDs of antennas that were masked (excluded) from the solution. List of antennas that have been flagged as bad and should be excluded. This list is indexed by eep, and has length up to nof_antenna.
solution – Stores the calibration solution as a list of floats (List[float]), typically with a length of 2048 or another predefined size. Each unit is a flattened complex matrix of length 8. The solution stored is ordered by eep_idx (1 based)
frequency_channel – Stores the frequency channel used for the calibration as an integer (int). This represents the specific frequency channel this solution is calculated for.
station_id – Stores the station ID as an integer (int). This represents the unique identifier for the station performing the calibration.
acquisition_time – Stores the acquisition time as a float (float) or string. This represents the timestamp at which the data was acquired.
fitted_gains – Stores the fitted gains as a list of floats (List[float]), This represents the linear phase fit of the gains There will be 256*2 phases per channel
cov_matrices – Stores the covariance matrices as a list of floats (List[float]), This represents the covariance matrices There will be 256*2 per channel, each is a 2x2 matrix
costs – Stores the costs as a list of floats (List[float]), The final cost value for the fit, divided by the number of points fitted There will be 256*2 costs per channel
- class CalibrationSolutionDataInterfaceV12(logger: Logger | None = None, corrcoeff: List[float] | None = None, residual_max: List[float] | None = None, residual_std: List[float] | None = None, xy_phase: float | None = None, n_masked_initial: int | None = None, n_masked_final: int | None = None, lst: float | None = None, galactic_centre_elevation: float | None = None, sun_elevation: float | None = None, sun_adjustment_factor: float | None = None, masked_antennas: ndarray | None = None, solution: ndarray | None = None, frequency_channel: int | None = None, station_id: int | None = None, acquisition_time: float | None = None, fitted_gains: ndarray | None = None, cov_matrices: ndarray | None = None, costs: ndarray | None = None, calibration_id: str | None = None)[source]
Calibration Solution structure 1.2.
root
acquisition_time
corrcoeff
frequency_channel
galactic_centre_elevation
lst
masked_antennas
n_masked_final
n_masked_initial
residual_max
residual_std
solution
station_id
sun_adjustment_factor
sun_elevation
xy_phase
fitted_gains
cov_matrices
costs
calibration_id
- __init__(logger: Logger | None = None, corrcoeff: List[float] | None = None, residual_max: List[float] | None = None, residual_std: List[float] | None = None, xy_phase: float | None = None, n_masked_initial: int | None = None, n_masked_final: int | None = None, lst: float | None = None, galactic_centre_elevation: float | None = None, sun_elevation: float | None = None, sun_adjustment_factor: float | None = None, masked_antennas: ndarray | None = None, solution: ndarray | None = None, frequency_channel: int | None = None, station_id: int | None = None, acquisition_time: float | None = None, fitted_gains: ndarray | None = None, cov_matrices: ndarray | None = None, costs: ndarray | None = None, calibration_id: str | None = None) None[source]
Initialise a new calibration product.
- Parameters:
logger – An optional logger.
corrcoeff – Stores the correlation coefficients as a list of floats (List[float]). List of Pearson product-moment correlation coefficients for each polarization of the calibrated visibilities and the model.
residual_max – Stores the maximum residuals as a list of floats (List[float]). List of residual visibility maximum absolute deviation.
residual_std – Stores the standard deviation of the residuals as a list of floats (List[float]). List of residual visibility standard deviation per polarization (K).
xy_phase – Stores the XY phase information as a float (float). Estimated XY-phase error (degrees).
n_masked_initial – Stores the initial number of masked data points as an integer (int). Initial number of masked antennas.
n_masked_final – Stores the final number of masked data points as an integer (int). Final number of masked antennas.
lst – Stores the Local Sidereal Time (LST) as a floating-point number (float). Apparent sidereal time at the station (degrees).
galactic_centre_elevation – Stores the elevation of the galactic center in degrees as a floating-point number (float). Elevation of the galactic center (degrees).
sun_elevation – Stores the elevation angle of the Sun as a floating-point number (float). Elevation of the sun (degrees).
sun_adjustment_factor – Stores the sun adjustment factor as a floating-point number (float). Solar adjustment factor (if adjust_solar_model=True, “1” otherwise).
masked_antennas – Stores a list of integers (np.ndarray[np.int_]) representing the IDs of antennas that were masked (excluded) from the solution. List of antennas that have been flagged as bad and should be excluded. This list is indexed by eep, and has length up to nof_antenna.
solution – Stores the calibration solution as a list of floats (List[float]), typically with a length of 2048 or another predefined size. Each unit is a flattened complex matrix of length 8. The solution stored is ordered by eep_idx (1 based)
frequency_channel – Stores the frequency channel used for the calibration as an integer (int). This represents the specific frequency channel this solution is calculated for.
station_id – Stores the station ID as an integer (int). This represents the unique identifier for the station performing the calibration.
acquisition_time – Stores the acquisition time as a float (float) or string. This represents the timestamp at which the data was acquired.
fitted_gains – Stores the fitted gains as a list of floats (List[float]), This represents the linear phase fit of the gains There will be 256*2 phases per channel
cov_matrices – Stores the covariance matrices as a list of floats (List[float]), This represents the covariance matrices There will be 256*2 per channel, each is a 2x2 matrix
costs – Stores the costs as a list of floats (List[float]), The final cost value for the fit, divided by the number of points fitted There will be 256*2 costs per channel
calibration_id – Stores the calibration_id. This represents the unique identifier for the calibration
- class CalibrationSolutionProduct(structure_version: str = '1.2', logger: Logger | None = None, **kwargs: Any)[source]
This class is used to manage the data from the Solve command.
Currently this supports:
structure_version = “1.0”
CalibrationSolutionDataInterfaceV10
structure_version = “1.1”
CalibrationSolutionDataInterfaceV11
structure_version = “1.2”
CalibrationSolutionDataInterfaceV12
This class uses composition. The flag structure_version will be used to construct a versioned interface to the data product. e.g:
1.0 -> CalibrationSolutionDataInterfaceV10
1.1 -> CalibrationSolutionDataInterfaceV11
1.2 -> CalibrationSolutionDataInterfaceV12
- __init__(structure_version: str = '1.2', logger: Logger | None = None, **kwargs: Any)[source]
Initialise a new instance.
- Parameters:
logger – An optional logger.
structure_version – Stores the version associated with the structure used to parse and save.
kwargs – Any kwargs.
- load_from_hdf5(filename: str) None[source]
Load a solution from hdf5 file.
- Parameters:
filename – the name of the file to read.
- save_to_hdf5(filename: str, attempt_if_exists: bool = False) None[source]
Save the Solution to a hdf5 file.
- Parameters:
filename – the name of the file to write.
attempt_if_exists – True if you want to attempt a write if the file exists. (If True you we will still obey the file permissions this is extra protection just in case.)