-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PulsePattern component #5
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(full disclosure: not an expert with the pulse pattern stuff)
About the with_pulse_id
/with_train_id
thing, I can't think of anything particularly clean... Best thing I came up with is something like:
get_pulse_index(slice_by="idx") # or "pulse"
search_pulse_patterns(slice_by="train") # or "idx"
I originally thought of index
instead of idx
, but that would've felt a bit weird with a function already named get_pulse_index()
.
BTW, this won't be affected by https://redmine.xfel.eu/issues/151949, right? At least, as far as I can see it doesn't assume that there are 2700 entries in the bunch pattern table. |
f61931c
to
f682e5a
Compare
Yes, thanks to Python being a sane language we usually never assumed an actual length of the bunch pattern table in our code. It'll just work |
I have been thinking more about the naming, and concluded that using the generic word So thinking forward to what I want to add next, I would change names to:
|
I rebuild the tests now on top of It was really easy thanks to the existing framework in EXtra-data, and now I have much more confidence in the tests. Naturally there are components that may not need it. |
9c2d140
to
a8ce8dc
Compare
For reference, we decided to remove the picking-the-output-coords arguments for now and re-add them later in a better form. Also rebased now on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IANAE, but LGTM!
5cf7a87
to
769765c
Compare
769765c
to
1bc4975
Compare
Thanks for the review! |
Finally, this is the first version of the
PulseTiming
successor. I decided to split the original component into multiple pieces for a cleaner interface and add further functionality to each. The entire suite is currently planned to consist of:PulsePattern
to interact with FEL pulses (FEL-only or pump-probe experiments with aligned patterns)PulsePatternPPL
to specifically look for PPL pulses onlyPumpProbePattern
to combine FEL and PPL for non-aligned patternsOpticalLaserDelay
combining pulse pattern with BAM corrections and intentional motor-based delay to yield a single delay number for each pulseThe public interface implementation for
PulsePattern
andPulsePatternPPL
is actually identical and in a shared base class_PulsePattern
. The reason for this naming is that I wanted to call the version for FEL pulses onlyPulsePattern
, since it will cover the majority of use cases for both FEL-only and pump-probe experiments. This PR only contains the core functionality ofPulsePattern
for time reasons, the entire interface is planned to consist of:select_trains(trains)
get_pulse_counts(labelled=True)
: Number of pulses per train aspd.Series
orndarray
get_pulse_ids(labelled=True)
: Pulse IDs from bunch pattern table aspd.Series
orndarray
get_pulse_id_row()
: Fast version ofget_pulse_ids
reading only the first bunch pattern tableget_pulse_index(with_pulse_id=True)
:pd.MultiIndex
with trains and pulses (by ID or number) to label datasearch_pulse_patterns(with_train_id=True)
: Search contiguous regions of identical pulse pattern with train slices by ID or indextrains()
: Iterate over(train_id, pulse_ids)
label_pulse_data(data, train_ids=None, with_pulse_id=True)
: Attach multi-level index to existing data, say when you loaded pulse-resolved data viaKeyData
I'm not really happy with the
with_pulse_id
/with_train_id
flag on some of these function. I think I'd like it to be there so fossils like me can continue using unlabelledndarray
, but the name seems clunky. Any ideas?