qetpy.plotting package¶
-
qetpy.plotting._plotting.
plot_psd
(noise, lgcoverlay=True, lgcsave=False, savepath=None)¶ Function to plot the noise spectrum referenced to the TES line in units of Amperes/sqrt(Hz).
Parameters: - noise : Object
Noise object to be plotted
- lgcoverlay : boolean, optional
If True, psd’s for all channels are overlayed in a single plot, If False, each psd for each channel is plotted in a seperate subplot
- lgcsave : boolean, optional
If True, the figure is saved in the user provided directory
- savepath : str, optional
Absolute path for the figure to be saved
-
qetpy.plotting._plotting.
plot_reim_psd
(noise, lgcsave=False, savepath=None)¶ Function to plot the real vs imaginary noise spectrum referenced to the TES line in units of Amperes/sqrt(Hz). This is done to check for thermal muon tails making it passed the quality cuts
Parameters: - noise : Object
Noise object to be plotted
- lgcsave : boolean, optional
If True, the figure is saved in the user provided directory
- savepath : str, optional
Absolute path for the figure to be saved
-
qetpy.plotting._plotting.
plot_corrcoeff
(noise, lgcsmooth=True, nwindow=7, lgcsave=False, savepath=None)¶ Function to plot the cross channel correlation coefficients. Since there are typically few traces, the correlations are often noisy. a savgol_filter is used to smooth out some of the noise
Parameters: - noise : Object
noise object to be plotted
- lgcsmooth : boolean, optional
If True, a savgol_filter will be used when plotting.
- nwindow : int, optional
the number of bins used for the window in the savgol_filter
- lgcsave : boolean, optional
If True, the figure is saved in the user provided directory
- savepath : str, optional
Absolute path for the figure to be saved
-
qetpy.plotting._plotting.
plot_csd
(noise, whichcsd=['01'], lgcreal=True, lgcsave=False, savepath=None)¶ Function to plot the cross channel noise spectrum referenced to the TES line in units of Amperes^2/Hz
Parameters: - noise : Object
Noise object to be plotted
- whichcsd : list, optional
a list of strings, where each element of the list refers to the pair of indices of the desired csd plot
- lgcreal : boolean, optional
If True, the Re(csd) is plotted. If False, the Im(csd) is plotted
- lgcsave : boolean, optional
If True, the figure is saved in the user provided directory
- savepath : str, optional
Absolute path for the figure to be saved
Function to plot the de-correlated noise spectrum referenced to the TES line in units of Amperes/sqrt(Hz) from fitted parameters calculated calculate_deCorrelated_noise
Parameters: - noise : Object
Noise object to be plotted
- lgcoverlay : boolean, optional
If True, de-correlated for all channels are overlayed in a single plot, If False, the noise for each channel is plotted in a seperate subplot
- lgcdata : boolean, optional
Only applies when lgcoverlay = False. If True, the csd data is plotted
- lgcuncorrnoise : boolean, optional
Only applies when lgcoverlay = False. If True, the de-correlated noise is plotted
- lgccorrelated : boolean, optional
Only applies when lgcoverlay = False. If True, the correlated component of the fitted noise is plotted
- lgcsum : boolean, optional
Only applies when lgcoverlay = False. If True, the sum of the fitted de-correlated noise and and correlated noise is plotted
- lgcsave : boolean, optional
If True, the figure is saved in the user provided directory
- savepath : str, optional
Absolute path for the figure to be saved
-
qetpy.plotting._plotting.
compare_noise
(arr, channels, lgcdecorrelatednoise=False, lgcsave=False, savepath=None)¶ Function to plot multiple psd’s from different noise objects on the same figure. Each channel will be plotted in its own figure.
Parameters: - arr : array_like
Array of noise objects
- channels : list
List of strings, each string is a channel to plot. ex [‘PSA1’,’PAS2’]
- lgcdecorrelatednoise : boolean, optional
If False, the psd is for each channel is plotted. If True, the calculated de-correlated noise is plotted
- lgcsave : boolean , optional
If True, the figure is saved in the user provided directory
- savepath : str, optional
Absolute path for the figure to be saved
-
qetpy.plotting._plotting.
plot_noise_sim
(f, psd, noise_sim, istype, figsize=(12, 8), lgcsave=False, savepath='')¶ Plots psd with simulated noise model
Parameters: - f : array_like
Frequency bins for psd
- psd : array_like
Power spectral density
- istype : str
Must be ‘current’ or ‘power’ If ‘current’ the noise is plotted referenced to TES current If ‘power’ the noise is plotted referenced to TES power
- figsize : tuple, optional
Desired size of figure
- lgcsave : boolean, optional
If True, plot is saved
- savepath : str, optional
Directory to save trace
Returns: - fig : Object
fig object from matplotlib.pyplot
- ax : Object
ax object from matplotlib.pyplot
-
qetpy.plotting._plotting.
plot_full_trace
(didv, poles='all', plotpriors=True, lgcsave=False, savepath='', savename='')¶ Function to plot the entire trace in time domain
Parameters: - didv : class
The DIDV class object that the data is stored in
- poles : int, string, array_like, optional
The pole fits that we want to plot. If set to “all”, then plots all of the fits. Can also be set to just one of the fits. Can be set as an array of different fits, e.g. [1, 2]
- plotpriors : boolean, optional
Boolean value on whether or not the priors fit should be plotted.
- lgcsave : boolean, optional
Boolean value on whether or not the figure should be saved
- savepath : string, optional
Where the figure should be saved. Saved in the current directory by default.
- savename : string, optional
A string to append to the end of the file name if saving. Empty string by default.
-
qetpy.plotting._plotting.
plot_single_period_of_trace
(didv, poles='all', plotpriors=True, lgcsave=False, savepath='', savename='')¶ Function to plot a single period of the trace in time domain
Parameters: - didv : class
The DIDV class object that the data is stored in
- poles : int, string, array_like, optional
The pole fits that we want to plot. If set to “all”, then plots all of the fits. Can also be set to just one of the fits. Can be set as an array of different fits, e.g. [1, 2]
- plotpriors : boolean, optional
Boolean value on whether or not the priors fit should be plotted.
- lgcsave : boolean, optional
Boolean value on whether or not the figure should be saved
- savepath : string, optional
Where the figure should be saved. Saved in the current directory by default.
- savename : string, optional
A string to append to the end of the file name if saving. Empty string by default.
-
qetpy.plotting._plotting.
plot_zoomed_in_trace
(didv, poles='all', zoomfactor=0.1, plotpriors=True, lgcsave=False, savepath='', savename='')¶ Function to plot a zoomed in portion of the trace in time domain. This plot zooms in on the overshoot of the didv.
Parameters: - didv : class
The DIDV class object that the data is stored in
- poles : int, string, array_like, optional
The pole fits that we want to plot. If set to “all”, then plots all of the fits. Can also be set to just one of the fits. Can be set as an array of different fits, e.g. [1, 2]
- zoomfactor : float, optional, optional
Number between zero and 1 to show different amounts of the zoomed in trace.
- plotpriors : boolean, optional
Boolean value on whether or not the priors fit should be plotted.
- lgcsave : boolean, optional
Boolean value on whether or not the figure should be saved
- savepath : string, optional
Where the figure should be saved. Saved in the current directory by default.
- savename : string, optional
A string to append to the end of the file name if saving. Empty string by default.
-
qetpy.plotting._plotting.
plot_didv_flipped
(didv, poles='all', plotpriors=True, lgcsave=False, savepath='', savename='')¶ Function to plot the flipped trace in time domain. This function should be used to test if there are nonlinearities in the didv
Parameters: - didv : class
The DIDV class object that the data is stored in
- poles : int, string, array_like, optional
The pole fits that we want to plot. If set to “all”, then plots all of the fits. Can also be set to just one of the fits. Can be set as an array of different fits, e.g. [1, 2]
- plotpriors : boolean, optional
Boolean value on whether or not the priors fit should be plotted.
- lgcsave : boolean, optional
Boolean value on whether or not the figure should be saved
- savepath : string, optional
Where the figure should be saved. Saved in the current directory by default.
- savename : string, optional
A string to append to the end of the file name if saving. Empty string by default.
-
qetpy.plotting._plotting.
plot_re_im_didv
(didv, poles='all', plotpriors=True, lgcsave=False, savepath='', savename='')¶ Function to plot the real and imaginary parts of the didv in frequency space. Currently creates two different plots.
Parameters: - didv : class
The DIDV class object that the data is stored in
- poles : int, string, array_like, optional
The pole fits that we want to plot. If set to “all”, then plots all of the fits. Can also be set to just one of the fits. Can be set as an array of different fits, e.g. [1, 2]
- plotpriors : boolean, optional
Boolean value on whether or not the priors fit should be plotted.
- lgcsave : boolean, optional
Boolean value on whether or not the figure should be saved
- savepath : string, optional
Where the figure should be saved. Saved in the current directory by default.
- savename : string, optional
A string to append to the end of the file name if saving. Empty string by default.
-
qetpy.plotting._plotting.
plot_iv
(IVobject, temps='all', chans='all', showfit=True, lgcsave=False, savepath='', savename='')¶ Function to plot the IV curves for the data in an IV object.
Parameters: - IVobject : class
The IV class object that the data is stored in.
- temps : string, array_like, int, optional
Which bath temperatures to plot. Setting to “all” plots all of them. Can also set to a subset of bath temperatures, or just one
- chans : string, array_like, int, optional
Which bath temperatures to plot. Setting to “all” plots all of them. Can also set to a subset of bath temperatures, or just one
- showfit : boolean, optional
Boolean flag to also plot the linear fit to the normal data
- lgcsave : boolean, optional
Boolean flag to save the plot
- savepath : string, optional
Path to save the plot to, saves it to the current directory by default
- savename : string, optional
Name to append to the plot file name, if saving
-
qetpy.plotting._plotting.
plot_rv
(IVobject, temps='all', chans='all', lgcsave=False, savepath='', savename='')¶ Function to plot the resistance curves for the data in an IV object.
Parameters: - IVobject : class
The IV class object that the data is stored in.
- temps : string, array_like, int, optional
Which bath temperatures to plot. Setting to “all” plots all of them. Can also set to a subset of bath temperatures, or just one
- chans : string, array_like, int, optional
Which bath temperatures to plot. Setting to “all” plots all of them. Can also set to a subset of bath temperatures, or just one
- lgcsave : boolean, optional
Boolean flag to save the plot
- savepath : string, optional
Path to save the plot to, saves it to the current directory by default
- savename : string, optional
Name to append to the plot file name, if saving
-
qetpy.plotting._plotting.
plot_pv
(IVobject, temps='all', chans='all', lgcsave=False, savepath='', savename='')¶ Function to plot the power curves for the data in an IV object.
Parameters: - IVobject : class
The IV class object that the data is stored in.
- temps : string, array_like, int, optional
Which bath temperatures to plot. Setting to “all” plots all of them. Can also set to a subset of bath temperatures, or just one
- chans : string, array_like, int, optional
Which bath temperatures to plot. Setting to “all” plots all of them. Can also set to a subset of bath temperatures, or just one
- lgcsave : boolean, optional
Boolean flag to save the plot
- savepath : string, optional
Path to save the plot to, saves it to the current directory by default
- savename : string, optional
Name to append to the plot file name, if saving
-
qetpy.plotting._plotting.
plot_all_curves
(IVobject, temps='all', chans='all', showfit=True, lgcsave=False, savepath='', savename='')¶ Function to plot the IV, resistance, and power curves for the data in an IV object.
Parameters: - IVobject : class
The IV class object that the data is stored in.
- temps : string, array_like, int, optional
Which bath temperatures to plot. Setting to “all” plots all of them. Can also set to a subset of bath temperatures, or just one
- chans : string, array_like, int, optional
Which bath temperatures to plot. Setting to “all” plots all of them. Can also set to a subset of bath temperatures, or just one
- showfit : boolean, optional
Boolean flag to also plot the linear fit to the normal data
- lgcsave : boolean, optional
Boolean flag to save the plot
- savepath : string, optional
Path to save the plot to, saves it to the current directory by default
- savename : string, optional
Name to append to the plot file name, if saving
-
qetpy.plotting._plotting.
plotnonlin
(OFnonlinOBJ, pulse, params, errors)¶ Diagnostic plotting of non-linear pulse fitting
Parameters: - OFnonlinOBJ: OFnonlin object
The OFnonlin fit object to be plotted
- pulse: ndarray
The raw trace to be fit
- params: tuple
Tuple containing best fit paramters