Skip to content
8 changes: 4 additions & 4 deletions docs/listing_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
# Image attributes are also stored in this series:
w_x2 = ser['side','absorption','OD','Gaussian_XW']

# If we want actual measurement data, we'll have to instantiate a Run object:
run = Run(path)
# If we want actual measurement data, we'll have to instantiate a Shot object:
shot = Shot(path)

# Obtaining a trace:
t, mot_fluorecence = run.get_trace('mot fluorecence')
t, mot_fluorecence = shot.get_trace('mot fluorecence')

# Now we might do some analysis on this data. Say we've written a
# linear fit function (or we're calling some other libaries linear
Expand All @@ -43,4 +43,4 @@

# We might wish to save this result so that we can compare it across
# shots in a multishot analysis:
run.save_result('mot loadrate', c)
shot.save_result('mot loadrate', c)
2 changes: 1 addition & 1 deletion docs/source/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ API Reference
lyse.dataframe_utilities
lyse.figure_manager
lyse.tempfile2clipboard
lyse.__main__
lyse.__main__
12 changes: 6 additions & 6 deletions docs/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ An analysis on a single shot
# Image attributes are also stored in this series:
w_x2 = ser['side','absorption','OD','Gaussian_XW']

# If we want actual measurement data, we'll have to instantiate a Run object:
run = Run(path)
# If we want actual measurement data, we'll have to instantiate a Shot object:
shot = Shot(path)

# Obtaining a trace:
t, mot_fluorecence = run.get_trace('mot fluorecence')
t, mot_fluorecence = shot.get_trace('mot fluorecence')

# Now we might do some analysis on this data. Say we've written a
# linear fit function (or we're calling some other libaries linear
Expand All @@ -51,7 +51,7 @@ An analysis on a single shot

# We might wish to save this result so that we can compare it across
# shots in a multishot analysis:
run.save_result('mot loadrate', c)
shot.save_result('mot loadrate', c)

Single shot analysis with global file opening
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -60,11 +60,11 @@ Single shot analysis with global file opening

from lyse import *

# Instantiate Run object and open
# Instantiate Shot object and open
# Globally opening the shot keeps the h5 file open
# This prevents excessive opening and closing of the file
# which can slow down the analysis
with Run(path).open('r+') as shot:
with Shot(path).open('r+') as shot:

# Obtaining a trace:
t, mot_fluorecence = shot.get_trace('mot fluorecence')
Expand Down
2 changes: 1 addition & 1 deletion docs/source/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Introduction

**Lyse** is a data analysis system which gets *your code* running on experimental data as it is acquired. It is fundamenally based around the ideas of experimental *shots* and analysis *routines*. A shot is one trial of an experiment, and a routine is a ``Python`` script, written by you, that does something with the measurement data from one or more shots.

Analysis routines can be either *single-shot* or *multi-shot*. This determines what data and functions are available to your code when it runs. A single-shot routine has access to the data from only one shot, and functions available for saving results only to the hdf5 file for that shot. A a multi-shot routine has access to the entire dataset from all the runs that are currently loaded into **lyse**, and has functions available for saving results to an hdf5 file which does not belong to any of the shots---it's a file that exists only to save the "meta results".
Analysis routines can be either *single-shot* or *multi-shot*. This determines what data and functions are available to your code when it runs. A single-shot routine has access to the data from only one shot, and functions available for saving results only to the hdf5 file for that shot. A a multi-shot routine has access to the entire dataset from all the shots that are currently loaded into **lyse**, and has functions available for saving results to an hdf5 file which does not belong to any of the shots---it's a file that exists only to save the "meta results".

Actually things are far less magical than that. The only enforced difference between a single shot routine and a multi-shot routine is a single variable provided to your code when **lyse** runs it. Your code runs in a perfectly clean ``Python`` environment with this one exception: a variable in the global namespace called ``path``, which is a path to an hdf5 file. If you have told **lyse** that your routine is a singleshot one, then this path will point to the hdf5 file for the current shot being analysed. On the other hand, if you've told **lyse** that your routine is a multishot one, then it will be the path to an h5 file that has been selected in **lyse** for saving results to.

Expand Down
Loading