amstrax package

Subpackages

Submodules

amstrax.SiPMdata module

class amstrax.SiPMdata.GeoParameters(z_plane, r_cylinder, r_sipm)[source]

Bases: object

Definition of the key parameters needed for the simulations

add_sipm(sipm)[source]
get_sipms()[source]
class amstrax.SiPMdata.PosFit(sipms, method)[source]

Bases: object

nexp(rate0, alpha, xpos, ypos, i)[source]

Calculate the expected number of photons hitting a SiPM

class amstrax.SiPMdata.Reconstruction(geo)[source]

Bases: object

emulate_events(n_uv, n_event, **kwargs)[source]

emulate_events:: Generate events and then reconstruct them * All UV photons are assumed to originate from the location at which they where simulated * The recorded number of photons on each SiPM = n_exp * n_uv with

  • nexp the number of expected photons on a SiPM / UV photon

  • n_uv the number of photons from the S2 signal

event_display(**kwargs)[source]

event_display. Display of fit and log(L) or chi2 for singe events. Use this (long) function) to understand details of the fit procedure

generate_pdf()[source]
plot(plt_type, **kwargs)[source]

Draw plots

reconstruct_position(method)[source]
class amstrax.SiPMdata.SiPM(plot_type, position, qeff)[source]

Bases: object

Class for a single silicon PM

get_hit_probability()[source]
get_location()[source]
get_normal_vector()[source]
get_number_of_hits()[source]
get_qe()[source]
get_type()[source]
set_hit_probability(p)[source]

Set probability for a SiPM to detect an UV photon

p: probability

set_number_of_hits(n)[source]
set_phi_z(r, phi, z)[source]
set_xyz(x)[source]

amstrax.common module

amstrax.common.get_elife(run_id)[source]

Return electron lifetime for run_id in ns

amstrax.common.get_resource(x, fmt='text')[source]
amstrax.common.select_channels(arr, channel_list)[source]

Select only the values in arr that have arr[‘channel’] in channel_list

amstrax.contexts module

amstrax.contexts.amstrax_gas_test_analysis()[source]

Return strax test for analysis of Xams gas test data

amstrax.contexts.amstrax_gas_test_analysis_alt_baseline()[source]

Return strax test for analysis of Xams gas test data

amstrax.contexts.amstrax_run10_analysis(output_folder='./strax_data')[source]

Return strax test for analysis of Xams gas test data

amstrax.contexts.context_for_daq_reader(st: strax.context.Context, run_id: str, runs_col_kwargs: Optional[dict] = None, run_doc: Optional[dict] = None, check_exists=True)[source]

Given a context and run_id, change the options such that we can process the live data.

IMPORTANT: After setting the context, we specify the location of the live-data for a single run. This means you CANNOT re-use this context! Therefore, if you want to process data, you should start a new context if you want to process another run starting from the live data

Parameters
  • st – Context to change

  • run_id – the run_id of the run that should be processed

  • runs_col_kwargs – Optional options (kwargs) for starting the run-collection, see get_mongo_collection

  • run_doc – Optional document associated with this run-id.

Returns

Context ready to start processing <run_id> with from the live-data

amstrax.contexts.xams(*args, **kwargs)[source]
amstrax.contexts.xams_little(*args, **kwargs)[source]

amstrax.hitfinder_thresholds module

amstrax.hitfinder_thresholds.hit_min_amplitude(model, n_tpc_pmts=8)[source]

Return hitfinder height threshold to use in processing

Parameters

model – Model name (str), or int to use a uniform threshold,

or array/tuple or thresholds to use.

amstrax.itp_map module

class amstrax.itp_map.InterpolateAndExtrapolate(points, values, neighbours_to_use=None)[source]

Bases: object

Linearly interpolate- and extrapolate using inverse-distance weighted averaging between nearby points.

class amstrax.itp_map.InterpolatingMap(data)[source]

Bases: object

Correction map that computes values using inverse-weighted distance interpolation.

The map must be specified as a json translating to a dictionary like this:

‘coordinate_system’ : [[x1, y1], [x2, y2], [x3, y3], [x4, y4], …], ‘map’ : [value1, value2, value3, value4, …] ‘another_map’ : idem ‘name’: ‘Nice file with maps’, ‘description’: ‘Say what the maps are, who you are, etc’, ‘timestamp’: unix epoch seconds timestamp

with the straightforward generalization to 1d and 3d.

The default map name is ‘map’, I’d recommend you use that.

For a 0d placeholder map, use

‘points’: [], ‘map’: 42, etc

data_field_names = ['timestamp', 'description', 'coordinate_system', 'name', 'irregular']

amstrax.rundb module

class amstrax.rundb.RunDB(mongo_dbname=None, mongo_collname=None, runid_field='name', local_only=True, new_data_path=None, reader_ini_name_is_mode=False, readonly=True, *args, **kwargs)[source]

Bases: strax.storage.common.StorageFrontend

Frontend that searches RunDB MongoDB for data.

Loads appropriate backends ranging from Files to S3.

backends: list
find_several(keys: List[strax.storage.common.DataKey], **kwargs)[source]

Return list with backend keys or False for several data keys.

Options are as for find()

hosts = {'dali': '^dali.*rcc.*'}
provide_run_metadata = True
run_metadata(run_id, projection=None)[source]

Return run metadata dictionary, or raise RunMetadataNotAvailable

amstrax.rundb.get_mongo_client(**link_kwargs)[source]

Get a mongo client, any kwargs are passed on to link_to_daq

amstrax.rundb.get_mongo_collection(database_name='run', database_col='runs_new', **link_kwargs)[source]

Get the runs collection

Module contents