Experiment¶
Automated Run¶
- class pychron.experiment.automated_run.automated_run.AutomatedRun(*args: Any, **kwargs: Any)[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
- persistence_spec¶
alias of
PersistenceSpec
- 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
- py_sink_data(n=100, delay=1)[source]¶
new measurement interface for just sinking the data from a ring buffer
- script_info¶
alias of
ScriptInfo
Collectors¶
- class pychron.experiment.automated_run.data_collector.DataCollector(*args: Any, **kwargs: Any)[source]¶
Base class for
Collectorobjects. Provides logic for iterative measurement.
- class pychron.experiment.automated_run.multi_collector.MultiCollector(*args: Any, **kwargs: Any)[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¶
Conditional¶
- class pychron.experiment.conditional.conditional.BaseConditional(*args: Any, **kwargs: Any)[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(*args: Any, **kwargs: Any)[source]¶
- class pychron.experiment.conditional.conditional.TruncationConditional(*args: Any, **kwargs: Any)[source]¶
stops the current measurement and continues to next step in pyscript. If more measure calls are made 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(*args: Any, **kwargs: Any)[source]¶
Stop the current analysis immediately. Don’t save to database. Continue to next run in experiment queue
- class pychron.experiment.conditional.conditional.CancelationConditional(*args: Any, **kwargs: Any)[source]¶
Stop the current analysis immediately then stop the experiment.
- class pychron.experiment.conditional.conditional.ActionConditional(*args: Any, **kwargs: Any)[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")