e15190.runlog.gallery.ElogQueryGallery¶
- class e15190.runlog.gallery.ElogQueryGallery¶
Functions
__init__()Query for the Elog database.
append_nw_attenuation_lengths(AB, fig[, ...])append_nw_gain_ratios(AB, fig[, bars, ...])append_nw_pos_calib_params(AB, fig[, bars, ...])append_trigger_rate(fig)determine_run_batches([...])Determine the run batches.
get_figure_reaction_overview([...])Updates and returns the run batches summary.
load_run_batches([filepath])Load the run batches from a CSV file.
save_html_to_fishtank(key[, chmod])Save figure as HTML file to be hosted via Fishtank server.
save_run_batches([filepath])Save the run batches to a CSV file.
Properties
DATABASE_DIR- __init__()¶
Query for the Elog database.
- Parameters
load_run_batches (bool, default True) – Invoke
load_run_batches()upon initialization.update_run_batches (bool, default False) – Invoke
determine_run_batches(), thenget_run_batches_summary()upon initialization. IfTrue,load_run_batcheswill be ignored, and the run batches will be re-determined.save_run_batches (bool, default False) – Invoke
save_run_batches()upon initialization. This is useful when the run batches are re-determined and we want the new run batches to be saved into a CSV file.
- save_html_to_fishtank(key, chmod=509)¶
Save figure as HTML file to be hosted via Fishtank server.
- Parameters
key (str) – “overview” or “pos-calib”.
chmod (octal, default 0o775) – The unix permission needed to make it accessible from the web. Fishtank specifically requires it to be 0o775, which is the default value.
- determine_run_batches(batch_unified_properties=None, max_run_gap=None, additional_runs=None)¶
Determine the run batches.
A run batch or simply batch is a group of runs that share the same properties like beam energy and target, so that merging the events across runs within the same batch makes physical sense. Run batches are useful when analyzing quantities (e.g. PSD parameters) that require statistics from multiple runs.
This function tries to determine the run batches by comparing the properties of the runs. Additional batches can also be specified by the argument
additional_runs. At the end,self.dfwill be updated to use a 2-level index, namely,ibatchandirun. Theibatchindex is the enumeration of run batches; theirunindex is a consecutive enumeration of all runs across all batches. Both indices start from 0.While we might expect physical properties of the runs within one single batch to be comparable, there is no guarantee for that. As an example, consider a batch consists of run 12, 13, 14, 15. All the runs have the same reaction systems, Ca40 + Ni58 at 140 MeV/u, without shadow bars. However, there is no guarantee that, say, the position calibration parameters are similar for all four runs. Some hardware differences or DAQ settings might cause one of the runs to be very different from the rest. Further analysis is required to study those differences across runs.
- Parameters
batch_unified_properties (list of str, default None) – A list of properties that are unified across all runs in a single batch. This means that whenever one of these properties changes, a breakpoint will be set to separate the runs into different batches. Any column in
self.dfcan be used. IfNone, the function usesbatch_unified_properties.max_run_gap (np.timedelta64, default None) – Maximum allowed gap between runs in a single batch. If
None, the function usesmax_run_gap.additional_runs (list of int, default None) – A list of run numbers that will be used to create additional batches. The runs should specify the first run of a batch.
- get_run_batches_summary()¶
Updates and returns the run batches summary.
This function updates the dataframe
df_batches, which contains the following columns:ibatch(int): the enumeration of run batches (starting from 0)run_min(int): first run numberrun_max(int): last run numbern_runs(int): number of runsn_skipped_runs(int): number of runs that are skippedbegin_time(Timestamp): begin time of the first runend_time(Timestamp): end time of the last runtotal_elapse(Timedelta): total elapsed time of all the runstotal_gap_time(Timedelta): total gap time between all the runstarget(str): e.g. Ni58, Ni64, Sn112, Sn124.beam(str): e.g. Ca40, Ca48beam_energy(float): beam energy in MeV/ushadow_bar(str): shadow bar configuration, i.e. “in” or “out”trigger_rate_min(float): minimum trigger ratetrigger_rate_max(float): maximum trigger ratetrigger_rate_mean(float): mean trigger rate
- Returns
df_batches – A dataframe that lists the batch properties.
- Return type
pandas.DataFrame
- load_run_batches(filepath=None)¶
Load the run batches from a CSV file.
- Parameters
filepath (str or pathlib.Path, default None) – The path to the CSV file. If
None, the function usesrun_batches_path.
- save_run_batches(filepath=None)¶
Save the run batches to a CSV file.
- Parameters
filepath (str or pathlib.Path, default None) – The path to the CSV file. If
None, the function usesrun_batches_path.
- df¶
The Elog database pandas dataframe.
- batch_unified_properties¶
Properties that are unified across all runs in a single batch.
- max_run_gap¶
Maximum allowed gap between runs in a single batch.
- df_batches¶
A summary of batch properties rather than run properties.