@ggggggggg says LCLS-II has inverted pulses and relies on invert_data to work.
Old way: when data were loaded from disk into a cache, one "segment" at a time, it was easy to sign-flip any data if invert_data was true. So we did that.
New way: we memmap the entire LJH binary area, and there are no segments. We read data to memory only on demand and have no access to sign-flip it. How can we invert data these days?
Probably need to check that each channel's MicrocalDataSet is constructed with a invert_data=False default, instead of being created only when needed.
The summarize_data method needs to use the invert_data flag for certain of its computations. Some numbers simply need to get inverted after being computed as normal (such as p_pulse_average), but others need to be computed with inversion in mind (e.g., p_postpeak_deriv). This is the main part of the work.
The plot_traces could use that flag, to make plots that look more familiar.
Check whether the complicated ATSFilter computation assumes pulse signs.
Any other places?
Add test. Maybe make a temporary LJH file that's inverted copy of one in the repo, and check that summary quantities come out the same?
@ggggggggg says LCLS-II has inverted pulses and relies on
invert_data
to work.Old way: when data were loaded from disk into a cache, one "segment" at a time, it was easy to sign-flip any data if
invert_data
was true. So we did that.New way: we memmap the entire LJH binary area, and there are no segments. We read data to memory only on demand and have no access to sign-flip it. How can we invert data these days?
MicrocalDataSet
is constructed with ainvert_data=False
default, instead of being created only when needed.summarize_data
method needs to use theinvert_data
flag for certain of its computations. Some numbers simply need to get inverted after being computed as normal (such asp_pulse_average
), but others need to be computed with inversion in mind (e.g.,p_postpeak_deriv
). This is the main part of the work.plot_traces
could use that flag, to make plots that look more familiar.ATSFilter
computation assumes pulse signs.