Skip to content

Update csv data loader, introduce dedicated csv hypersurfaces service, clean up hypersurfaces docs - #855

Merged
thehrh merged 16 commits into
icecube:masterfrom
JanWeldert:csv_reader
Sep 4, 2025
Merged

thehrh merged 16 commits into
icecube:masterfrom
JanWeldert:csv_reader

Conversation

@JanWeldert

Copy link
Copy Markdown
Collaborator

In order to make pisa more flexible about its inputs we should update the csv reader. This will be especially useful for data releases. I started by making it possible to load multiple csv files at once and using a dict for the keys to lead from the file rather than hard coding it.

@JanWeldert
JanWeldert requested a review from thehrh April 16, 2025 14:16
@@ -0,0 +1,274 @@
"""
PISA pi stage to apply hypersurface fits from discrete systematics parameterizations

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.

PISA pi.
It would be good if some remarks could be added on why there is a separate service for reading csv files when there is already a hypersurfaces service (and/or how these differ). There is a currently fairly comprehensive, though in the case of hypersurfaces probably outdated, readme which one could consider for this type of documentation.

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.

The the current hypersurfaces service can only handle non-interpolated HS. We could merge this csv-hypersurfaces service with the current one, but the result would be a pretty long and complex stage. At least for now, separation (like we do it for the data loader stages) is the simpler option. Documentation will be good though.

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.

I think this motivation (together with some statement on if and how the mathematical approach deviates from the regular hypersurface code/service) would be good to have in the code base itself, perhaps in the csv_hypersurfaces.py module docstring.

@@ -0,0 +1,4001 @@
intercept,intercept_sigma,dom_eff,dom_eff_sigma,hole_ice_p0,hole_ice_p0_sigma,hole_ice_p1,hole_ice_p1_sigma,bulk_ice_abs,bulk_ice_abs_sigma,bulk_ice_scatter,bulk_ice_scatter_sigma,dm31,pid,reco_coszen,reco_energy

@thehrh thehrh May 28, 2025 •

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.

What's in here, toy/dummy values? Suggest giving it a more descriptive filename (see the hdf5 events file in the same directory) or adding a comment (shouldn't be a problem when parsed by pandas, https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html).

@JanWeldert
JanWeldert marked this pull request as ready for review July 11, 2025 15:04
Comment thread pisa/stages/discr_sys/csv_hypersurfaces.py Outdated
Comment thread pisa/stages/discr_sys/csv_hypersurfaces.py Outdated
Comment thread pisa/stages/discr_sys/csv_hypersurfaces.py Outdated
Comment thread pisa/stages/discr_sys/csv_hypersurfaces.py Outdated
Comment thread pisa/stages/discr_sys/csv_hypersurfaces.py Outdated
Comment thread pisa/stages/discr_sys/csv_hypersurfaces.py Outdated
Comment thread pisa/stages/discr_sys/csv_hypersurfaces.py Outdated
Comment thread pisa/stages/discr_sys/csv_hypersurfaces.py Outdated
Comment thread pisa/stages/discr_sys/csv_hypersurfaces.py
Comment thread pisa/stages/discr_sys/csv_hypersurfaces.py Outdated
nominal_systematics : dict
Systematics and their nominal values

inter_param : str

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.

create issue (future task: multiple)

Comment thread pisa/stages/discr_sys/csv_hypersurfaces.py Outdated
Comment thread pisa/stages/discr_sys/csv_hypersurfaces.py
Comment thread pisa/stages/discr_sys/csv_hypersurfaces.py Outdated
Comment thread pisa/stages/discr_sys/csv_hypersurfaces.py Outdated
Comment thread pisa/stages/discr_sys/csv_hypersurfaces.py
Comment thread pisa/stages/discr_sys/csv_hypersurfaces.py Outdated
Comment thread pisa/stages/discr_sys/csv_hypersurfaces.py Outdated
Comment thread pisa/stages/discr_sys/csv_hypersurfaces.py Outdated
Comment thread pisa/stages/discr_sys/csv_hypersurfaces.py Outdated
Comment thread pisa/stages/discr_sys/csv_hypersurfaces.py Outdated
Comment thread pisa/stages/discr_sys/csv_hypersurfaces.py Outdated
Comment thread pisa/stages/discr_sys/csv_hypersurfaces.py Outdated
Comment thread pisa/stages/discr_sys/csv_hypersurfaces.py Outdated
Comment thread pisa/stages/discr_sys/csv_hypersurfaces.py Outdated
Comment thread pisa/stages/data/csv_loader.py Outdated
Comment thread pisa/stages/data/csv_loader.py Outdated
Comment thread pisa/stages/data/csv_loader.py Outdated
Comment thread pisa/stages/data/csv_loader.py Outdated
Comment thread pisa/stages/data/csv_loader.py Outdated
Comment thread pisa/stages/data/csv_loader.py Outdated
Comment thread pisa/stages/data/csv_loader.py Outdated
Comment thread pisa/stages/data/csv_loader.py Outdated
@thehrh

thehrh commented Aug 20, 2025

Copy link
Copy Markdown
Collaborator

Is there a relation between this PR and _load_hypersurfaces_data_release in utils/hypersurface/hypersurface.py?

@JanWeldert

Copy link
Copy Markdown
Collaborator Author

That is for the old (GRECO) data release. It can only handle non-interpolated HS.

@thehrh thehrh changed the title Modernizing the csv reader Update csv data loader, introduce dedicated csv hypersurfaces service, clean up hypersurfaces docs Aug 22, 2025
@thehrh
thehrh merged commit 6a4df47 into icecube:master Sep 4, 2025
2 checks passed
@JanWeldert
JanWeldert deleted the csv_reader branch September 11, 2025 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants