sandp package¶
Submodules¶
sandp.event module¶
get event property
-
class
sandp.event.Event(event_number, file_name, config)[source]¶ Bases:
objectEvent class stores all the properties of event
-
boundary()[source]¶ get S1, S2 information, including
- S1: list of list of left and right boundaries of S1
- S2: list of list of left and right boundaries of S2
- NbS1Peaks: number of S1 peaks
- NbS2Peaks: number of S2 peaks
-
sandp.Alls2 module¶
For single electron analysis
-
sandp.Alls2.get_all_vector_as_scalar(ndarr)[source]¶ only select the first entry of a vector if it’s non-empty
-
sandp.Alls2.get_all_vector_by_other_vector(ndarr1, ndarr2)[source]¶ get vector as scalar based on another vector, and assign nan if that vector is empty
-
sandp.Alls2.load(input, processor='sandp_test')[source]¶ load data into all s2 format. Input can be either folder name or run number
-
sandp.Alls2.to_new_df(data, amplifier=True)[source]¶ Make dataframe for all S2s. It provides:
- run_number: number of the run
- event_id: event number in the run
- event_time: when event happened in unix time in seconds
- x: x position of event in arbitrary unit (a.u.)
- y: y position of event in a.u.
- s2: s2 size, PE
- main_s2: size of main s2 for the event where the s2 is, PE
- s2_width_50: s2 width of 50 percent area in us
- s2_width_90: s2 width of 90 percent area in us
- s2_rise_time: s2 rise time in us
- s2_drop_time: s2 drop time in us
- s1: s1 size in PE
- s1_time: center time of main s1 in us
- s2_time: center time of s2 in us
- main_s2_time: center time of main s2 in us
- s2_delay_time: how long s2 is delayed after main s2, us
sandp.utils module¶
Convert root into pandas dataframe
-
sandp.utils.code_hider()[source]¶ Stolen from hax Make a button in the jupyter notebook to hide all code
-
sandp.utils.doc_s_to_run_info(doc_s, version_name)[source]¶ get info of run (file location, amplifier_on, run_number) based on doc after selection and processor version name
-
sandp.utils.folders_to_file_s(folder, processor)[source]¶ find files and amplifier conditions based on folder name(s). Return dictionary with keys of file_location and amplifier_on
-
sandp.utils.folders_to_path(folder, processor)[source]¶ find absolute path of each folder based on name of folder and processor version
-
sandp.utils.get_processor_version_name(processor)[source]¶ get processor name from processor name. You may find it stupid, but ‘.’ is not supported in BSON for mongodb.. Plus we would like to send a reminder if name goes wrong… limited choices!
-
sandp.utils.load(input, processor='sandix_v1.1')[source]¶ load data into pd dataframe by run numbers, or folder name