Difference between revisions of "Data viewer"

From cctbx_xfel
Jump to: navigation, search
(Created page with "The command "cci.pyana'' can be configured to display the diffraction images streamed from an XTC file. == Configuring the viewer == Add to the mod_view section of your pyana...")
 
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
The command "cci.pyana'' can be configured to display the diffraction images streamed from an XTC file.
+
The command "cxi.pyana" can be configured to display the diffraction images streamed from an XTC file.
  
 
== Configuring the viewer ==
 
== Configuring the viewer ==
Line 10: Line 10:
 
[my_ana_pkg.mod_view]
 
[my_ana_pkg.mod_view]
 
address    = CxiDs1-0|Cspad-0
 
address    = CxiDs1-0|Cspad-0
calib_dir  = /reg/neh/home3/nksauter/phenix/src/cctbx_project/xfel/metrology/CSPad/run4/CxiDs1.0_Cspad.0
+
calib_dir  = /reg/g/cctbx/sources/cctbx_project/xfel/metrology/CSPad/run4/CxiDs1.0_Cspad.0
 
dark_path      = /reg/d/psdm/cxi/cxib9713/res/darks/r0001-Ds1-avg.pickle
 
dark_path      = /reg/d/psdm/cxi/cxib9713/res/darks/r0001-Ds1-avg.pickle
 
dark_stddev    = /reg/d/psdm/cxi/cxib9713/res/darks/r0001-Ds1-stddev.pickle
 
dark_stddev    = /reg/d/psdm/cxi/cxib9713/res/darks/r0001-Ds1-stddev.pickle
Line 20: Line 20:
 
</pre>
 
</pre>
  
These three parameters turn on and configure database-backed logging of hitfinding results:
+
The command is run as follows:
* trial_id: we find it useful to organize processing in numbered trials. Whenever we go back and change the parameters of our processing, adjusting the target cell or spotfinder parameters for example, we re-process under a different trial ID. When you submit your processing job using cxi.lsf, you can specify the trial ID on the command line with –t.  What you specify will overwrite what is listed here in the cfg fileIf you use bsub, then what is in the cfg file is what’s used.  Note, it isn’t a good idea to re-use the trial_id when re-prossing the data if database logging is being used, simply because the hits will be logged twice which will clutter future analysis.  Finally, if you want to see which trials you have used for which runs, execute '''cxi.list_db_metadata'''
+
<pre>
* db_logging: Switch for turning on and off logging
+
cxi.pyana -c myconfig_file.cfg /path/to/xtc/streams/e346-r0007-s0[0-4]-c00.xtc
* sql_buffer_size: a queue size for regulating how often to add data to the databaseIn our experience, 5 has been just fine.
+
</pre>
 
+
The command will marshal together all events from streams 0-4 in run 7 of experiment 346Those events with the CXI imaging detector with the given <code>address</code> will be sent to the <code>mod_view</code> module that displays images in a GUIDark subtraction is done with the files <code>dark_path</code> and <code>dark_stddev</code> that are described on the [[Preparatory steps]] wiki page.
== Monitoring hit finding in real time ==
+
Important parameters are:
After submitting a job with db logging enabled, use cxi.monitor_trials <trial number> to display the hit rate during processing.  Other command line options and their defaults are listed below, including the ability to display multiple runs at once.  The default is to display the 5 latest runs by timestamp.
+
* <code>n_update</code>: GUI will only display every Nth event (every 120th image, in this example).
* t_wait = 8000: amount of time in ms between queries to the database
+
* <code>n_collate</code>: GUI will display an average image over the last N events (last 60 events, in this example).
* hit_cutoff = 16: the number of bragg spots before a frame is considered a hit.  If this is different than what’s in your config file, then the monitor will be using a different cutoff to display which frames are hits.
+
'''Critical step:'''
* average_window = 1000: how many frames are in the sliding averaging window shown in the hit % graph
+
'''Please press the Run/Pause (green) button in the GUI to make the action start.'''
* n_points = 1000: how many total points to display on the graph.  Set it to 0 to display all the data points (can be computationally intensive).
+
* display_time = 1800: number of seconds of experiment time to display. Displays this number of seconds unless that would add up to more than 5 runs.
+
* run_num = display only this run
+
* run_min = start at this run
+
* run_max = end with this run
+

Latest revision as of 09:16, 19 October 2016

The command "cxi.pyana" can be configured to display the diffraction images streamed from an XTC file.

Configuring the viewer

Add to the mod_view section of your pyana config file as follows:

[pyana]
modules = my_ana_pkg.mod_view
num-cpu = 1

[my_ana_pkg.mod_view]
address     = CxiDs1-0|Cspad-0
calib_dir   = /reg/g/cctbx/sources/cctbx_project/xfel/metrology/CSPad/run4/CxiDs1.0_Cspad.0
dark_path       = /reg/d/psdm/cxi/cxib9713/res/darks/r0001-Ds1-avg.pickle
dark_stddev     = /reg/d/psdm/cxi/cxib9713/res/darks/r0001-Ds1-stddev.pickle
detz_offset = 555

# Suitable values depend on the repetition rate of the instrument.
n_update    = 120
n_collate   = 60

The command is run as follows:

cxi.pyana -c myconfig_file.cfg /path/to/xtc/streams/e346-r0007-s0[0-4]-c00.xtc

The command will marshal together all events from streams 0-4 in run 7 of experiment 346. Those events with the CXI imaging detector with the given address will be sent to the mod_view module that displays images in a GUI. Dark subtraction is done with the files dark_path and dark_stddev that are described on the Preparatory steps wiki page. Important parameters are:

  • n_update: GUI will only display every Nth event (every 120th image, in this example).
  • n_collate: GUI will display an average image over the last N events (last 60 events, in this example).

Critical step: Please press the Run/Pause (green) button in the GUI to make the action start.