amstrax package

Subpackages

Submodules

amstrax.SiPMdata module

amstrax.common module

amstrax.common.get_config_defaults(st, exclude=['raw_records', 'records'], include=[])[source]
amstrax.common.get_elife(run_id)[source]

Return electron lifetime for run_id in ns

amstrax.common.print_versions(modules=('strax', 'amstrax'), print_output=True, include_python=True, return_string=False, include_git=True)[source]

Print versions of modules installed. :param modules: Modules to print, should be str, tuple or list. E.g.

print_versions(modules=(‘numpy’, ‘dddm’,))

Parameters
  • return_string – optional. Instead of printing the message, return a string

  • include_git – Include the current branch and latest commit hash

Returns

optional, the message that would have been printed

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.context_for_daq_reader(st: Context, run_id: str, detector: str = 'xams', 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(output_folder='./strax_data', init_rundb=True, mongo_kwargs={'mongo_collname': 'runs_gas', 'mongo_dbname': 'run', 'runid_field': 'number'}, *args, **kwargs)[source]
amstrax.contexts.xams_led(**kwargs)[source]

amstrax.hitfinder_thresholds module

amstrax.hitfinder_thresholds.hit_min_amplitude(model, n_tpc_pmts=16)[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. :param threshold: value of the threshold to be applied in ADC counts.

amstrax.itp_map module

amstrax.rundb module

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

Bases: StorageFrontend

Frontend that searches RunDB MongoDB for data.

Loads appropriate backends ranging from Files to S3.

backends: list
find_several(keys: List[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(daq_host: str = '', daq_user: str = '', secret_serving_port: Dict[str, Any] = {}) MongoClient[source]

Get a MongoDB client.

amstrax.rundb.get_mongo_collection(detector: str = 'xams', runcolname: str = 'run', **link_kwargs) Collection[source]

Get a specific MongoDB collection based on the detector.

Module contents