Page History
Info |
---|
Draft, in work. |
Table of Contents |
---|
Include Page | ||||
---|---|---|---|---|
|
Once you've cloned the LCLS2 PSDM repository and built the executables therein, you can generate sample Xtc data files and use iPython and psana to inspect the structures therein.
Setting Up
Switch to PSDM conda Environment
Return to the PSDM conda environment, if necessary.
Code Block | ||
---|---|---|
| ||
# At the top of the PSDM lcls2 git repo user@host> bash user@host-BASH> source ./setup_env.sh (ps-0.1.2) [user@host-BASH]$ |
Generate a Sample Data File
Generate a file of simple Xtc-formatted dummy data.
Code Block | ||
---|---|---|
| ||
# Usage: xtcwriter [-f <filename> -t -h] (ps-0.1.2) [user@host-BASH]$ xtcwriter -f test.xtc |
Create a Basic psana Data Import Script
We need a simple script, let's call it quick.py, to execute in the iPython session.
Code Block | ||||
---|---|---|---|---|
| ||||
from psana import DataSource ds = DataSource('test.xtc') for evt in ds.events(): pass |
Inspecting Xtc Data in iPython
Start iPython and Run quick.py to Import sample data.
Start iPython.
Code Block (ps-0.1.2) [user@host-BASH]$ ipython Python 3.6.6 |Anaconda, Inc.| (default, Jun 28 2018, 17:14:51) Type 'copyright', 'credits' or 'license' for more information IPython 6.5.0 -- An enhanced Interactive Python. Type '?' for help. In [1]:
Overview
Content Tools