heating module
Functions for heating signal subtraction.
- heating.generate_heating_reference(data, delays, plot=False)[source]
Generate a reference curve for heating signal.
- Parameters:
data (dict) – A dictionary as obtained from
txs.datared.datared()
.delays (str or list of str) – Time delay(s) to be used to create the reference curve.
threshold (float) – Used to filter out data that are essentially noise. The integral is computed for each time delay and the data for which the integral is above the threshold are kept for averaging.
- Returns:
ref – A 1D array containing the reference curve for the heating signal.
- Return type:
array-like (1D)
- heating.generate_thermal_response_curves(data, delay_short, delay_long, cp, cv)[source]
Generate the two curves of the thermal response of the solvent.
The solvent heating signal is described using the following:
\[\Delta S(Q, t) = \frac{\partial S(Q, t)}{\partial T}\bigg\lvert_{\rho}\Delta T(t) + \frac{\partial S(Q, t)}{\partial \rho}\bigg\lvert_T\Delta \rho(t)\]where S(Q, t) is the measured signal, T is the temperature in the heated volume and \(\rho\) is the solvent density [1].
The provided curves corresponds to each term summed on the right-hand side. Typically, \(\frac{\partial S(Q, t)}{\partial T}\bigg\lvert_{\rho}\Delta T(t)\) is measured at short time scale (100 ps) before the density drop response to the temperature jump. The term \(\frac{\partial S(Q, t)}{\partial \rho}\bigg\lvert_T\Delta \rho(t)\) is obtained using the following (assuming 100 ps delay for the first term):
\[\frac{\partial S(Q, t)}{\partial \rho}\bigg\lvert_T\Delta \rho(t_{long}) = \Delta S(t_{long}) - \frac{C_V}{C_p} \Delta S(100 ps)\]- Parameters:
data (dict-like) – A dataset of the type returned by
txs.datared.datared()
corresponding to the heating signal at short time delaydelay_short (str) – The time delay for the heating signal during temperature jump (short one, typically 100 ps).
delay_long (str) – The time delay for the heating signal during density drop (long one, typically 1 \(\mu\) s).
cp (float) – The constant-pressure heat capacity of the solvent.
cv (float) – The constant-volume heat capacity of the solvent.
References
- heating.remove_heating(data, ref, qlim=(1.5, 2.2), verbose=True)[source]
Removes the water heating signal using a fit in the given q-range.
- Three cases are currently handled:
- only one time delay is present in ref, then the curve is scaled
and used for subtraction of all time delays in data.
- two time delays are present in ref, then a linear combination of
these two curves is used to fit the time delays in data and used for subtraction.
- the number of time delays in data and ref matches exactly, then
the time delays in ref are scaled to the corresponding curves in data and subtracted.
- Parameters:
data (dict) – A dictionary as obtained from
txs.datared.datared()
function.ref (dict) – A dictionary as obtained from
txs.datared.datared()
function.qlim (2-tuple, optional) – Defines the lower and upper limits of the momentum transfer q-region that is used to fit the reference on the data patterns. (default, (1.5, 2.2))
verbose (bool, optional) – If True, prints information about the scaling factors used. (default, True)
- Returns:
out – A deep copy of the data where heating signal has been subtracted.
- Return type:
dict