Library Reference

Collection Declarations

Provides information regarding MongoDB Collection template creation. This is analogous to table definitions in SQL databases

EventDescriptor

Event

BeamlineConfig

Collection API

Provides routines for data collection libraries to populate metadataStore

User API

Provides routines for data collection libraries to populate metadataStore

Data API

Includes the raw commands. Developers/expert users can create a set of new behaviors using this module.

Utiliy Library

metadataStore.utilities.utility.get_calib_dict(run_header)[source]

Return the calibration dictionary that is saved in the run_header

run_header : dict
Run header to convert events to lists. Can only be one header.
dict
Dictionary that contains all information inside the run_header’s beamline_config key. If there are multiple ‘configs’ then the return value is a nested dictionary keyed on config_# for the number of config dicts
bool
True: Multiple ‘config’ sections were present, dict is a nested dict False: One ‘config’ section was present, dict is not a nested dict
metadataStore.utilities.utility.get_data_keys(run_header)[source]

Return the names of the data keys. This function assumes that there is only one event descriptor in a run header

run_header : dict
Run header to convert events to lists. Can only be one header.
list
List of the data keys in the run header keyed by the event_descriptor name
metadataStore.utilities.utility.get_data_keys_futureproof(run_header)[source]

Return the names of the data keys. This function assumes that there is only one event descriptor in a run header

Note: This function only works for one event_descriptor per run_header. As soon as we start getting multiple event_descriptors per run header this function will need to be modified

run_header : dict
Run header to convert events to lists. Can only be one header.
dict
List of the data keys in the run header keyed by the event_descriptor descriptor_name. If descriptor_name is not unique for all event_descriptors, see Notes 1
  1. the descriptor_name field in event_descriptors is assumed to be unique. If it is not, then append the last four characters of _id to it. Ideally this would be something more like a PV name and less hostile than the hashed _id field
metadataStore.utilities.utility.listify(run_header, data_keys=None, bash_to_lower=True)[source]

Transpose the events into lists

from this: run_header : {

“event_0_data” : {“key1”: “val1”, “key2”: “val2”, ...}, “event_1_data” : {“key1”: “val1”, “key2”: “val2”, ...}, ... }

to this: {“key1”: [val1, val2, ...],

“key2” = [val1, val2, ...], “keyN” = [val1, val2, ...], “time” = [time1, time2, ...],

}

run_header : dict
Run header to convert events to lists
event_descriptors_key : str
Name of the event_descriptor
data_keys : hashable or list, optional
  • If data_key is a valid key for an event_data entry, turn that event_data into a list
  • If data_key is a list of valid keys for event_data entries, turn those event_data keys into lists
  • If data_key is None, turn all event data keys into lists
bash_to_lower : boolean
True: Compare strings after casting to lowercase False: Compare strings without casting to lowercase
dict
data is keyed on run header data keys with an extra field ‘time’

Table Of Contents

Previous topic

Overview

Next topic

Tutorials

This Page