Experiment¶
Automated Run¶
-
class
pychron.experiment.automated_run.automated_run.AutomatedRun(*args, **kw)[source]¶ The
AutomatedRunobject is used to execute automated analyses.It mostly delegates responisbility to other objects. It provides an interface for
MeasurementPyscripts. All measurement script commands have a corresponding function defined here. A commands corresponding function is defined as py_{function_name}for example
position_magnetcallsAutomatedRun.py_position_magnetdata collection is handled by either
MultiCollectororPeakHopCollectorpersistence (saving to file and database) is handled by
AutomatedRunPersisterAn automated run is executed in four steps by the
ExperimentExecutor.start
extraction
measurement
equilibration
post_equilibration
post_measurement
equilibration and post_equilibration are executed concurrently with the measurement script this way equilibration gas can be measured.
four pyscripts (all optional) are used to program analysis execution
extraction
measurement
post_equilibration
post_measurement
four types of conditionals are available
termination_conditionals
truncation_conditionals
action_conditionals
cancelation_conditionals
-
cancel_run(state='canceled', do_post_equilibration=True)[source]¶ terminate the measurement script immediately
- do post termination
post_eq and post_meas
don’t save run
-
get_interpolation_value(value)[source]¶ value is a string in the format of $VALUE. Search for VALUE first in the options file then in the extraction scripts metadata
- Parameters
value –
- Returns
-
py_add_action(**kw)[source]¶ attr must be an attribute of arar_age
perform a specified action if teststr evaluates to true
-
py_add_termination(**kw)[source]¶ attr must be an attribute of arar_age
terminate run and continue experiment if teststr evaluates to true
-
py_add_truncation(**kw)[source]¶ attr must be an attribute of arar_age
truncate measurement and continue run if teststr evaluates to true default kw: attr=’‘, comp=’‘,start_count=50, frequency=5, abbreviated_count_ratio=1.0
-
py_define_hops(hopstr)[source]¶ set the detector each isotope add additional isotopes and associated plots if necessary
Collectors¶
-
class
pychron.experiment.automated_run.data_collector.DataCollector(*args, **kw)[source]¶ Base class for
Collectorobjects. Provides logic for iterative measurement.
-
class
pychron.experiment.automated_run.multi_collector.MultiCollector(*args, **kw)[source]¶ Collector class for doing multi-collection, i.e. measuring multiple intensities simultaneously.
MulticCollectorandPeakHopCollectorconceptually very similar and potentially could be merged and simplified. MultiCollection is a simple case of PeakHopCollection in which only one peak hop is made at the beginning.
Persistence¶
-
class
pychron.experiment.automated_run.persistence.AutomatedRunPersister(*args, **kw)[source]¶ Save automated run data to file and database(s)
save meta data to the local_lab database. This keeps are local record of all analyses run on the local system
save data to an HDF5 file using a
H5DataManageruse the
Datahubto save data to databases
-
build_peak_hop_tables(grpname, hops)[source]¶ construct the table structure for a peak hop hops needs to be a str parsable by
parse_hops- Parameters
grpname – str
hops – str
-
build_tables(grpname, detectors, n)[source]¶ construct the hdf5 table structure
- Parameters
grpname – str
detectors – list
-
get_data_writer(grpname)[source]¶ grpname should be a str such as “signal”, “baseline”,etc return a closure for writing the data
- Parameters
grpname – str
- Returns
function
Conditional¶
-
class
pychron.experiment.conditional.conditional.BaseConditional(*args, **kw)[source]¶ -
check(run, data, cnt)[source]¶ check conditional if cnt is greater than start count cnt-start count is greater than 0 and cnt-start count is divisable by frequency
returns True if check passes. e.i. Write checks to trip on success. To terminate if Ar36 intensity is less than x use Ar36<x
- Parameters
run –
AutomatedRundata – 2-tuple. (keys, signals) where keys==detector names, signals== measured intensities
cnt – int
- Returns
True if check passes. e.i. Write checks to trip on success.
-
-
class
pychron.experiment.conditional.conditional.AutomatedRunConditional(teststr, start_count=0, frequency=1, *args, **kw)[source]¶
-
class
pychron.experiment.conditional.conditional.TruncationConditional(teststr, start_count=0, frequency=1, *args, **kw)[source]¶ stops the current measurement and continues to next step in pyscript. If more measure calls are main use abbreviated_count_ratio to reduce the number of counts. for example of abbreviated_count_ratio = 0.5 and the original baseline counts = 100, only 50 counts will be made for a truncated run.
-
class
pychron.experiment.conditional.conditional.TerminationConditional(teststr, start_count=0, frequency=1, *args, **kw)[source]¶ Stop the current analysis immediately. Don’t save to database. Continue to next run in experiment queue
-
class
pychron.experiment.conditional.conditional.CancelationConditional(teststr, start_count=0, frequency=1, *args, **kw)[source]¶ Stop the current analysis immediately then stop the experiment.
-
class
pychron.experiment.conditional.conditional.ActionConditional(teststr, start_count=0, frequency=1, *args, **kw)[source]¶ Executes a specified action. The action string is executed as pyscript snippet. actions therefore may be any valid measuremnt pyscript code. for example:
# call a gosub gosub("someGoSub") # open a valve open("V")