From 32fcbee90916833cec99594b95d4eb96d25cfbec Mon Sep 17 00:00:00 2001 From: Anthony LaTorre Date: Mon, 22 Aug 2011 15:08:12 -0400 Subject: add ability to specify file and dataset attributes by prompting the user when running fetch.py --- run_setup.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 run_setup.py (limited to 'run_setup.py') diff --git a/run_setup.py b/run_setup.py new file mode 100644 index 0000000..ff220e9 --- /dev/null +++ b/run_setup.py @@ -0,0 +1,33 @@ +""" +This file contains dictionaries for defining attributes to attach to data +files. Each dictionary should contain a 'file' and 'dataset' key whose values +are dictionaries specifying attributes to attach to the root of the hdf5 file +and each dataset in the file respectively. The values in these dictionaries +should contain the type to convert the user's input to before storing them +in the data file. + +Example: + >>> fetch.py test.hdf5 -c default + / + /docstring? new batch of pmts + /channel1 + /channel1.pmtid? trig + /channel1.voltage? 800 + /channel1.termination? 50.0 + /channel2 + /channel2.pmtid? ZN0103 + /channel2.voltage? 1800.0 + /channel2.termination? 50.0 + ... + saving event: 1000 + Completed 1000 events in 2.535 seconds. + Averaged 0.00253 seconds per acquisition. + Wrote to file 'test.hdf5'. +""" + +import string + +default = { 'file' : { 'docstring' : str }, + 'dataset' : { 'pmtid' : string.lower, + 'voltage' : float, + 'termination' : float } } -- cgit