You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Content

Setup environment

ssh psana

cd <your-directory>

sit_setup

Save image in TIFF file

Configuration file

There are two versions of image saving modules ImgAlgos.ImgSaveInFile (C++) and  pyimgalgos.image_save_in_file (Python), which create slightly different TIFF files.

Configuration file for Python module pyimgalgos.image_save_in_file

Content of the file psana-mecb3114-r0017-tiff.cfg

[psana]
files = exp=mecb3114:run=17
#events = 5
#skip-events = 0

modules = ImgAlgos.AndorImageProducer \
          pyimgalgos.image_save_in_file

[ImgAlgos.AndorImageProducer]
source  = DetInfo(MecTargetChamber.0:Andor.1)
key_in  = 
key_out = andor_img
outtype = asdata
print_bits = 1

[pyimgalgos.image_save_in_file]
source          = DetInfo(MecTargetChamber.0:Andor.1)
key_in          = andor_img
#ofname          = andor.1.txt
ofname          = andor.1.tiff
print_bits      = 5

 

 

Configuration file for C++ module ImgAlgos.ImgSaveInFile

Module ImgAlgos.ImgSaveInFile can be added to the configuration file as:

modules = ImgAlgos.AndorImageProducer \
          ...
          ImgAlgos.ImgSaveInFile
...

[ImgAlgos.ImgSaveInFile]
source          = DetInfo(MecTargetChamber.0:Andor.1)
key             = andor_img
saveAll         = yes
#ftype           = tiff
ftype           = txt
fname           = andor
print_bits      = 3

 

Get TIFF files from data

Run psana with configuration file and optional experiment/run number structure exp=mecb3114:run=17 by the command:

    

psana -c psana-mecb3114-r0017-tiff.cfg  exp=mecb3114:run=17

Tiff files will be produced with common prefix name andor.1 (which may contain path to the directory as well):

andor.1-mecb3114-r0017-ev000001.tiff
andor.1-mecb3114-r0017-ev000002.tiff
andor.1-mecb3114-r0017-ev000003.tiff

Andor calibrated image

Calibration constants

Dark run calibration can be done with procedure calibman (since ana-0.13.18). Files can be deployed in expected place, for example

/reg/d/psdm/SXR/sxrg3715/calib/Andor::CalibV1/SxrEndstation.0:Andor.2/pedestals/0-end.data

for types pedestals pixel_rms  pixel_status.

type common_mode can be copied with parameters for mode 2 (see : Common mode correction algorithms ), for example

2 20 20 512 0 0 0 0 0 0 0 0 0 0 0 0

Get calibrated image

In psana Andor image can be retrieved from raw data to ndarray using module ImgAlgos.AndorImageProducer. Then it can be calibrated by the module

ImgAlgos.NDArrCalib and further processed in python or saved as in the example.

Example of the configuration file psana-sxrg3715-r0046-andor-image.cfg :

[psana]
# Default calibration directory:
# calib-dir = /reg/d/psdm/sxr/sxrg3715/calib
calib-dir = /reg/neh/home1/dubrovin/LCLS/PSANA-V01/test-sxrg3715/calib

files = exp=sxrg3715:run=46
#events = 5
#skip-events = 0

modules = ImgAlgos.AndorImageProducer:a2 \
          ImgAlgos.NDArrCalib:a2 \
          ImgAlgos.ImgSaveInFile:a2

[ImgAlgos.AndorImageProducer:a2]
source  = DetInfo(SxrEndstation.0:Andor.2)
key_in  = 
key_out = andor_img_raw
#outtype = asdata
outtype = float
print_bits = 9

[ImgAlgos.NDArrCalib:a2]
source  = DetInfo(SxrEndstation.0:Andor.2)
key_in  = andor_img_raw
key_out = andor_img_clb
outtype = float
do_peds = yes
do_cmod = yes
print_bits = 15

[ImgAlgos.ImgSaveInFile:a2]
source          = DetInfo(SxrEndstation.0:Andor.2)
key             = andor_img_clb
saveAll         = yes
#ftype           = tiff
ftype           = txt
fname           = andor-2-cm2
print_bits      = 3

which can be executed by the command:

psana -c psana-sxrg3715-r0046-andor-image.cfg

Image examples

exp=xrg3715:run=46, SxrEndstation.0:Andor.2

Raw image full-size and zoomed

Image with subtracted pedestals

evaluated using the same run 46

Image with subtracted common mode

2 20 20 512 0 0 0 0 0 0 0 0 0 0 0 0


References

 

 

 

  • No labels