experiment_result
ExperimentResult ¶
ExperimentResult(
thetas, phis, polarizations, frequency, parent=None
)
Bases: QObject
Results from an experiment.
This class contains the data from running an experiment. It can be appended to, have calibrations applied to it, and provides methods to get particular subsets of the data like particular cuts or data from a particular frequency.
Attributes:
-
dataAppended
(
PySide6.QtCore.Signal
) –PyQt signal emitted when a data append operation has completed
Parameters:
-
thetas
(
np.ndarray
) –Array of theta locations (in degrees)
-
phis
(
np.ndarray
) –Array of phi locations (in degrees)
-
polarizations
(
list[str]
) –List of (name, a, b), where a, b are port numbers representing which S parameters correspond to the polarization.
-
frequency
(
skrf.frequency.Frequency
) –The frequency range of this measurement
calibrated_data
property
¶
calibrated_data: skrf.NetworkSet
The subset of this result that has been calibrated
has_calibrated_data
property
¶
has_calibrated_data: bool
Whether or not this result contains calibrated data
raw_data
property
¶
raw_data: skrf.NetworkSet
The subset of this result that has not been calibrated
append ¶
append(ntwk, calibration=None)
Append a data point to the result.
This command locks the internal QReadWriteLock, which really only matters when running in a QApplication.
Parameters:
-
ntwk
(
skrf.network.Network
) –The data to append
-
calibration
(
Calibration | None
) –If a calibration is passed, the raw data and the data after applying the calibration will be appended to the result
apply_calibration ¶
apply_calibration(calibration)
Applies a calibration to this result.
This method applies the calibration to this result and appends the calibrated data. In other words, after this method, the result will contain both raw and calibrated data.
Parameters:
-
calibration
(
Calibration
) –The calibration to apply to this result
Raises:
-
ValueError
–Raised if the calibration does not contain data for any of the polarizations in this result
get_3d_data ¶
get_3d_data(polarization, frequency, calibrated=False)
get_over_freq_vals ¶
get_over_freq_vals(
polarization, theta, phi, calibrated=False
)
Get a subset of data for all frequencies at the specified theta and phi.
Parameters:
-
polarization
(
str
) –The name of the polarization you want data for
-
theta
(
float
) –The theta value you want a phi cut for
-
phi
(
float
) –The phi value you want a theta cut for
-
calibrated
(
bool
) –Pass True to request calibrated data
Returns:
get_phi_cut ¶
get_phi_cut(
polarization, frequency, theta, calibrated=False
)
Get a subset of data for all phis and a specific theta.
Parameters:
-
polarization
(
str
) –The name of the polarization you want data for
-
frequency
(
float
) –What frequency you want data for
-
theta
(
float
) –The theta value you want a phi cut for
-
calibrated
(
bool
) –Pass True to request calibrated data
Returns:
get_theta_cut ¶
get_theta_cut(
polarization, frequency, phi, calibrated=False
)
Get a subset of data for all thetas and a specific phi.
Parameters:
-
polarization
(
str
) –The name of the polarization you want data for
-
frequency
(
float
) –What frequency you want data for
-
phi
(
float
) –The phi value you want a theta cut for
-
calibrated
(
bool
) –Pass True to request calibrated data
Returns:
get_unique_param_vals ¶
get_unique_param_vals(param)
Get a list of unique values for the specified parameter.
This is mostly useful internally, but as an example, consider a result with 4 data points (skrf.Network) with the following params:
[
{
'theta': 0,
'phi': 0,
'polarization': 'Vertical',
'calibrated': False,
},
{
'theta': 0,
'phi': 0,
'polarization': 'Horizontal',
'calibrated': False,
},
{
'theta': 0,
'phi': 5,
'polarization': 'Vertical',
'calibrated': False,
},
{
'theta': 0,
'phi': 5,
'polarization': 'Horizontal',
'calibrated': False,
},
]
calling get_unique_param_vals('phi')
would return [0, 5]
Parameters:
-
param
(
str
) –The parameter of interest.
Returns:
load
classmethod
¶
load(path)
Load an experiment result from a file.
This loads an .mdif file and attempts to construct an ExperimentResult from it.
Parameters:
Returns:
-
ExperimentResult(
ExperimentResult
) –The loaded data
Raises:
-
InvalidFileError
–When the file is not a valid PyChamber results file