srsinst.rga.plots Package
srsinst.rga.plots.analogscanplot module
- class srsinst.rga.plots.analogscanplot.AnalogScanPlot(parent: Task, ax: Axes, scan: Scans, plot_name='', save_to_file=True)
Bases:
BaseScanPlot
Class to manage an analog scan plot with data generated from the parent task
- Parameters:
parent (Task) – It uses resources from the parent task
scan (Scans) – an instance of Scans class in an instance of RGA100 class
plot_name (str) – name of the plot used as title of the plot and name of the dict for scan data saving
save_to_file (bool) – to create a table in the data file
- reset()
- scan_data_available_callback(index)
- scan_finished_callback()
- cleanup()
callback functions should be disconnected when task is finished
- get_plot_info()
- round_float(number)
- save_scan_data(data_list)
- set_conversion_factor(factor=0.1, unit='fA')
- set_x_axis(x_axis)
srsinst.rga.plots.histogramscanplot module
- class srsinst.rga.plots.histogramscanplot.HistogramScanPlot(parent: Task, ax: Axes, scan: Scans, plot_name='', save_to_file=True)
Bases:
BaseScanPlot
Class to manage an histogram scan bar graph with data generated from the parent task
- Parameters:
parent (Task) – It uses resources from the parent task
scan (Scans) – an instance of Scans class in an instance of RGA100 class
plot_name (str) – name of the plot used as title of the plot and name of the dict for scan data saving
save_to_file (bool) – to create a table in the data file
- reset()
- update_callback(index)
- scan_started_callback()
- scan_finished_callback()
- cleanup()
callback functions should be disconnected when task is finished
- get_plot_info()
- round_float(number)
- save_scan_data(data_list)
- set_conversion_factor(factor=0.1, unit='fA')
- set_x_axis(x_axis)
srsinst.rga.plots.timeplot module
- class srsinst.rga.plots.timeplot.TimePlot(parent: Task, ax: Axes, plot_name='', data_names=('Y',), save_to_file=True, use_datetime=True, plot_options=None)
Bases:
object
Class to manage a plot for multiple time-series data generated in the parent task
- Parameters:
parent (Task) – It uses resources from the parent task
ax (Axes) – Matplotlib Axes on which it makes a plot
data_names (tuple or list) – list of names of time series data. It specifies the number of data sets, too.
save_to_file (bool) – Allow To create a table in the data file
use_datetime (bool) – To use datetime format for x axis, otherwise it uses the elapsed time in seconds
plot_options (list of dict) – each element of the list with the matching element in data_names will be passed to Matplotlib Axes.plot as **kwarg, if exists.
- on_xlim_changed(event_ax)
- on_pick(event)
Toggle a line from the line corresponding in the legend
https://matplotlib.org/stable/gallery/event_handling/legend_picking.html
- get_buffer_size()
- set_buffer_size(size=10000000)
- set_conversion_factor(factor=0.1, unit='fA')
- add_data(data_list=(0,), update_figure=False)
- save_data(timestamp, data_list)
- round_float(number)
- get_plot_info()
- update_plot()
- cleanup()
srsinst.rga.plots.basescanplot module
srsinst.rga.plots.analysis module
- srsinst.rga.plots.analysis.calculate_baseline(y, ratio=1e-06, lam=10000.0, niter=20, full_output=False)
Calculate baseline of a spectrum based on Asymmetrically reweighted penalized least square (ARPLS)
Original paper: https://pubs.rsc.org/en/content/articlelanding/2015/AN/C4AN01061B#!divAbstract
Python implementation: https://stackoverflow.com/questions/29156532/python-baseline-correction-library
- Parameters:
y (Numpy array) – Intensity array
ratio (float) – improvement ratio to reach before stopping iteration
lam (float) – fit parameter lambda
niter (int) – maximum iteration
full_output (bool, optional) – generate detailed output
- Returns:
Numpy array – baseline array, if full_output == False
tuple – (baseline array, baseline-subtracted intensity array, termination information in dict format), if full_output == True
- srsinst.rga.plots.analysis.get_peak_from_analog_scan(x, y, mass, fit=False)
Calculate the intensity of a peak in an analog scan spectrum
- Parameters:
x (Numpy array) – mass axis values
y (Numpy array) – intensity array
mass (float) – peak position within the range of x
fit (bool, optional) – The default is False, if False, return the maximum value around mass. If True , it fits the data around x with a parabola, and calculate the maximum of the parabola.
- Returns:
peak intensity
- Return type:
float