Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The purpose of environment store (EnvStore) is to keep records of all transitions so that they can be retrieved later using the timestamp of an event. There are three types of EnvStore:

  • epics
  • scans
  • step
  • scan
  • step


 To be able to access the value quickly, the structure (d.detname[seg_id].alg.var_name) that we learn from configs is stored in a dictionary as:

Wiki Markup
{(detname, var_name): (alg, seg_id, var_type), }

For epics and scan EnvStore, we extract something the information above from something like this: 

configs[0].software.scan[0].raw.step_docstring

 

Envstore epics and scans are created when "epics" or "scan" keyword is found in the configs. The variables and values are stored as a dictionary in this format:

{alg: {segment_id: {var_name: var_type, }, }, }

To retrieve a value,

edet = run.Detector('epix_variable_name')val = edet

scandet = run.Detector('motor1')

stepvdet = run .Detector('step_value')

You can retrieve the value by calling det(evt)This . This is done by first locating alg and segment_id that store this variable then matching dgram(s) in the EnvStore is retrieved by searching with timestamp. We then get the value from dgram.epics.alg[segment_id].var_name.

...

EnvStore step is created by default and has detector names with 'config' attribute stored in cfgscan_detnames property (e.g. configs[0].tmoopal[0].config.user.black_level → 'tmoopal' is stored cfgscan_detnames). 

sdet = run.Detector('tmoopal')

step_value = sdet.step.step_value(evt) # this will fail if this detector doesn't have "config" as its attribute in configs – see above

step_docstring = sdet.step.step_docstring(evt)

step_evt = sdet.step.evt(evt)store all steps seen in a run.