Skip to content

Mec producer cleanup, XTCAV & droplet additions#275

Open
silkenelson wants to merge 5 commits intomasterfrom
mec_cleanup
Open

Mec producer cleanup, XTCAV & droplet additions#275
silkenelson wants to merge 5 commits intomasterfrom
mec_cleanup

Conversation

@silkenelson
Copy link
Copy Markdown
Collaborator

clean up of MEC producer
add XTCAV duration calculation
add fill fraction of event to droplet
add sparsified saving of pixels for 2-threshold photon to droplet

@silkenelson silkenelson requested a review from vespos March 31, 2026 18:31
def __init__(self, det, env, run, **kwargs):
super(CameraObject, self).__init__(det, env, run, **kwargs)
self._common_mode_list = [0, -1, 30] # none, raw, calib
self._common_mode_list = [0, -1, 30, 40] # none, raw, calib
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add some doc on what these are, in particular the new 40?
I generally don't like these seemingly random number for this, but I guess this is historical at this point...

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

40 means you will provide the cmpars for det.calib. Originally the single numbers were there to combined hand-written modes with modes that use the standard code with particular cmpars. Not sure what else should have been done here (or maybe also in the future????)

return f"{directory}{background}"


def duration(x, interval):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a little documentation on what this does exactly. It is not very clear what x is expected to be

dur = np.cumsum(x)
dur = dur / dur[-1]
idxlow = abs(np.argmin(abs(dur - interval[0])))
idxhigh = abs(np.argmin(abs(dur - interval[1])))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is "abs" needed? argmin will always return a positive number

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I think this is user code that I just shoved in here.

try:
self.statusMask = self.det.mask(self.run, status=True)
self.mask = self.det.mask(
self.statusMask = self.det.mask_v2(self.run, status=True)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you tell more about the new mask format in the PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants