microcalorimetry.math.rfpower ============================= .. py:module:: microcalorimetry.math.rfpower .. autoapi-nested-parse:: Analysis functions used in RF power and calorimetery. .. !! processed by numpydoc !! Functions --------- .. autoapisummary:: microcalorimetry.math.rfpower.dcbias_eta_correction microcalorimetry.math.rfpower.openloop_thermoelectric_power microcalorimetry.math.rfpower.thermopile_sensitivity microcalorimetry.math.rfpower.zeta_general microcalorimetry.math.rfpower.zeta_dcsub microcalorimetry.math.rfpower.effective_efficiency microcalorimetry.math.rfpower.calorimetric_power_delta_general microcalorimetry.math.rfpower.calorimetric_power_delta_dcsub microcalorimetry.math.rfpower.calorimetric_alpha_xs microcalorimetry.math.rfpower.dc_substituted_power microcalorimetry.math.rfpower.gc_device_row microcalorimetry.math.rfpower.gc_correction_factor Module Contents --------------- .. py:function:: dcbias_eta_correction(eta: xarray.DataArray, R_lead: float, R_bolo: float) 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. .. !! processed by numpydoc !! .. py:function:: openloop_thermoelectric_power(coeffs: xarray.DataArray, e: xarray.DataArray, p_of_e: bool) -> xarray.DataArray Calculate the openloop thermoelectric power from fit coefficients. :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). A **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. :Returns: xr.DataArray Evaluated thermoelectric power. .. !! processed by numpydoc !! .. py:function:: thermopile_sensitivity(p: xarray.DataArray, e: xarray.DataArray, constrain_zero: bool = False, p_of_e: bool = True, deg: int = 2, punc: numpy.array = None, eunc: numpy.array = None) -> xarray.DataArray 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 assuemd 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: **v** : xr.DataArray DC voltage applied to a sensor. **i** : xr.DataArray DC current applied to a sensor. **e** : xr.DataArray DC voltage measured across the thermopile. **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. **punc: np.array, optional** Uncertainty on power values. The default is None. If provided, used as weights for the ordinary least squares fitting. **eunc: np.array, optional** Uncertainty on power values. The default is None. If provided, used as weights for the ordinary least squares fitting. :Returns: **sense** : xr.DataArray Resulting coefficients of the fit. .. !! processed by numpydoc !! .. py:function:: zeta_general(e_on: xarray.DataArray, e_off: xarray.DataArray, cal_k: xarray.DataArray, p_of_e: bool, P2: xarray.DataArray, P_dc_on_slow: xarray.DataArray = 0, P_dc_off_slow: xarray.DataArray = 0) -> xarray.DataArray Calculate uncorrected effective efficiency for any sensor. Requires knowledge of calorimeter's sensitivity, but doesn't assume linearity as it can be corrected for using higher order fit coefficients. This formulation is sensor agnostic. :Parameters: **e_on** : xr.DataArray Thermopile voltage in the RF on state (of calorimeter). **e_off** : xr.DataArray Thermopile voltage in the RF off state (of calorimeter). **cal_k** : xr.DataArray 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** : xr.DataArray Metered power of the sensor in the calorimeter **P_dc_on_slow** : xr.DataArray DC power in the RF on state evalutated on the long term at the point P2 was taken. **P_dc_off_slow** : xr.DataArray DC power in the RF off state evaluated on the long term at the time P2 was taken (usually via interpolation). :Returns: xr.DataArray Uncorrected effective efficiency. .. !! processed by numpydoc !! .. py:function:: zeta_dcsub(e_on: xarray.DataArray, e_off: xarray.DataArray, V_on: xarray.DataArray, V_off: xarray.DataArray, V_off_slow: xarray.DataArray, I_on: xarray.DataArray = None, I_off: xarray.DataArray = None, I_off_slow: xarray.DataArray = None) -> xarray.DataArray 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** : xr.DataArray Thermopile voltage in the RF on state. **e_off** : xr.DataArray Thermopile voltage in the RF off state. **V_on** : xr.DataArray DC voltage in the RF on state. **V_off** : xr.DataArray DC voltage in the RF off state. **V_off_slow** : xr.DataArray DC voltage in the RF off state. (estimated from equilibrium) **I_on** : xr.DataArray, 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** : xr.DataArray, 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** : xr.DataArray, 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** .. **-------** .. **xr.DataArray** Uncorrected effective efficiency. .. !! processed by numpydoc !! .. py:function:: effective_efficiency(uncorrected_eta: xarray.DataArray, gamma_s: xarray.DataArray, gc: xarray.DataArray) -> xarray.DataArray 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. :Returns: xr.DataArray Effective efficiency. :Raises: Exception If not a 1 term correction factor, until support added.. .. !! processed by numpydoc !! .. py:function:: calorimetric_power_delta_general(e_on: xarray.DataArray, e_off: xarray.DataArray, cal_k: xarray.DataArray, p_of_e: bool, P_dc_on_slow: xarray.DataArray = 0, P_dc_off_slow: xarray.DataArray = 0) -> xarray.DataArray Calculate power delta. Requires knowledge of calorimeter's sensitivity, but doesn't assume linearity as it can be corrected for using higher order fit coefficients. This formulation is sensor agnostic. :Parameters: **e_on** : xr.DataArray Thermopile voltage in the RF on state (of calorimeter). **e_off** : xr.DataArray Thermopile voltage in the RF off state (of calorimeter). **cal_k** : xr.DataArray 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. **P_dc_on_slow** : xr.DataArray DC power in the RF on state evalutated on the long term at the point P2 was taken. **P_dc_off_slow** : xr.DataArray DC power in the RF off state evaluated on the long term at the time P2 was taken (usually via interpolation). :Returns: xr.DataArray Uncorrected effective efficiency. .. !! processed by numpydoc !! .. py:function:: calorimetric_power_delta_dcsub(e_on: xarray.DataArray, e_off: xarray.DataArray, k: xarray.DataArray, p_of_e: bool, dc_sub: xarray.DataArray = 0) Calculate Delta_x for a calorimeter run. Delta_x is the difference in power measured by the calorimeters thermopile element and the power metered by the sensor. It is a term used in calcualting the correction factor of the calorimeter. k is assumed to be formatted from the thermopile_sensitivity method. If DC current is provided, then the DC power is calculated using V*I, if a set point resistance is provided then DC power is calculated using V**2/R. One of ether the setpoint OR the DC current must be provided. :Parameters: **e_on** : xr.DataArray Thermopile voltage in the RF on state. **e_off** : xr.DataArray Thermopile voltage in the RF off state. **k** : xr.DataArray Sensitivity cofficients that describe the power at the sensitivity of the thermopile element. Assumed to be in the mck data format. **p_of_e** : bool Whether or not he coefficients (k) are power in terms of e (True) or e in terms of power (False). **dc_sub** : xr.DataArray DC substituted power. :Returns: **delta** : xr.DataArray Power delta. .. !! processed by numpydoc !! .. py:function:: calorimetric_alpha_xs(dcsub_s: xarray.DataArray, dcsub_3x: xarray.DataArray, dcsub_3s: xarray.DataArray, gamma_s: xarray.DataArray, gamma_x: xarray.DataArray, gamma_g: xarray.DataArray) -> xarray.DataArray Calculate the 'alpha' term, proportional to the power incident on sensor x. Used in the correction factor algorithm. :Parameters: **dcsub_s** : xr.DataArray DC substituted power measured by the normal standard in the calorimeter. **dcsub_3x** : xr.DataArray DC subtituted power measured by the side arm with sesnsor x in the calorimeter. **dcsub_3s** : xr.DataArray DC substituted power measured by the sid-arm with the normal standard in the calorimeter. **gamma_s** : xr.DataArray Reflection coefficient of standard s in s1p_c format. **gamma_x** : xr.DataArray Reflection coefficient of sensor x in s1p_c format. **gamma_g** : xr.DataArray Port-2-port mismatch of the spliter being used. :Returns: xr.DataArray alpha_xs. .. !! processed by numpydoc !! .. py:function:: dc_substituted_power(V_on: xarray.DataArray, V_off: xarray.DataArray, R: xarray.DataArray = None, I_on: xarray.DataArray = None, I_off: xarray.DataArray = None) -> xarray.DataArray Calculate dc substituted power. R OR (I_on and I_off) must be provided to calculate the dc substituted power. :Parameters: **V_on** : xr.DataArray DC voltage in the RF on state. **V_off** : xr.DataArray DC voltage in the RF off state. **R** : xr.DataArray, optional Set-point resistance of the standard. The default is None. **I_on** : xr.DataArray, optional DC current in the RF on state. The default is None. **I_off** : xr.DataArray, optional DC current in the RF off state. The default is None. :Returns: xr.DataArray dc substituted power. :Raises: Exception If neither R nor Current measurements are provided, or if both are. .. !! processed by numpydoc !! .. py:function:: gc_device_row(alpha_xs: xarray.DataArray, delta_x: xarray.DataArray, zeta_s: xarray.DataArray, gamma_s: xarray.DataArray, gamma_x: xarray.DataArray, n_correction_terms: int = 1) -> xarray.DataArray Build a row in the correction factor regressor matrix. Returns (....,r,c) shaped data :Parameters: **alpha_xs** : xr.DataArray alpha_xs term in the correction factor model for standard x. **delta_x** : xr.DataArray power delta term in the correctionf factor model for sensor x. **zeta_s** : xr.DataArray uncorrected effective efficiency of standard s. **gamma_s** : xr.DataArray reflection coefficient of standard s in the s1p_c format. **gamma_x** : xr.DataArray reflection coefficient of standard x in the s1p_c format. **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) .. !! processed by numpydoc !! .. py:function:: gc_correction_factor(regressor: xarray.DataArray, solution: xarray.DataArray, n_correction_terms: int = 1) -> xarray.DataArray 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: xr.DataArray Correction factor model. .. !! processed by numpydoc !!