... | @@ -3,5 +3,25 @@ On this page, you can explore how to convert existing data in different formats |
... | @@ -3,5 +3,25 @@ On this page, you can explore how to convert existing data in different formats |
|
## Xtc1 to Xtc2 Conversion
|
|
## Xtc1 to Xtc2 Conversion
|
|
Like how their name suggested, Xtc1 is the data format for running with lcls1 system (likewise for Xtc2). Both systems (1 and 2) have different environments and cannot be loaded at runtime together easily. You'll need two processes (one for each environment) running and communicating through zmq to share data.
|
|
Like how their name suggested, Xtc1 is the data format for running with lcls1 system (likewise for Xtc2). Both systems (1 and 2) have different environments and cannot be loaded at runtime together easily. You'll need two processes (one for each environment) running and communicating through zmq to share data.
|
|
|
|
|
|
We use a simple zmq push and pull model for this work. The [zmq_push.py](https://github.com/monarin/xtc1to2/blob/master/examples/zmq_push.py) opens psana1-style DataSource and starts getting events from a run. Any data that need to be converted to Xtc2 format will be sent to [zmq_pull.py](https://github.com/monarin/xtc1to2/blob/master/examples/zmq_pull.py). The pull script makes use of DgramPy library in Psana2 to create Xtc2-style transitions (Configures, BeginRun, etc) and add retrieved data from the push script as an L1Accept event.
|
|
We use a simple zmq push and pull model for this work. The [zmq_push.py](https://github.com/monarin/xtc1to2/blob/master/examples/zmq_push.py) opens psana1-style DataSource and starts getting events from a run. Any data that need to be converted to Xtc2 format will be sent to [zmq_pull.py](https://github.com/monarin/xtc1to2/blob/master/examples/zmq_pull.py). The pull script makes use of DgramPy library in Psana2 to create Xtc2-style transitions (Configures, BeginRun, etc) and add retrieved data from the push script as an L1Accept event.
|
|
From the def |
|
|
|
\ No newline at end of file |
|
Note that lcls1 is currently (only) available on psana computing cluster. The example below assumes that you have an access to psana machines.
|
|
|
|
|
|
|
|
- Running zmq push
|
|
|
|
|
|
|
|
You'll need psana2 environment, which is part for spinifel. See spinifel guideline on how to setup the environment. In addition, you'll need xtc1to2 library, which can be obtained and setup by:
|
|
|
|
```bash
|
|
|
|
source /reg/g/psdm/etc/psconda.sh
|
|
|
|
# This is the first known good py3 version. You can.
|
|
|
|
# also use the most current -py3 version offered.
|
|
|
|
conda activate ana-4.0.38-py3
|
|
|
|
git clone git@github.com:monarin/xtc1to2.git $HOME/xtc1to2
|
|
|
|
export PYTHONPATH=$HOME/xtc1to2:$PYTHONPATH
|
|
|
|
# You'll need to change at least three things in zmq_push.py
|
|
|
|
# 1. Experiment code
|
|
|
|
# 2. Run number
|
|
|
|
# 3. Path to calibration geometry file
|
|
|
|
# You may need to change more things. Some knowledge about
|
|
|
|
# the experiment and what you'd like converted is needed here...
|
|
|
|
python zmq_push.py
|
|
|
|
``` |
|
|
|
\ No newline at end of file |