49
Pychron Documentation Release 2.0.4 Jake Ross December 10, 2014

Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron DocumentationRelease 2.0.4

Jake Ross

December 10, 2014

Page 2: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of
Page 3: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Contents

1 Pychron Introduction 3

2 Building Pychron Application 5

3 Pychron User Guide 73.1 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73.2 Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113.3 Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223.4 Entry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

4 Pychron Develop Guide 294.1 Launching Pychron . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294.2 Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304.3 Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304.4 Automated Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314.5 Experiment Construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324.6 Communications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

5 Pychron Course Material 355.1 Pychron Week Day 1. General Pychron/Experiment . . . . . . . . . . . . . . . . . . . . . . . . . . 355.2 Pychron Week Day 2. Browsing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395.3 Pychron Week Day 3. Fitting IsoEvo, Blanks, ICFactor . . . . . . . . . . . . . . . . . . . . . . . . . 43

6 Indices and tables 45

i

Page 4: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

ii

Page 5: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

Contents 1

Page 6: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

2 Contents

Page 7: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

CHAPTER 1

Pychron Introduction

This is an introduction to Pychron.

3

Page 8: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

4 Chapter 1. Pychron Introduction

Page 9: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

CHAPTER 2

Building Pychron Application

example commands to build a pychron application

cd ~/Programming/git/pychroncd python app_maker.py -Aexperiment -v2.0.3rc1

This will build the pyExperiment (-A) application with version number 2.0.3rc1 (-v)

5

Page 10: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

6 Chapter 2. Building Pychron Application

Page 11: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

CHAPTER 3

Pychron User Guide

3.1 Configuration

3.1.1 Plugins

Plugins are enabled/disabled in the setupfiles/initialization.xml file.

List of Plugins

• General

– Database - Access to MySQL, SQLite, PostgreSQL, etc. All database dialects supported by SQLAlchemy.

– Entry - Enter information into a database. Projects, samples, labnumbers, etc.

– Processing - Process Data. Make figures and tables.

– ArArConstants - Constants used in Ar-Ar geochronology.

– SystemMonitor - “Strip-chart” recording of laboratory conditions and processes.

• Hardware

– Experiment - Create and execute Pychron Experiments.

– PyScript - View/Edit pyscripts used for automated data collection.

– ExtractionLine - View/Control a UHV extraction line.

– DashboardServer - View/Publish a configurable set of parameters. Parameters are published to networkand read by any connected client.

– Spectrometer - View/Control a spectrometer. Currently only Thermo spectrometers with RemoteCon-trolServer.cs are supported.

Example Data Processing Initialization File

<root><globals></globals><plugins><general>

<plugin enabled="true">Database</plugin>

7

Page 12: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

<plugin enabled="true">Processing</plugin><plugin enabled="true">ArArConstants</plugin><plugin enabled="true">Entry</plugin><plugin enabled="true">SystemMonitor</plugin>

</general></plugins>

</root>

Example Experiment Initialization File

<root><globals></globals><plugins><general>

<plugin enabled="true">Database</plugin><plugin enabled="true">Experiment</plugin><plugin enabled="true">Processing</plugin><plugin enabled="true">PyScript</plugin><plugin enabled="true">ArArConstants</plugin><plugin enabled="true">Entry</plugin><plugin enabled="true">DashboardServer</plugin>

</general><hardware>

<plugin enabled="false">Spectrometer<device enabled="true">spectrometer_microcontroller<klass>ArgusController</klass>

</device></plugin><plugin enabled="true">ExtractionLine

<processor enabled="false">/tmp/hardware-extractionline</processor><manager enabled="false">gauge_manager<device enabled="true">bone_micro_ion_controller

<klass>MicroIonController</klass></device><device enabled="false">microbone_micro_ion_controller

<klass>MicroIonController</klass><required>false</required>

</device></manager><manager enabled="true">valve_manager

<device enabled="true">valve_controller</device></manager><device enabled="true">air_transducer

<klass>Transducer</klass></device>

</plugin></hardware><data></data>

</plugins></root>

8 Chapter 3. Pychron User Guide

Page 13: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

Example Laser Initialization File

<root><globals></globals><plugins><general>

<plugin enabled="true">Database</plugin><plugin enabled="false">Experiment</plugin><plugin enabled="true">Processing</plugin><plugin enabled="false">PyScript</plugin><plugin enabled="false">ArArConstants</plugin><plugin enabled="false">Entry</plugin><plugin enabled="false">SystemMonitor</plugin><plugin enabled="true">DashboardServer</plugin>

</general><hardware>

<plugin enabled="false">Spectrometer<device enabled="true">spectrometer_microcontroller<klass>ArgusController</klass>

</device></plugin><plugin enabled="true">ExtractionLine

<processor enabled="false">/tmp/hardware-extractionline</processor><manager enabled="false">gauge_manager<device enabled="true">bone_micro_ion_controller

<klass>MicroIonController</klass></device><device enabled="false">microbone_micro_ion_controller

<klass>MicroIonController</klass><required>false</required>

</device></manager><manager enabled="true">valve_manager

<device enabled="true">valve_controller</device></manager><device enabled="true">air_transducer

<klass>Transducer</klass></device>

</plugin></hardware><data></data><social>

<plugin enabled="true">Email</plugin><plugin enabled="false">Twitter</plugin>

</social></plugins>

</root>

3.1.2 Extraction Line Canvas

This section describes how to construct and modify an extraction line canvas.

Two files are required to define an extraction line canvas.

1. setupfiles/canvas2D/canvas.xml Defines the canvas elements

3.1. Configuration 9

Page 14: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

2. setupfiles/canvas2D/canvas_config.xml Defines globals parameters e.i origin, bgcolor

3. Optional. setupfiles/canvas2D/alt_canvas.xml Defines globals for the secondary canvas (Canvasdisplayed as a pane within a window). Useful for defining a smaller font when canvas displayed with Experimentor Spectrometer tasks.

Lets construct an example canvas.xml file to see how it works.

The file starts with the standard <root> xml tag. All other elements will be children of root. Various graphicalelements can be easily added to the canvas. Lets start with a stage element. Stages are generic areas that connectmultiple valves.

<root><stage>Bone

<translation>10,5</translation><dimension>5,2</dimension><color>255,0,0</color>

</stage></root>

The above snippet defines a stage named “Bone” that is 5 units wide, 2 units tall and positioned 10 units to the rightand 5 units above the center of the canvas. The color of the stage is defined using the color tag and is red in this case-255,0,0 (R,G,B). By default the name of the stage is rendered by can be disabled using display_name="false"...<stage display_name="false">Bone...

Before we can see what our canvas looks like, we need to make a canvas_config.xml file. This file contains Ximportant elements.

1. origin. Shift the center of the canvas X,Y

2. xview. Left bounds, Right bounds

3. yview. Bottom bounds, Top bounds

4. color tags. default colors for canvas elements

<root><origin>0,2.5</origin><xview>-25,25</xview><yview>-22,22</yview><color tag="bgcolor">lightblue</color><color tag="getter">green</color><!-- optional--><font>arial 12</font>

</root>

The above snippet shifts the canvas up 2.5 units and sets the background color to lightblue. The default color for"getter" elements is “green”. The left bounds of the canvas is -25 and the right 25 (width=50 units). The upperand lower bounds are -22 and 22 respectively (height=44 units). Optionally the font used for labels can be set using afont tag.

(Note. Defining the canvas is independent of defining hardware connections. Elements defined here need not havephysical representations)

10 Chapter 3. Pychron User Guide

Page 15: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

3.2 Operation

3.2.1 Pychron and the Spectrometer

Measurement Scripts

Multicollect

#!Measurement

#countsMULTICOLLECT_COUNTS= 4

#baselinesBASELINE_COUNTS= 2BASELINE_DETECTOR= ’H1’BASELINE_MASS= 39.5BASELINE_BEFORE= FalseBASELINE_AFTER= True

#peak centerPEAK_CENTER_BEFORE= FalsePEAK_CENTER_AFTER= FalsePEAK_CENTER_DETECTOR= ’H1’PEAK_CENTER_ISOTOPE= ’Ar40’

#equilibrationEQ_TIME= 2INLET= ’R’OUTLET= ’S’DELAY= 3.0TIME_ZERO_OFFSET=5

ACTIVE_DETECTORS=(’H1’,’AX’)FITS=[

((0,5),(’linear’, ’linear’)),((5,None),(’linear’, ’parabolic’))]

USE_FIT_BLOCKS=True

ACTIONS= [(False,(’age’,’<’,10.6,20,10,’’,False)),]

TRUNCATIONS = [(False, (’age’,’<’,10.6,20,10,)),]

TERMINATIONS= [(False, (’age’,’<’,10.6,20,10))]

def main():#this is a comment’’’

this is a multilinecomment aka docstring

’’’#display information with info(msg)

3.2. Operation 11

Page 16: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

info(’unknown measurement script’)

#set the spectrometer parameters#provide a valueset_source_parameters(YSymmetry=10)

#or leave blank and values are loaded from a config file (setupfiles/spectrometer/config.cfg)set_source_optics()

#set the cdd operating voltageset_cdd_operating_voltage(100)

if PEAK_CENTER_BEFORE:peak_center(detector=PEAK_CENTER_DETECTOR,isotope=PEAK_CENTER_ISOTOPE)

#open a plot panel for this detectorsactivate_detectors(*ACTIVE_DETECTORS)

if BASELINE_BEFORE:baselines(ncounts=BASELINE_COUNTS,mass=BASELINE_MASS, detector=BASELINE_DETECTOR)

#set default regressionregress(*FITS)

#position mass spectrometerposition_magnet(’Ar40’, detector=’H1’)

#gas is staged behind inlet

#post equilibration script triggered after eqtime elapsed#equilibrate is non blocking#so use either a sniff of sleep as a placeholder until eq finishedequilibrate(eqtime=EQ_TIME, inlet=INLET, outlet=OUTLET)

for use,args in ACTIONS:if use:

add_action(*args)

for use,args in TRUNCATIONS:if use:

add_truncation(*args)

for use, args in TERMINATIONS:if use:

add_termination(*args)

#equilibrate returns immediately after the inlet opensset_time_zero(offset=TIME_ZERO_OFFSET)

sniff(EQ_TIME)

#multicollect on active detectorsmulticollect(ncounts=MULTICOLLECT_COUNTS, integration_time=1)

clear_conditionals()

if BASELINE_AFTER:baselines(ncounts=BASELINE_COUNTS,mass=BASELINE_MASS, detector=BASELINE_DETECTOR)

if PEAK_CENTER_AFTER:

12 Chapter 3. Pychron User Guide

Page 17: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

peak_center(detector=PEAK_CENTER_DETECTOR,isotope=PEAK_CENTER_ISOTOPE)

#WARM CDDwarm_cdd()

info(’finished measure script’)

def warm_cdd():’’’

1. blank beam2. move to desired position3. unblank beam

’’’if not is_last_run():

set_deflection(’CDD’,2000)

position_magnet(28.04, detector=’H1’)#or#position_magnet(5.00, dac=True)

#return to config.cfg deflection valueset_deflection(’CDD’)

#========================EOF==============================================================

Peak Hop

For a detailed description of a Peak Hop sequence see Peak Hop Definition. Instead of defining the peak hop sequencedirectly within the measurement script it is cleaner to load the sequence from a separate file using load_hops

#!Measurement

#===============================================================================# parameter definitions#===============================================================================#multicollectMULTICOLLECT_COUNTS = 1003MULTICOLLECT_ISOTOPE = ’Ar40’MULTICOLLECT_DETECTOR = ’H1’

#baselinesBASELINE_COUNTS = 10BASELINE_DETECTOR = ’H1’BASELINE_MASS = 39.5BASELINE_BEFORE = FalseBASELINE_AFTER = True

#peak centerPEAK_CENTER_BEFORE = FalsePEAK_CENTER_AFTER = FalsePEAK_CENTER_DETECTOR = ’H1’PEAK_CENTER_ISOTOPE = ’Ar40’

#equilibrationEQ_TIME = 1.0EQ_INLET = ’S’

3.2. Operation 13

Page 18: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

EQ_OUTLET = ’O’EQ_DELAY = 3.0

#PEAK HOPUSE_PEAK_HOP = TrueNCYCLES = 3BASELINE_NCYCLES = 3

"""HOPS definition

HOPS is a list of peak hops.a peak hop is a list of iso:detector pairs plus the number of counts to measurefor this hop. The first iso:detector pair is used for positioning.

added rev 1665specify a deflection for the iso:det pairAr40:H1:30if no value is specified and the deflection value had been changed by a previous cyclethen set the deflection to the config. value

(’Ar40:H1, Ar39:AX, Ar36:CDD’, 10)(’Ar40:L2, Ar39:CDD’, 20),means position Ar40 on detector H1 andrecord 10 H1,AX,and CDD measurements. After 10 measurementsposition Ar40 on detector L2, record 20 measurements.

repeat this sequence NCYCLES times

"""

HOPS=[(’Ar40:H1:10, Ar39:AX, Ar36:CDD’, 5, 1),#(’Ar40:L2, Ar39:CDD’, 5, 1),#(’Ar38:CDD’, 5, 1),(’Ar37:CDD’, 5, 1),]

#DetectorsACTIVE_DETECTORS = (’H2’,’H1’,’AX’,’L1’,’L2’,’CDD’)FITS = (’average’,’parabolic’,’parabolic’,’parabolic’,’parabolic’,’linear’)#===============================================================================##===============================================================================

def main():#this is a comment’’’

this is a multilinecomment aka docstring

’’’#display information with info(msg)info(’unknown measurement script’)

#set the spectrometer parameters#provide a value

14 Chapter 3. Pychron User Guide

Page 19: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

#set_source_parameters(YSymmetry=10)

#or leave blank and values are loaded from a config file (setupfiles/spectrometer/config.cfg)#set_source_optics()

#set the cdd operating voltage#set_cdd_operating_voltage(100)

if PEAK_CENTER_BEFORE:peak_center(detector=PEAK_CENTER_DETECTOR,isotope=PEAK_CENTER_ISOTOPE)

activate_detectors(*ACTIVE_DETECTORS)

if BASELINE_BEFORE:baselines(ncounts=BASELINE_COUNTS,mass=BASELINE_MASS, detector=BASELINE_DETECTOR)

#set default regressionregress(*FITS)

#position mass spectrometer even though this is a peak hop so an accurate sniff/eq is measuredposition_magnet(MULTICOLLECT_ISOTOPE, detector=MULTICOLLECT_DETECTOR)

#gas is staged behind inlet

#post equilibration script triggered after eqtime elapsed#equilibrate is non blocking#so use either a sniff of sleep as a placeholder until eq finishedequilibrate(eqtime=EQ_TIME, inlet=EQ_INLET, outlet=EQ_OUTLET)

#equilibrate returns immediately after the inlet opensset_time_zero()

sniff(EQ_TIME)

if USE_PEAK_HOP:hops=load_hops(’hops/hop.txt’)info(hops)

peak_hop(ncycles=NCYCLES, hops=HOPS)else:

#multicollect on active detectorsmulticollect(ncounts=MULTICOLLECT_COUNTS, integration_time=1)

if BASELINE_AFTER:if USE_PEAK_HOP:

peak_hop(ncycles=BASELINE_NCYCLES, hops=BASELINE_HOPS, baseline=True)else:

baselines(ncounts=BASELINE_COUNTS,mass=BASELINE_MASS,detector=BASELINE_DETECTOR)

if PEAK_CENTER_AFTER:peak_center(detector=PEAK_CENTER_DETECTOR,isotope=PEAK_CENTER_ISOTOPE)

info(’finished measure script’)

#=============================EOF=======================================================

3.2. Operation 15

Page 20: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

Annotated Multicollect

#!Measurement

def main():’’’display a message in the Experiment Executor and add to log’’’info(’example measurement script’)

’’’define which detectors to collect with’’’activate_detectors(’H1’,’AX’,’L1’,’L2’,’CDD’)

’’’set the fit typesif a single value is supplied it’s applied to all active detectors’’’regress(’parabolic’)

#or a list of fits the same len as active detectors is requiredregress(’parabolic’,’parabolic’,’linear’,’linear’,’parabolic’)

’’’position the magnet

position_magnet(4.54312, dac=True) # detector is not relevantposition_magnet(39.962, detector=’AX’)position_magnet(’Ar40’, detector=’AX’) #Ar40 will be converted to 39.962 use mole weight dict’’’

#position isotope Ar40 on detector H1position_magnet(’Ar40’, detector=’H1’)

’’’sniff and split

1. isolate sniffer volumne2. equilibrate3. sniff gas4. test condition

gas is staged behind inletisolate sniffer volume’’’close(’S’)sleep(1)

’’’equilibrate with mass specset outlet to make a static measurement

set do_post_equilibration to False so that the gas in the microboneis not pumped away’’’equilibrate(eqtime=20, inlet=’R’, do_post_equilibration=False)set_time_zero()

16 Chapter 3. Pychron User Guide

Page 21: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

#display pressure wavesniff(20)

#define sniff/split thresholdsniff_threshold=100

#test conditionif get_intensity(’H1’)>sniff_threshold:

extraction_gosub(’splits:jan_split’)’’’extraction_gosub is same asgosub(’splits:jan_split’, klass=’ExtractionLinePyScript’)’’’

’’’gas has been split down and staged behind the inletpost equilibration script triggered after eqtime elapsedequilibrate is non-blocking so use a sniff or sleep as a placeholdere.g sniff(<equilibration_time>) or sleep(<equilibration_time>)’’’equilibrate(eqtime=5,inlet=’R’, outlet=’V’)set_time_zero()

#sniff the gas during equilibrationsniff(5)sleep(1)

’’’Set conditionals

order added defines conditional precedence.conditionals after the first true conditional are NOT evaluated

terminate if age < 10000 ma after 5 counts, check every 2 countsterminate means do not finish measurement script and immediately executethe post measurement script’’’add_termination(’age’,’<’,10000, start_count=5, frequency=2)

’’’truncate means finish the measurement block immediately and continue to nextcommand in the script’’’add_truncation(’age’,’>’,10.6, start_count=20, frequency=10)

’’’use add_action to specify an action to take for a given conditional

action can be a code snippet ’sleep(10)’, ’gosub("example_gosub")’ ora callable such as a function or lambda

the resume keyword (default=False) continues measurement after executingthe action’’’add_action(’age’,’>’,10.6, start_count=20, frequency=10,

action=’sleep(10)’)add_action(’age’,’<’,10000, start_count=5, frequency=2,

action=func)

3.2. Operation 17

Page 22: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

add_action(’age’,’<’,10000, start_count=5, frequency=2,action=’sleep(7)’,resume=True)

add_action(’age’,’<’,10000, start_count=5, frequency=2,action=’gosub("snippet")’)

#measure active detectors for ncountsmulticollect(ncounts=50, integration_time=1)

’’’clear the conditionals when measuring baselinealso have oppurtunity to add new conditionals’’’clear_conditionals()

#multicollect baselines for ncountsbaselines(ncounts=5,mass=39.5)

info(’finished measure script’)

def func():info(’action performed’)

#=============================EOF=======================================================

Peak Hop Definition

This section describes how to define a peak hopping sequence.

A peak hop sequence, HOPS , is a list of peak hops (i.e magnet moves).

HOPS=[(’Ar40:H1:10, Ar39:AX, Ar36:CDD’, 5, 1),(’Ar37:CDD’, 5, 1)]

A peak hop is a list of iso:detector pairs plus two configuration values,

1. the number of counts at the current position

2. the settling time (s) after magnet positioning and before measurement starts.

The first iso:detector pair of each hop is used for positioning.

To specify a non-nominal deflection value for a detector use iso:detector:deflection

Ar40:H1:30

If no value is specified and the deflection value had been changed by a previous cycle then the deflection is set to thevalue stored in the spectrometer configuration file.

The following sequence,

(’Ar40:H1, Ar39:AX, Ar36:CDD’, 10, 1)(’Ar40:L2, Ar39:CDD’, 20, 5)

translates to

1. position Ar40 on detector H1, wait 1s and record 10 H1,AX,and CDD measurements.

2. After 10 measurements position Ar40 on detector L2, wait 5s, then record 20 measurements.

18 Chapter 3. Pychron User Guide

Page 23: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

Source Parameters

There are three ways in which pychron can interact with the spectrometers sources settings.

1. Readonly - Pychron only reads the sources parameters from the spectrometer. For each analysis these valuesare saved to the pychron database in the meas_SpectrometerParametersTable.

!Pychron currently does not save the source values to the secondary database.!

2. Read/Write - Pychron sets the source parameters in the measurement script. By using a pyscript the userhas fine-grained control of when and what values are set. See below for detailed description of setting sourceparameters in a pyscript.

3. Config Write - On startup Pychron sets the source parameters using values retrieved from a configuration filelocated at setupfiles/spectrometer/config.py

Setting Source parameters

Set source parameters individually by name

set_extraction_lens(103.4)

Set parameters using a configuration file located at setupfiles/spectrometer/config.py

set_source_parameters()set_source_optics()

Values from the configuration file can be overwritten by specifying a parameter name and value

set_source_parameter(IonRepeller=134)

Detector Parameters

Interacting with the detector parameters is the same as with the source parameters. The deflection values are saved inthe pychron database in the meas_SpectrometerDeflectionsTable

Reference

Pyscript Commands

set_ysymmetry(100)set_zsymmetry(100)set_zfocus(100)set_extraction_lens(100)set_deflection(’H2’,0)

# IonRepeller, ElectronVoltsset_source_parameters()

# ExtractionLens, YSymmetry, ZSymmetry, ZFocusset_source_optics()

3.2. Operation 19

Page 24: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

Config file Example

[SourceParameters]ionrepeller = 0electronvolts = 0

[SourceOptics]ysymmetry = 0zsymmetry = 0zfocus = 0extractionlens = 0

[Deflections]h2 = 0h1 = 0ax = 0l1 = 0l2 = 0cdd = 0

[CDDParameters]operatingvoltage = 618.0

3.2.2 Pychron and the Database

3.2.3 Pychron and Valves

3.2.4 Pychron and a Laser

3.2.5 Experiments

This section describes how to write an experiment with Pychron. A Pychron experiment in Mass Spec parlance isa Multiple Runs Sequence.

Conditionals

Conditionals are conditional actions that are executed are various times throughout an automated analysis Multipletypes of conditionals exist

1. Truncation - truncate the current run and continue experiment.

2. Termination - immediately terminate run and stop experiment.

3. Action - do a specified action.

4. QueueAction - used to run blanks, airs, etc. based on a condition

There are also multiple levels at which conditionals may be specified.

1. System - use these conditionals for every experiment and run.

2. Queue - use these conditionals for every run in the queue.

3. Run - use these conditionals for this run.

System conditionals are specified in spectrometer/default_conditionals.yml Queue conditionals filesare located in queue_conditionals Run conditionals file are located in scripts/conditionals

20 Chapter 3. Pychron User Guide

Page 25: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

Note: QueueActions may only be specified at the Queue level

Testable Attributes

Name Modifiersage<Valid Isotope> bs_corrected, bs, current[cur], std_dev[sd,stddev]kcakclcakclk<Detector> inactive, deflection<m1>/<m2>

Functions ==================== ==========================================================Name Example ——————– ———————————————————- min min(Ar40)max max(Ar40) average average(Ar40) slope slope(Ar40) ==============================================================================

Position Rules

The following is a list of rules for how a position entry is interpreted

1. 4 or p4 (Goto position 4)

2. 3,4,5 (Goto positions 3,4,5. Treat as one analysis)

3. 7-12 (Goto positions 7,8,9,10,11,12. Treat as individual analyses)

4. 7:12 (Same as #3)

5. 10:16:2 (Goto positions 10,12,14,16. Treat as individual analyses)

6. D1 (Drill position 1)

7. T1-2 (Goto named position T1-2 i.e transect 1, point 2)

8. L3 (Trace path L3)

9. 1-6;9;11;15-20 (Combination of rules 2. and 3. Treat all positions as individual analyses)

Here are a few examples of how Rule #9 is processed

user_input= 1-6;9

#resulting positionspositions= 1,2,3,4,5,6,9

user_input= 1-3;9;11-13

#resulting positionspositions= 1,2,3,4,5,6,9,11,12,13

The starting position, i.e 1 in the above case, can be greater than the end position i.e 6. If the start > end, positions willdecrease from start to end

user_input= 9;6-1

3.2. Operation 21

Page 26: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

#resulting positionspositions= 9,6,5,4,3,2,1

If auto-increment position is enabled pychron starts incrementing from the last value and follows the same pattern asthe rule.

user_input= 1-6;9

#resulting auto-incremented positionspositions= 10-15;18

user_input= 1-6

#resulting auto-incremented positionspositions= 7-12

3.3 Processing

3.3.1 Using the Browser

The Browser is a convenient way of navigating the pychron database.

Note: If the Browser is not open, go to View/Browser. If Browser is not present then the active window does notsupport the Browser and you must open a window that uses it e.g. Recall

The first step when using the Browser is to select a top-level filtering criteria. These are

1. Projects

2. Irradiation/Level

Note: Irradiation/Level is only enabled when no Projects are selected. To clear the project selection, Right-click/Unselect or use the X button

The Projects table lists all projects currently in the database.

Note: For faster/easier searching of the Project table use the Filter textbox to limit the displayed projects to projectsthat begin with the filtering string. e.g. filter=’abc’ projects=’abc’, ‘abcd’, ‘abcd12’ but not ‘1abc’

Note: There are a few special projects listed in the Projects table. These are the RECENT ... entries, one for eachmass spectrometer in the database. Selecting a RECENT entry will select all samples that have been run within thelast X hours. To set X go to Preferences/Processing/Recent

Use the Irradiations drop-downs to filter the available samples by irradiation and irradiation level.

Note: Use the Binoculars button to force a refresh using the current filtering criteria.

Graphical Filtering

The Graphical Filtering view provides a way to view and select a series of analyses. You can narrow that date rangeto display in a number of ways

22 Chapter 3. Pychron User Guide

Page 27: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

1. Hit the Graphical Filtering button and select a date range manually

2. Select a set of projects and pychron automatically selects the start and end dates

3. Select a set of projects then fine tune your selection of samples

Note: If the date range is greater than X days you are asked to fine tune your selection by modifying the start and/orend dates. To set X go to Preferences/Processing/Graphical Filtering

Note: If the samples you have selected were run on multiple mass spectrometers you are given the option of filteringthe selection by mass spectrometer.

Advanced Filtering

If you find that the Browser cannot filter the analyses in the desired way, you may use the Advanced Filtering option.This will open a dialog similar to Mass Spec’s run selection, in which you may string together a list of queries in orderto search for a set of analyses

3.3.2 Tagging

There are two types if tagging in Pychron

1. Analysis Tagging

2. Data Reduction Tagging

Analysis Tagging

Analysis tagging is used to tag individual analyses and specify how pychron should handle the analysis when process-ing and plotting. There are two generic tags, OK and Invalid. OK is the default tag for an analysis. It indicates thatthe analysis is acceptable a should be included in all processes. Invalid indicates that the analysis is bad and shouldnot be hidden from the browser and plotting routines

Note: The Browser includes a checkbox to include Invalid analyses in the results. By default this it is set to False

In addition to the two generic tags, users have to option to create there own tags. This user defined tags can have anyname and also come with four options for handling the plotting behavior. These options are

1. omit_ideo

2. omit_spec

3. omit_iso

4. omit_series

These options indicate whether the analysis should be excluded from the plot. Excluded in this context does not meannot visible, rather the analysis is given a special marker indicating it is not used in the calculations. For exampleomitted analyses in an ideogram are displayed as red open squares and are not used in the calculation of the mean age.

To add an analysis tag to one or more analyses

1. Select a set of analyses using one of the following steps

(a) select analyses from browser

(b) select analyses from Unknowns

3.3. Processing 23

Page 28: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

(c) graphically select analyses on figure

2. Go to Data/Tag

3. Select existing tag or make a new one

4. (optional) fine-tune analysis select

5. Click OK to apply of Cancel to cancel

Data Reduction Tagging

Data reduction tagging is used to preserve the state of a set of analyses. This feature is slightly analogous to thebranching data model used in software development, namely Git. For example, say you would like to reduce a set ofdata with all parabolic fits and then compare it to all linear fits. Data reduction tagging allows the user to save eachdata reduction session, one for parabolic fits and one for linear, and easily toggle between the two sets.

To add a data reduction tag

1. Perform the desired data reduction

2. Selected a set of analyses in the browser or Unknowns pane

3. Go to Data/Data Reduction Tag

4. Give the tag a name

5. Click OK to apply of Cancel to cancel

To toggle between data reduction tags

1. Go to Data/Set Data Reduction Tag

2. Select the desired tag from the table. You can filter by tag name and/or user

3. Click OK to apply of Cancel to cancel

Note: If you select a set of analyses prior to step 1. pychron will only display the data reduction tags which containthe selected set of analyses

3.3.3 Permutator

Pychron has the ability to automatically generate all data reduction permutations for a dataset.

Note: Currently (dev/2.0.4) only has the isotope evolution permutations implemented.

The permutator is configured using a yaml file. There are two main configuration values the user must specify.

1. a list of fit types

2. (Optional) Ar isotopes to not permutate

The list of fit types defines which fits to permutate for the Ar isotopes. For example, if the user specifies linear andparabolic the follow permutations are generated.

24 Chapter 3. Pychron User Guide

Page 29: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

Ar40 Ar39 Ar38 Ar37 Ar36L L L L LL L L L PL L L P LL L L P PL L P L LL L P L PL L P P LL L P P P... ... ... ... ...P P P P P

The total number of permutations equals 𝑛5𝑓𝑖𝑡𝑡𝑦𝑝𝑒𝑠. If you would like to reduce the number of permutations you can

specify Ar isotopes to skip.

3.3.4 Workspace

The workspace is an analysis data container. the workspace contains, a MANIFEST file, that lists all the analyses inthe workspace and one file per analysis. The analysis files are in yaml format and named using the analysis RunID.saving as a yaml file is a convienent way to parse analysis files. Each workspace is a git repository, allowing branchingand fine-grained version control.

The first step after creating a workspace is to load analyses into it. This process is called “checking out” in pychron.The user selects a set of analyses using the browser and for each analysis pychron extracts the analytical data from thecentral mysql database and saves it to the workspace directory as a yaml file.

By default the workspace comes with to branches: master and develop. Checking out of analyses happens on themaster branch (changes are automatically merged into develop). Data processing changes are committed on develop.To share the changes, merge develop into master and commit to a public host repo (e.g. GitHub).

3.3. Processing 25

Page 30: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

1. Checkout analyses to User A’s workspace

2. Do data reduction

3. Push changes to GitHub

4. Pull changes to User B’s workspace

3.4 Entry

3.4.1 Import Analyses From File

It is possible to import analyses from a Excel, csv, or yaml file into the pychron database.

Excel

To import analyses from an Excel file follow the following file format.

Note: Column order is not important, however, column names must match the following table. In addition the columnnames should be on the second row.

Example Excel template

analysis_import.xls

Necessary Columns

26 Chapter 3. Pychron User Guide

Page 31: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

name type example optional noteidentifier str 12345project str Foosample str Barmaterial str Feldsparaliquot int 1step int or str 2 or Banalysis_type str unknownmass_spectrometer str jananalysis_time date 6/7/12irradiation str NM-256 Yescomment str This is a comment YesAr40 str or float 10.123 or Sheet2 Use sheet name to link to sheet with raw dataAr40err str or floatAr39 str or floatAr39err str or floatAr38 str or floatAr38err str or floatAr37 str or floatAr37err str or floatAr36 str or floatAr36err str or floatAr40bs str or floatAr40bserr str or floatAr39bs str or floatAr39bserr str or floatAr38bs str or floatAr38bserr str or floatAr37bs str or floatAr37bserr str or floatAr36bs str or floatAr36bserr str or floatAr40bk floatAr40bkerr floatAr39bk floatAr39bkerr floatAr38bk floatAr38bkerr floatAr37bk floatAr37bkerr floatAr36bk floatAr36bkerr floatAr40det strAr39det strAr38det strAr37det strAr36det str

3.4. Entry 27

Page 32: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

28 Chapter 3. Pychron User Guide

Page 33: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

CHAPTER 4

Pychron Develop Guide

4.1 Launching Pychron

4.1.1 Envisage

All pychron applications are based on Enthought’s envisage application framework. The envisage framework is usedto make pychron extensible and pluggable. For more information see http://docs.enthought.com/envisage/

4.1.2 Entry Point

The entry point for all pychron applications are scripts located in the launchers package. For example, to launchpyexperiment

cd pychronpython launchers/pyexperiment.py

This script calls imports and calls entry_point from the helpers module.

The entry_point function performs multiples tasks.

1. sets the GUI backend to Qt ETSConfig.toolkit = "qt4"

2. updates the pythonpath

29

Page 34: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

3. sets global variables and pychron filesystem paths

4. constructs missing directories in Pychrondata...

5. sets up logging

6. calls the launch function

The launch function takes one argument, a PychronApplication class. The launch function is located atpychron.envisage.pychron_run.

launch does the following

1. checks that necessary dependencies are installed

2. constructs the application object using app_factory

3. launches the application by calling the application’s run method

During Step. 2 the necessary plugins are constructed and added to the application. The plugins to use arespecified in the initialization.xml file. Parsing of the initialization.xml file is handled by anInitializationParser object.

4.1.3 Initialization

If Hardware plugins are included, such as FusionsCO2, the HardwarePlugin is added to the application plugins.When the HardwarePlugin starts, it uses an Initalizer object to bootstrap the necessary managers and devices.

4.2 Hardware

4.2.1 Make a new Device

You have two options for making a new device, CoreDevice and AbstractDevice. Use CoreDevice when you aredirectly interfacing with a physical device. Use AbstractDevice if you interface with the device via a secondary device.For example when you want to access a physical device with an analog output. Lets say you want to read the analogoutput from a power meter. First create a PowerMeter(AbstractDevice) class than use or create a ADC(CoreDevice)class. ADC(CoreDevice) class communicates with the Analog-to-Digital Converter device and the PowerMeter classconverts the raw signal from ADC(CoreDevice) into a power value i.e. Watts

Using the AbstractDevice allows you to interface with the physical power meter using a variety of ADC’s that typ-ically will have different communication protocols. Switching ADCs is a simple as switch the a single value in thePowerMeter(AbstractDevice)’s configuration file.

4.3 Database

4.3.1 Analysis Objects

IsotopeRecordView used for display in tables and fast creation and access.

IsotopeDatabaseManager.make_analyses(list_of_analyses) used to convert a IsotopeRecordView to a DBAnalysis.make_analyses retrieves the analysis from the db using a uuid. DBAnalysis is synced with the database record.

DBAnalysis is a subclass of ArArAge, Analysis. loading the isotopes from the db is the costliest process.

View of the analysis is handled by an AnalysisView. each DBAnalysis has an analysis_view object. the analysis ispassed into analysis_view for creation.

30 Chapter 4. Pychron Develop Guide

Page 35: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

AnalysisView is composed of multiple subview objects; MainView, HistoryView, ...

4.4 Automated Analysis

Automated analysis is handled by ExperimentExecutor, ExperimentQueue, and AutomatedRun.

4.4.1 ExperimentExecutor

ExperimentExcecutor is a top level object for coordinating the running of automated analyses.

4.4.2 ExperimentQueue

The ExperimentQueue contains a list of AutomatedRunSpec‘s and some global metadata.

4.4.3 AutomatedRunSpec

An AutomatedRunSpec is a simple container object the holds all of the AutomatedRun information, such aslabnumber, aliquot, pyscript names, etc.

4.4.4 AutomatedRun

The AutomatedRun contains the top level logic for executing an automated analysis. The AutomatedRun ob-ject is reused and the ExperimentExecutor has measuring_run and extracting_run objects. TwoAutomatedRun objects are required to handle overlap. AutomatedRun is executed using start().

Execution Sequence

1. Start button pressed, calls ExperimentExecutor.execute

2. pre execute check. ExperimentExecutor._pre_execute_check

3. New thread started. function= ExperimentExecutor._execute

4. Each queue in ExperimentExecutor.experiment_queues is run usingExperimentExecutor._execute_queues

5. pre run check

6. runspec retrieved from new_runs_generator

7. AutomatedRun updated with runspec data

8. if overlap new thread started else wait for run to complete return to step 5

9. ExperimentExecutor._do_run starts the AutomatedRun

(a) AutoamtedRun._start

(b) AutoamtedRun._extraction

(c) AutoamtedRun._measurement

(d) AutoamtedRun._post_measurement

4.4. Automated Analysis 31

Page 36: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

4.4.5 PyScripts

Pyscript Sequence

1. Extraction

2. Measurement

3. Post Equilibration

4. Post Measurement

Each script is executed sequentially, except for measurement and post_equilibration. Post Equilibration and Measure-ment will be running concurrently after equilibration period has finished. If a script fails the run is stopped.

Extraction

Preforms the extraction of gas. Has access to valves and extraction devices. When finished gas should be staged forequilibration with the mass spectrometer

Measurement

Performs the measurement of the gas. Has access to valves and mass spectrometer.

Post Equilibration

Pumps out the extraction line following equilibration and isolation of the mass spectrometer from the extraction line.Has access to the valves.

Post Measurement

Runs after measurement is finished. Typically only pumps out the mass spectroemter. Has access to the valves.

4.4.6 AutomatedRunPersister

AutoamtedRunPersister is object used to save an analysis to the database. UsesMassSpecDatabaseImporter to save to MassSpec schema. AutomatedRunPersister usesIsotopeAdapter to save data to Pychron schema

Multiple database backends are handled by the DataHub and its stores. DataHub.main_store provides access toIsotopeAdapter.

MassSpecDatabaseImporter

4.4.7 DataHub

4.5 Experiment Construction

32 Chapter 4. Pychron Develop Guide

Page 37: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

Class(name)

ExperimentEditorTask->Experimentor(manager)

Experimentor->ExperimentExecutor(executor)->ExperimentFactory->QueueFactory(queue_factory)

->AutomatedRunFactory(run_factory)->FactoryView(factory_view)

ExperimentEditor->ExperimentQueue(queue)->List(executed_runs)->List(automated_runs)

ExperimentFactoryPane -- QueueFactory, AutomatedRunFactory, FactoryView

4.5.1 New

4.5.2 Open

What Happens when Add Fired

_add_button_fired|

add_consumable

ConsumerMixin|

_add_run|

AutomatedRunFactory|

new_runs => runs, freq|

ExperimentQueue|

add_runs|

automated_runs.extend(runs)

4.6 Communications

4.6.1 Pychron/Pychron Communication

|====PyExperiment=====|| PychronLaserManager || | || communicator || | | |=====================================================|| v | ||=RemoteHardwareManager=| || ask ---------|--LAN-->|| RemoteHardwareServer | || ^-----------|--------|| ^ | | ||=====================| || | v | |

4.6. Communications 33

Page 38: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

|| handler | ||| ^ | | ||| | v | |=PyLaser/PyValve==|||| CommandRepeater ----|--IPC-->| CommandProcessor |||| ^---------------|--------| ^ | ||||=======================| | | v ||| | handler ||| | ^ | ||| | | v ||| | Manager ||| |==================||| ||=====================================================|

4.6.2 Pychron/Qtegra Communications

|====PyExperiment=====|| ArgusSpectrometer || | || microcontroller || | || communicator || | || v | |=======Qtegra=========|| ask ---------|--LAN-->| RemoteControlServer || ^-----------|--------| ^ | ||=====================| | | v |

| ParseAndExecute ||======================|

34 Chapter 4. Pychron Develop Guide

Page 39: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

CHAPTER 5

Pychron Course Material

5.1 Pychron Week Day 1. General Pychron/Experiment

Pychron Week Day 1. 10/26/14

The topics covered today will be general pychron information and new experiment features.

5.1.1 General

0. Launching

1. Preferences

2. View Docs

3. Submit Issue/Lab note a) github navigation b) gists

4. Window/Pane layouts

You can launch pychron in one of three ways

1. terminal

2. pycharm/IDE

3. icon

35

Page 40: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

Launch from the terminal

Launch from PyCharm Go to the top tool bar and hit the “Play” button, a green triangle.

Launch from Icon Double click the pychron icon an launch like any other application

Note: Not all computers have the application icons. Today we will be running from pycharm on the labcomputers

and the terminal on personal labtops.

Lets start by going over some general pychron topics. First we will examine pychron’s preferences. The preferencewindow will open as a drawer from the currently active window. When opened you will see multiple tabs. There istypically one tab per plugin. Within each tab there maybe subgroups and subtabs. Sometimes the preference windowis too small, so feel free to resize it. There are two important preference tabs to be aware of as an end-user, Databaseand Processing

5.1.2 Preferences

Database

The database tab allows you to configure which database you would like to connect to. A set of connection favoritesmay also be stored for easy switching between databases.

Attention: Lets go over setuping up a database connection together.

Processing

The processing tab contains misc preference values used during browsing and processing analyses.

Attention: set Recent Hours to some value, say 12.

5.1.3 Viewing Documentation

The pychron documentation is hosted online at pychron.readthedocs.org. You can access this course material in addi-tion to a user and developer guide, by navigating to pychron.readthedocs.org in your browser or from pychron’sHelp menu. This is the first place to look for information about pychron. It currently is poorly populated but willevolve and expand as time passes, feedback is received and new features are available.

Caution: The documentation is also specific to individual pychron versions, so if you are using an outdatedpychron make sure to navigate to the current documentation. The documentation follows the same numberingscheme as the application. For example documentation for pychron-v2.0.4 (the current beta release) is found atdocumentation version release-v2.0.4. pychron.readthedocs.org will bring you to the latest version of pychron (i.ethe develop branch).

Attention: Practice going to the documentation page. Practice navigating around the documentation. Use the nextand previous buttons, click on links, use the table of contents. Extra View different versions of the documentation

36 Chapter 5. Pychron Course Material

Page 41: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

5.1.4 Submitting Issues

Reporting bugs, requesting features, asking questions, etc... via GitHub’s issuetracking system is an efficient (andrecommended) method for communicating with the pychron developers. To submit an issue go to the help menu andselect Add Request/Report Bug. This will open a browser window and navigate to pychron’s github repository. If youare not automatically signed in, sign in with your account info or use the labs generic account nmgrluser, argon4039.

Important: I would prefer you each obtain a user account and use it when ever submitting issues because this allowsbetter tracking/notification and your issue is more likely to be handled promptly by a developer.

If you submit an issue and want to include code snippets (e.g. lines from pyscripts) or sections of the log file makesure to surround the text with three backticks (‘‘‘)

‘‘‘peak_hop(hops)

‘‘‘

Attention: Practice navigating around github. Go to NMGRL/Laboratory repo and practice submitting bugs.Include a code block and use preview. Add a label.

5.1.5 Experiment

1. End After/Skip

2. Time At

3. Open Last Experiment

4. Username/Email

5. Conditionals

1. system

2. queue

3. run

6. wait dialog a) extending the total time

7. Auto comment

8. Jump/Move To

9. Run blocks

End After is a convenient feature that allows you to stop the experiment after a selected analysis, instead of the currentanalysis using the “Stop at Completion” checkbox. The background will be dark gray when you set the experiment toend after the selected analysis.

Skip is a convenient feature that allows you to skip selected runs. This feature is rarely needed but nonetheless isavailable. Skipped runs will have a light blue background color.

Attention: You can toggle both End After and Skip by selecting a set of runs and using the checkboxes in theExperiment editor or by right clicking.

Time At. While an experiment is running you can selected a enqueued run and get the estimated time at which thisanalysis will run.

5.1. Pychron Week Day 1. General Pychron/Experiment 37

Page 42: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

Open Last Experiment The Open Last Experiment menu action opens the last experiment that was executed.

Username/Email When writing an experiment make sure to set the username. A list of users and associated emailsis stored in the database and available via the username drop-down widget. If your username is not in the drop-downsimply type in any name you wish. If you supply an email address pychron will email you when the experimentcompletes or is canceled.

Conditionals Conditionals are the pychron mechanism used to take action if a given condition evaluates to True, e.g.age>2.0. There are three levels of Conditionals 1) System 2) Queue 3) Run. System conditionals are applied to everyrun of every experiment. A typical system conditional is to cancel the experiment if the CDD is not on/enabled. QueueConditionals can be specified per experiment queue. Queue conditionals are applied to all runs in the experiment.Run conditionals are specified on a per run basis. There is also multiple types of conditionals. System and Queueconditionals fall into five categories 1) Actions, 2) Pre Run Terminations 3) Truncations 4) Terminations and 5) PostRun Terminations. Run conditionals have all the same categories except for Pre and Post Terminations.

Truncations conditionals truncate the current run (curtail in MassSpec parlance) and do an abbreviated baseline mea-surement. Terminations cancel the experiment immediately. Actions allow you to specify a action to take such as runa blank, etc. Custom actions can be programmed using pyscripts.

Attention: Practice adding a simple and a path truncation to some runs.

Wait Dialog You should be familiar with the basic concepts of the Wait Dialog. One feature that has not been discussedin depth is “Set Max Seconds.” This is used to extend the wait period beyond the original time. For example say thewait dialog starts at 30 seconds but you are doing something and want to delay 5 minutes. Enter 300 into “Set MaxSeconds” and the wait dialog will reset to 300 seconds.

Auto comment Comments are a useful feature for bookkeeping and keeping things straight during data reduction. Atypical comment for Monitor data is the irradiation level and hole e.g. A:9. Instead of have to type this manuallyfor each labnumber pychron provides an auto comment feature. Simply check the checkbox to auto fill the comment.There is also an option to generate your own comment templates. For example the template “irrad_level : irrad_holeSCLF” when applied to a given labnumber would yield “A:9 SCLF”.

Attention: Try using the auto comment feature.

Note: The template feature is not available for the pyexperiment version on the lab computers.

Jump/Move To Right click on a run and select move to or jump to... move to... will move the selected rows to thespecified location. jump to... will move the specified location into view.

Attention: Try the jump/move to features

Run Blocks provide a mechanism to save commonly used sequences of runs. To save a run block, select the set ofruns, right click and select “Make Run Block”. To add a run block select it from the drop down in the ExperimentEditor and hit the add button. You don’t have to save a run block if its a one off. You can repeat a selected set of runsby right clicked and selecting “Repeat Run Block”. This will repeat the selected runs, a “run block”, every X runs.“Repeat Run Block” will ask for the value of X.

Attention: Practice using the “Run Block” features

5.1.6 Script Editing

1. Context Editor

38 Chapter 5. Pychron Course Material

Page 43: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

2. Visual Script Editor

5.1.7 Labnumber Entry

1. Import irradiations from MassSpec

2. Manual Entry/Editing

5.1.8 Loading Entry

5.1.9 Spectrometer

1. rise rate

2. peak center

3. reset graph

5.1.10 Extraction Line

1. Procedures

2. Sample loading

5.1.11 Laser

1. Patterning

5.2 Pychron Week Day 2. Browsing

Review Day 1.

1. go to documentation

2. launch pychron

3. submit issues

4. submit notes

New feature

1. User/Session Login

2. Frequency templates

3. Email group

5.2. Pychron Week Day 2. Browsing 39

Page 44: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

5.2.1 Browser

1. By Project

2. By Irradiation

3. Graphical Filter

4. Subfilters

5. Filtering results

6. Manual Queries

Browsing is a convenient way of navigating the pychron database. It is similar to Mass Spec’s recall/run selectionwindow’s however pychron’s browser pane has the most commonly used query’s predefined and organized into asimple workflow.

Note: If the Browser is not open, go to View/Browser. If Browser is not present then the active window does notsupport the Browser and you must open a window that uses it e.g. Recall

The browser is laid out in a top down fashion and divided into multiple levels.

1. Mass Spectrometer

2. (a) Identifier

(b) Projects

(c) Irradiations

3. Analysis Types

4. Date

5. Results

1. Sample/Identifier (L#)

2. Analyses

Filters from the upper levels cascade down to the lower levels. For example selecting Mass Spectrometer=Obamalimits the Projects list to projects that contain analyses from Obama. The same filtering is applied to the Irradiationlist.

Note: Use the button to force a refresh using the current filtering criteria.

Browser By Identifier

Enter at least first three digits to browser by Identifier (aka L#). For example 210 will populate the Samples table withall Identifiers that start with 210.

Browse By Project

The Projects table lists all projects currently in the database.

Note: For faster/easier searching of the Project table use the Filter textbox to limit the displayed projects to projectsthat begin with the filtering string. e.g. filter=’abc’ projects=’abc’, ‘abcd’, ‘abcd12’ but not ‘1abc’

40 Chapter 5. Pychron Course Material

Page 45: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

Note: There are a few special projects listed in the Projects table. These are the RECENT ... entries, one for eachmass spectrometer in the database. Selecting a RECENT entry will select all samples that have been run within thelast X hours. To set X go to Preferences/Processing/Recent

Note: Selecting Projects filters the Irradiation list.

Browser By Irradiation

Use the Irradiations drop-downs to filter the available samples by irradiation and irradiation level.

Note: Selecting an Irradiation Level i.e. “A” filters the Project list.

Subfilters

The results from the upper level filters can be further refined with Analysis Type and Date Filters

Note: You do not have to start with the top level filters. For example you can start with a Date filter.

Results Tables

The results of the filters are displayed in two tables Samples and Analyses. The Samples table displays all the labnum-bers that match your query. Select a set of labnumbers and the Analyses table will display all the analyses for thoselabnumbers.

Both the Samples and Analyses tables are filterable. Use the dropdowns to select the attribute to filter on then enter avalue or select from available options.

Note: To configure what columns are displayed hit the button.

Warning: By default only labnumbers that have analyses are displayed. To show all labnumbers deselect “Exclude

Non-run” in the configure dialog (hit the button)

Warning: By default only 100 analyses are displayed in the Analyses table. Use the button to set the resultslimit.

Switching Focus

Pychron can switch focus between a filter dominant view and a results dominant view. To enable focus switching usethe check box at the top middle of the Browser pane. To switch to results view select a row in the Sample table. To

toggle between views use the button.

5.2.2 Recall

Recall an analysis by double clicking on it in the Analyses table. All tasks windows support opening a recall tab,however for simple viewing of analyses use Data>Recall or File>Recall (CMD+R). This will open the Recall task

5.2. Pychron Week Day 2. Browsing 41

Page 46: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

Find References

To find a set of reference analyses that are near the current analysis (currently hardcored as +/-4 hours), right click ananalysis in the Analyses table and select Find References

Configure

To configure the recall view use the Configure Recall ( ) action. This will open a dialog that allows you to set fontsizes and define what information is displayed.

Isotope Evolutions

Use Iso Fit to open graphs of the isotope evolutions in a separate tab. You can also right click on a set of isotoperows and pop up a standalone iso evo graph.

Edit Data

To manual edit isotope values, e.g. intensities, blanks use Edit Data ( ).

Diff Analyses

Use the Diff button to open the Analysis diff tab. This tab is used to systematically compare a Pychronanalysis to a Mass Spec analysis. This tab displays a Pychron-Diff-MassSpec table.

Note: By default only the differences between the analyses are displayed

Summary L# View

The Summary L# View provides three summary views

1. Stats

2. Ideogram

3. Spectrum

To display, select a row in the Samples table, then hit

Context View

Context View displays a table of values for analyses that bracket the selected analysis. Tabular and graphical viewsare displayed. To populate the graphical view select a set of analyses from the tabular view.

42 Chapter 5. Pychron Course Material

Page 47: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

Subviews

The recall window provides additional information in subviews. to switch to different views use the Controls pane.When a recall tab is selected Controls will display a list of subviews. The list depends on the type of analysis.

5.2.3 Plotting

To make figures open any open of the Figure Tasks, for example Data>Ideogram.

Figure Tasks introduce an new important pane, the “Unknowns” pane. this pane holds the list of analyses to plot.There are several ways to load analyses into the Unknowns pane.

Use the browser to select a set of analyses.

1. If you want to plot all analyses from a L# double click it and it will be added to the Unknowns Pane.

2. If you want to plot a set of L#’s select the set and right click and choose Plot Selected or PlotSelected(Grouped). Plot Selected(Grouped) will group the analyses by L#.

3. If you want to plot a set of analyses select them and

1. Use the append/replace button in the Unknowns Pane

2. Right click and use append or replace

3. drag the analyses into the unknowns pane

5.3 Pychron Week Day 3. Fitting IsoEvo, Blanks, ICFactor

Review

1. go over recall

2. Time View

3. Added columns to Analyses table (cleanup, duration, etc)

4. plot an ideogram

Overview

1. Fit Isotopes

2. Fit Blanks

3. Fit IC Factor

4. View/Diff Blanks History

5.3.1 Fit Isotopes

Attention: fit isotopes for identifier 61537

Note: 61537 is from the Crow project, Irradiation NM-255K

1. Open Iso Evolution Window (Data>Isotope Evolution)

2. User browser to locate 61537

5.3. Pychron Week Day 3. Fitting IsoEvo, Blanks, ICFactor 43

Page 48: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

Pychron Documentation, Release 2.0.4

3. Use the Controls Pane to select fits to save

Warning: If refitting a large number of samples >10 do not plot. TURN OFF SHOW COLUMN

4. Hit “Database Save” to save to the database.

5.3.2 Fit Blanks

Attention: fit blanks for identifier 61537

1. Open the Blanks Window (Data>Blanks)

Note: Instead of opening a new window you can which to different tasks within the same window. For example ifyou have a Recall Window open switch to the Blanks view using View>Activate Blanks

2. Add a set of unknowns to the Unknowns Pane. The References Pane will be automatically populated with theassociated reference analyses (e.g. Blanks)

3. Select the fits from Controls Pane

4. Hit “Database Save” to save to the database

5.3.3 Fit IC Factor

Attention: fit cdd ic factor for identifier 61537

1. Open the IC Factor Window

2. Add a set of unknowns to the Unknowns Pane

3. Select the reference type from the Controls Pane

4. Select the fits from Controls Pane

5. Hit “Database Save” to save to the database

5.3.4 Viewing Results/Diffing

44 Chapter 5. Pychron Course Material

Page 49: Pychron Documentation - Read the Docs...CHAPTER 3 Pychron User Guide 3.1Configuration 3.1.1Plugins Plugins are enabled/disabled in the setupfiles/initialization.xml file. List of

CHAPTER 6

Indices and tables

• genindex

• modindex

• search

45