Skip to content
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

Add corrections_run_id for mini analysis #1339

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions straxen/mini_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def wrapped_f(context: strax.Context, run_id: str, **kwargs):
known_kwargs = (
"time_range seconds_range time_within time_selection "
"ignore_time_warning "
"selection_str t_reference to_pe config"
"selection_str t_reference to_pe config "
"corrections_run_id"
Copy link
Collaborator

@dachengx dachengx Mar 2, 2024

Choose a reason for hiding this comment

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

You can add another argument to straxen's mini_analysis function so that it can add additional known_kwargs to the default ones.

).split()
for k in kwargs:
if k not in known_kwargs and k not in parameters:
Expand All @@ -66,7 +67,12 @@ def wrapped_f(context: strax.Context, run_id: str, **kwargs):
if "to_pe" in parameters and "to_pe" not in kwargs:
to_pe = context.config["gain_model"]
if isinstance(to_pe, str):
to_pe = straxen.URLConfig.evaluate_dry(to_pe, run_id=run_id)
if "corrections_run_id" in kwargs:
Copy link
Collaborator

@dachengx dachengx Mar 2, 2024

Choose a reason for hiding this comment

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

This part should be a stand-alone function called process_to_pe or other proper names. For straxen, process_to_pe can be what it was. But for fuse, you can process corrections_run_id in process_to_pe.

to_pe = straxen.URLConfig.evaluate_dry(
to_pe, run_id=kwargs["corrections_run_id"]
)
else:
to_pe = straxen.URLConfig.evaluate_dry(to_pe, run_id=run_id)
kwargs["to_pe"] = to_pe

# Prepare selection arguments
Expand Down