microcalorimetry.math.rfpower¶
Analysis functions used in RF power and calorimetery.
Functions¶
|
Correct an effective efficiency measurment for DC biases. |
|
Calculate the compressionr ratio at power. |
|
Calculate the openloop thermoelectric power from fit coefficients. |
Fits power, voltage, and temperature to a temperature sensitive model. |
|
|
Apply a temperature dependent fit. |
|
Calculate the sensitivity of thermopile element using DC power. |
|
Calculate uncorrected effective efficiency for any sensor. |
|
Calculate uncorrected effective efficiency for a DC substitution type sensor. |
|
Calculate effective efficiency. |
|
Calculate the 'alpha' term, proportional to the power incident on sensor x. |
|
Calculate dc substituted power. |
|
Build a row in the correction factor regressor matrix. |
|
Calculate calorimetric correction factor. |
Module Contents¶
- microcalorimetry.math.rfpower.dcbias_eta_correction(eta: microcalorimetry.arrays.Eta, R_lead: float, R_bolo: float)[source]¶
Correct an effective efficiency measurment for DC biases.
From CPEM 2010 paper.
- Parameters:
eta (xr.DataArray) – Effective efficiency measurement.
R_lead (float) – Lead resistance of the Force and Sense leads of the sensor added together.
R_bolo (float) – Resistance of the bolometer, typically 200 Ohms for thermistor sensors.
- microcalorimetry.math.rfpower.compression_ratio(power: xarray.DataArray, power_minus_1dB: xarray.DataArray) xarray.DataArray[source]¶
Calculate the compressionr ratio at power.
- Parameters:
power (xr.DataArray) – Power (in Watts) measured by sensor.
power_minus_1dB (xr.DataArray) – Power (in Watts) measured by sensor at source setting minus 1 dB.
- Returns:
ratio – Compression ratio.
- Return type:
xr.DataArray
- microcalorimetry.math.rfpower.openloop_thermoelectric_power(coeffs: microcalorimetry.arrays.KDCTemInd | microcalorimetry.arrays.KDCTempDep, e: xarray.DataArray, p_of_e: bool, temperature: xarray.DataArray | None = None) xarray.DataArray[source]¶
Calculate the openloop thermoelectric power from fit coefficients.
This function can accept models that provide power as a polynomial function of voltage (or vice versa) or can be provided a temperature sensitive model of the thermoelectric if temperature readings are also provided.
- Parameters:
coeffs (xr.DataArray) –
Quadratic fit coefficients. Fit coefficients are along last dimension called “deg”, coordinates are integer values corresponding to the polynomail power (i.e. deg = 2 corresponds to c_2 for y = c_2*x**^2 ). Fit coefficients can be power in terms of voltage (W/V^n) or voltage in terms of power (V/W^n).
Alternativley, can take in temperature sensitive fit coefficients and a temperature reading.
thermoelectric_voltage (xr.DataArray) – Array of thermoelectric voltages to evaluate power at.
p_of_e (bool) – If true, assumes fit is power in terms of the thermolectric voltage, by default True.
temperature (xr.DataArray | None, optional) – If provided, assumed to be a temperature dependent thermoelectric model. Otherwise assumed to a straight forward polynomial.
- Returns:
Evaluated thermoelectric power.
- Return type:
xr.DataArray
- microcalorimetry.math.rfpower.temperature_corrected_thermoelectric_fit(P: xarray.DataArray, T: xarray.DataArray, V: xarray.DataArray) microcalorimetry.arrays.KDCTempDep[source]¶
Fits power, voltage, and temperature to a temperature sensitive model.
Power is in Watts and voltage is is Volts. Temperature can be any units provided it is proprtional to temperture and the same unit is units when using the fit later on.
It is typically resistance for a resistance thermometer
- Parameters:
P (xr.DataArray) – Power (Watts).
T (xr.DataArray) – Temperatue
V (xr.DataArray) – Volts (v).
- Returns:
Array of fit coefficients with names othe coefficients along a dimension called ‘col’.
- Return type:
- microcalorimetry.math.rfpower.apply_temperature_dependent_fit(e: xarray.DataArray, temperature: xarray.DataArray, coeffs: microcalorimetry.arrays.KDCTempDep) xarray.DataArray[source]¶
Apply a temperature dependent fit.
Shapes are assumed to be
- Parameters:
e (xr.DataArray) – Thermopile voltage shape (…,N)
temperature (xr.DataArray) – Temperature readings shape (…,N).
coeffs (xr.DataArray) – Fit coefficients shape (…,10). Last dimension is called ‘col’ and contains the fit coefficients.
- Returns:
Array of 1/k sensitivities corresponding to the the voltage and temperature readings provided. Power is metered as e/k, so multiple the voltages by the output of this function.
- Return type:
xr.DataArray
- microcalorimetry.math.rfpower.thermopile_sensitivity(e: xarray.DataArray, k: xarray.DataArray, deg: int = 2, kunc: numpy.array = None) xarray.DataArray[source]¶
Calculate the sensitivity of thermopile element using DC power.
v, i, and e are typically estimates of the steady state values of a step response. Function performs a polynomial of requested degree. v, i, and e are assumed to be of shape (…, n) where all coordinates and dimensions are the same. The fitting is done across the n dimensions, and repeated across (…).
- Parameters:
e (xr.DataArray) – DC voltage applied to a sensor.
k (xr.DataArray) – (e-e_0)/p of the sensor.
constrain_zero (bool, optional) – Constrain the offset to cross zero.
p_of_e (bool, optional) – If true, fits power in terms of thermopile voltage, if false fits thermopile voltage in terms of power.
deg (int, optional) – Degree of polynomial fit. The default is 2.
kunc (np.array, optional) – Uncertainty on power values. The default is None. If provided, used as weights for the ordinary least squares fitting.
- Returns:
sense – Resulting coefficients of the fit.
- Return type:
xr.DataArray
- microcalorimetry.math.rfpower.zeta_general(*, e_on: microcalorimetry.arrays.RFSweep, e_off: microcalorimetry.arrays.RFSweep, e_0: microcalorimetry.arrays.RFSweep, cal_k: microcalorimetry.arrays.KDCTemInd | microcalorimetry.arrays.KDCTempDep, p_of_e: bool, P2: microcalorimetry.arrays.RFSweep, P_dc_on_slow: microcalorimetry.arrays.RFSweep | float = 0, P_dc_off_slow: microcalorimetry.arrays.RFSweep | float = 0) microcalorimetry.arrays.RFSweep[source]¶
Calculate uncorrected effective efficiency for any sensor.
Requires knowledge of calorimeter’s sensitivity, This formulation is sensor agnostic.
- Parameters:
e_on (arrays.RFSweep) – Thermopile voltage in the RF on state (of calorimeter).
e_off (arrays.RFSweep) – Thermopile voltage in the RF off state (of calorimeter).
e_0 (arrays.RFSweep) – Time varying offset of the microcalorimeter’s thermopile in the at the time of measurment. Typically inffered by interpolation.
cal_k (arrays.RFSweep) – Thermopile sensitivity coefficients of the calorimeter. Last dimension called ‘deg’ with integer coordinates corresponding to the polynomial order.
p_of_e (bool) – True means cal_k fits power in terms of thermopile voltage. False means cal_k fits thermopile voltage in terms of power. V/W or W/V.
P2 (arrays.RFSweep) – Metered power of the sensor in the calorimeter
P_dc_on_slow (arrays.RFSweep) – DC power in the RF on state evalutated on the long term at the point P2 was taken.
P_dc_off_slow (arrays.RFSweep) – DC power in the RF off state evaluated on the long term at the time P2 was taken (usually via interpolation).
- Returns:
Uncorrected effective efficiency.
- Return type:
- microcalorimetry.math.rfpower.zeta_dcsub(e_on: microcalorimetry.arrays.RFSweep, e_off: microcalorimetry.arrays.RFSweep, V_on: microcalorimetry.arrays.RFSweep, V_off: microcalorimetry.arrays.RFSweep, V_off_slow: microcalorimetry.arrays.RFSweep, I_on: microcalorimetry.arrays.RFSweep = None, I_off: microcalorimetry.arrays.RFSweep = None, I_off_slow: microcalorimetry.arrays.RFSweep = None) microcalorimetry.arrays.RFSweep[source]¶
Calculate uncorrected effective efficiency for a DC substitution type sensor.
All in inputs are assumed to be data arrays of the same shape, and share common coordinates.
- Parameters:
e_on (arrays.RFSweep) – Thermopile voltage in the RF on state.
e_off (arrays.RFSweep) – Thermopile voltage in the RF off state.
V_on (arrays.RFSweep) – DC voltage in the RF on state.
V_off (arrays.RFSweep) – DC voltage in the RF off state.
V_off_slow (arrays.RFSweep) – DC voltage in the RF off state. (estimated from equilibrium)
I_on (arrays.RFSweep | None, optional) – DC current in the RF on state if power was measured with an SMU. If not provided only the voltage measurement will be used.
I_off (arrays.RFSweep | None, optional) – DC current in the RF off state if power was measured with an SMU. If not provided only the voltage measurement will be used. The default is None.
I_off_slow (arrays.RFSweep | None, optional) – DC current in the RF off state if power was measured with an SMU (in equilibrium). If not provided only the voltage measurement will be used. The default is None.
- Returns:
Uncorrected effective efficiency.
- Return type:
- microcalorimetry.math.rfpower.effective_efficiency(uncorrected_eta: microcalorimetry.arrays.RFSweep, gamma_s: microcalorimetry.arrays.S11, gc: microcalorimetry.arrays.GC) microcalorimetry.arrays.Eta[source]¶
Calculate effective efficiency.
Currently only supports a 1 term model.
- Parameters:
uncorrected_eta (xr.DataArray) – Uncorrected effective efficiency of a calorimetric measurement.
gamma_s (xr.DataArray) – Reflection coefficient of the standard in s1p_c format.
gc (xr.DataArray) – Correction factor, either 1 term or 4 term model.
- Raises:
Exception – If not a 1 term correction factor, until support added..
- Returns:
Effective efficiency.
- Return type:
- microcalorimetry.math.rfpower.p_comp(dcsub_s: microcalorimetry.arrays.RFSweep, dcsub_3x: microcalorimetry.arrays.RFSweep, dcsub_3s: microcalorimetry.arrays.RFSweep, gamma_s: microcalorimetry.arrays.RFSweep, gamma_x: microcalorimetry.arrays.RFSweep, gamma_g: microcalorimetry.arrays.RFSweep) microcalorimetry.arrays.DCSweep[source]¶
Calculate the ‘alpha’ term, proportional to the power incident on sensor x.
Used in the correction factor algorithm.
- Parameters:
dcsub_s (arrays.RFSweep) – DC substituted power measured by the normal standard in the calorimeter.
dcsub_3x (arrays.RFSweep) – DC subtituted power measured by the side arm with sesnsor x in the calorimeter.
dcsub_3s (arrays.RFSweep) – DC substituted power measured by the sid-arm with the normal standard in the calorimeter.
gamma_s (arrays.RFSweep) – Reflection coefficient of standard s in s1p_c format.
gamma_x (arrays.RFSweep) – Reflection coefficient of sensor x in s1p_c format.
gamma_g (arrays.RFSweep) – Port-2-port mismatch of the spliter being used.
- Returns:
alpha_xs.
- Return type:
- microcalorimetry.math.rfpower.dc_substituted_power(V_on: microcalorimetry.arrays.RFSweep, V_off: microcalorimetry.arrays.RFSweep, R: microcalorimetry.arrays.RFSweep = None, I_on: microcalorimetry.arrays.RFSweep = None, I_off: microcalorimetry.arrays.RFSweep = None) microcalorimetry.arrays.RFSweep[source]¶
Calculate dc substituted power.
R OR (I_on and I_off) must be provided to calculate the dc substituted power.
- Parameters:
V_on (arrays.RFSweep) – DC voltage in the RF on state.
V_off (arrays.RFSweep) – DC voltage in the RF off state.
R (arrays.RFSweep, optional) – Set-point resistance of the standard. The default is None.
I_on (arrays.RFSweep, optional) – DC current in the RF on state. The default is None.
I_off (arrays.RFSweep, optional) – DC current in the RF off state. The default is None.
- Raises:
Exception – If neither R nor Current measurements are provided, or if both are.
- Returns:
dc substituted power.
- Return type:
- microcalorimetry.math.rfpower.gc_device_row(p_comp_x: microcalorimetry.arrays.RFSweep, p_cal_x: microcalorimetry.arrays.RFSweep, zeta_s: microcalorimetry.arrays.RFSweep, gamma_s: microcalorimetry.arrays.RFSweep, gamma_x: microcalorimetry.arrays.RFSweep, k_s: microcalorimetry.arrays.RFSweep, k_x: microcalorimetry.arrays.RFSweep, n_correction_terms: int = 1) tuple[xarray.DataArray, xarray.DataArray][source]¶
Build a row in the correction factor regressor matrix.
Returns (….,r,c) shaped data
- Parameters:
alpha_xs (arrays.RFSweep) – alpha_xs term in the correction factor model for standard x.
delta_x (arrays.RFSweep) – power delta term in the correctionf factor model for sensor x.
zeta_s (arrays.RFSweep) – uncorrected effective efficiency of standard s.
gamma_s (arrays.RFSweep) – reflection coefficient of standard s in the s1p_c format.
gamma_x (arrays.RFSweep) – reflection coefficient of standard x in the s1p_c format.
k_s (arrays.RFSweep) – Sensitivity of the microcalorimeter while standard s is inside.
k_x (arrays.RFSweep) – Sensitivity of the microcalorimeter while standard x is inside.
n_correction_terms (int, optional) – Number of correction terms being calculated. The default is 1.
- Returns:
xr.DataArray – Row in the correction factor regressor matrix with shape (…,1, n_correction_terms)
xr.DataArray – Solution to the equation for the resulting row with shape (…, 1, n_correction_terms)
- microcalorimetry.math.rfpower.gc_correction_factor(regressor: xarray.DataArray, solution: xarray.DataArray, n_correction_terms: int = 1) xarray.DataArray[source]¶
Calculate calorimetric correction factor.
- Parameters:
regressor (xr.DataArray) – Rows in the correction factor regressor matrix.
solution (xr.DataArray) – Solutions to the regressor matrix
n_correction_term (int,optional) – Number of correction factor terms to calculate.
- Returns:
Correction factor model.
- Return type:
xr.DataArray