dermen / xtcav

example script for processing xtcav data at LCLS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Description of data files

Run number is in the file name.

>>> h5 = h5py.File("run175_xtcav.h5", "r")
>>> h5.keys()

[u'ebeam',
 u'event_time',
 u'evr',
 u'fiducials',
 u'first_pulse_maxpos',
 u'first_pulse_power',
 u'first_pulse_time',
 u'gas_detector',
 u'is_separated',
 u'phase_cav',
 u'power_trace',
 u'pulse_separation',
 u'pulse_t',
 u'second_pulse_maxpos',
 u'second_pulse_power',
 u'second_pulse_time',
 u'smoothed_power_trace']

'is_separated'

1 means the XTCAV data has two peaks. 0 means there is only one primary peak found. -1 means something funky goin on (no maxima, or missing event data)

'ebeam'

event X-ray energy estimate provided by LCLS

'event_time'

time of the XTC event, provided by LCLS. If you want to use this value to sync up to other data (e.g. Cheetah hits with seconds and nanoseconds or CrystFEL crystals) , you can do something like

In [2]: import h5py

In [3]: import psana

In [4]: f = h5py.File("run175_xtcav.h5", "r")

In [5]: et = f["event_time"][0]

In [8]: fid = f['fiducials'][0]

In [11]: psana_et =psana.EventTime(et, fid)

In [12]: psana_et.nanoseconds()
Out[12]: 246439687

In [13]: psana_et.seconds()
Out[13]: 1537070201

also see this.

'evr'

event code information (see log book)

'fiducials',

event fiducial for use with event time

'first_pulse_maxpos'

position of the peak power in the first pulse (pixel units)

'first_pulse_power'

peak power of the first pulse

'first_pulse_time'

position of the peak power in the first pulse (femtosecond units)

'gas_detector'

proportional to total intensity I believe

'phase_cav'

cant remember

'power_trace',

Y-axis of XTCAV trace

'pulse_separation'

separation between two main pulses in femtoseconds

'pulse_t'

x-axis of the XTCAV trace (femtoseconds I think). Probably the same for all events in a run, but not necessarilly for all runs

'second_pulse_maxpos'

same as above but the rightmost peak

'second_pulse_power'

same as above but the rightmost peak

'second_pulse_time'

same as above, but rightmost peak

'smoothed_power_trace'

moving average of the power trace

Notes

if the algorithm only found 1 peak in the events xtcav trace, it's information (peak height and arrival time) will be in the first_pulse* dataset, while second_pulse* dataset will have -1 values for that event.

You can start by fitting Gaussians to the curves: X=pulse_t, Y=power_trace

About

example script for processing xtcav data at LCLS


Languages

Language:Python 100.0%