RdtMixin¶
-
class
cait.mixins.RdtMixin[source]¶ Bases:
objectMixin for the DataHandler, includes methods to process the RDT files
-
checkout_con(path_con, read_events=100, ints_in_header=7)[source]¶ Print the content of a *.con file.
- Parameters
path_con (string) – Path to the con file e.g. “data/bcks/”.
read_events (int) – The number of events to print from the file.
ints_in_header (int) – The number of ints in the header of the events in the RDF file. This should be either 7 or 6!
-
checkout_dig(path_dig, read_events=100)[source]¶ Print the content of a *.dig_stamps file.
- Parameters
path_dig (string) – Path to the dig file e.g. “data/bcks/*.dig_stamps”.
read_events (int) – Number of events to read from file, if -1 read all events.
-
checkout_mon(path_mon, read_events=5)[source]¶ Print the content of a *.mon file.
- Parameters
path_mon (string) – Path to the mon file e.g. “data/bcks/*.mon”.
read_events (int) – Number of events to read from file, if -1 read all events.
-
checkout_rdt(path_rdt, read_events=100, tpa_list=[0, 1, - 1], dvm_channels=0, verb=False, ints_in_header=7)[source]¶ Prints the channel numbers of a number of events in the rdt File, from the beginning
- Parameters
path_rdt (string) – Full path to the rdt file e.g. “data/bcks/bck_001.rdt”.
read_events (int) – Number of events to read from file, if -1 read all events.
tpa_list (list) – The tpas that are to read from the file, 0 -> events, -1 -> noise, 1 -> tp.
dvm_channels (int) – Number of dvm channels.
verb (bool) – If activated, all read parameters are printed.
ints_in_header (int) – The number of ints in the header of the events in the RDF file. This should be either 7 or 6!
-
checkout_test(path_test, read_events=100)[source]¶ Print the content of a *.test_stamps file.
- Parameters
path_test (string) – Full path to the test file e.g. “data/bcks/*.test_stamps”.
read_events (int) – Number of events to read from file, if -1 read all events.
-
convert_dataset(path_rdt, fname, path_h5, tpa_list=[0, 1, - 1], calc_mp=False, calc_fit=False, calc_sev=False, calc_nps=False, processes=4, event_dtype='float32', ints_in_header=7, lazy_loading=True, memsafe=True, dvm_channels=0, batch_size=1000, trace=False)[source]¶ Wrapper for the gen_dataset_from_rdt function, creates HDF5 dataset from Rdt file.
- Parameters
path_rdt (string) – Path to the rdt file e.g. “data/bcks/”.
fname (string) – Name of the file e.g. “bck_001”.
path_h5 (string) – Path where the h5 file is saved e.g. “data/hdf5s%”.
tpa_list (list) – The test pulse amplitudes to save, if 1 is in the list, all positive values are included.
calc_mp (bool) – If True the main parameters for all events are calculated and stored.
calc_fit (bool) – Not recommended! If True the parametric fit for all events is calculated and stored.
calc_sev (bool) – Not recommended! If True the standard event for all event channels is calculated.
calc_nps (bool) – If True the main parameters for all events are calculated and stored.
processes (int) – The number of processes that is used for the code execution.
event_dtype (string) – Datatype to save the events with.
ints_in_header (int) – The number of ints in the header of the events in the RDF file. This should be either 7 or 6!
lazy_loading (bool) – Recommended! If true, the data is loaded with memory mapping to avoid memory overflows.
dvm_channels (int) – The number of DVM channels, this can be read in the PAR file.
batch_size (int) – The batch size for loading the samples from disk.
memsafe (bool) – Recommended! This activates
trace (bool) – Trace the runtime and memory consumption
-
include_con_file(path_con_file, ints_in_header=7, clock_frequency=None)[source]¶ Read the content of a con file an add to HDF5.
These files contain the control pulse heights and time stamps.
- Parameters
clock_frequency (int) – The frequency of the clock that records the time stamps. This you either know or you can read it out from the rdt file, by using with the function read_clock_frequency.
path_con_file (string) – Path to the con file e.g. “data/bcks/*.con”.
ints_in_header (int) – The number of ints in the header of the events in the RDF file. This should be either 7 or 6!
-
include_mon(path_mon)[source]¶ Read the content of an mon file an add to HDF5.
These files contain the paramters of the cryostat with time stamps.
- Parameters
path_mon (string) – Path to the mon file e.g. “data/bcks/*.mon”.
-
include_rdt(path_data, fname, ints_in_header=7, tpa_list=[0, 1, - 1], event_dtype='float32', lazy_loading=True, origin=None, channels=None)[source]¶ Read the content of an rdt file an add to HDF5.
- Parameters
path_data (string) – Path to the rdt file e.g. “data/bcks/*.rdt”.
fname (string) – Name of the file e.g. “bck_001”.
ints_in_header (int) – The number of ints in the header of the events in the RDF file. This should be either 7 or 6!
tpa_list (list) – The test pulse amplitudes to save, if 1 is in the list, all positive values are included.
event_dtype (string) – Datatype to save the events with.
lazy_loading (bool) – Recommended! If true, the data is loaded with memory mapping to avoid memory overflows.
origin (string) – This is needed in case you add to merged dataset. In the merge, you can assign an origin data set with individual strings for all original files. If you provide an origin string here, the events are written at the corresponding position in the event array.
-
read_clock_frequency(path_rdt, ints_in_header=7, dvm_channels=0)[source]¶ Estimate the frequency of the DAQ clock by matching it with the CPU clock, for the last couple of events in an RDT file.
- Parameters
path_rdt (string) – Full path to the rdt file.
ints_in_header (int) – Either 6 or 7. The correct value is written in the Par file. Recordings with muon veto have an additional int (and therefore 7) in the header of each written event.
dvm_channels (int) – The number of DVM channels.
-