Repository navigation
Conversation
Adds CONEX-format output of the optical showers' longitudinal profiles (resolves #129), enabled by `nuspacesim run -c` or simulation.conex_output. * conex/format.py codifies the CONEX Header/Shower trees as fixed-shape NumPy structured dtypes. Every shower shares the fixed EAS node grid, so profile branches are fixed X[n_nodes] leaves -- no variable-length arrays. * conex/root_file.py writes those trees directly; no uproot/awkward dependency. Verified with ROOT 6.40 and uproot. * conex/writer.py maps profiles onto the format (Gaisser-Hillas fit, depths from ground, dE/dX) and provides ConexWriter. * compute() takes an on_shower_profile callable, forwarded through EAS and CphotAng as on_profile; it receives a fixed-shape ShowerProfile without changing any return value (serial and dask alike). No conditional branching in compute.py. lgE uses showerEnergy (the energy the profile was built with); geometry uses the beta the node grid was built with (clamped to >= 1 deg); showers whose maximum lies outside the visible window are skipped. Co-Authored-By: jorge <jcaracavalente@mines.edu> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Areustle
previously requested changes
Oct 27, 2026
Areustle
left a comment
Contributor
There was a problem hiding this comment.
I have updated this per my own concerns. It no longer uses 3rd party libraries. Please test it out and let me know how you like it or if there are issues.
Comment on lines
+244
to
+273
| if config.simulation.conex_output: | ||
| numPEs, costhetaChEff, RN, z_nodes, X_to_node = eas( | ||
| beta_tr, | ||
| altDec, | ||
| showerEnergy, | ||
| init_lat, | ||
| init_long, | ||
| cloudf=cloud, | ||
| conex=True, | ||
| client=optical_cluster.client() if use_cluster else None, | ||
| serial=not use_cluster, | ||
| store=sw, | ||
| plot=to_plot, | ||
| ) | ||
| conex_out(sim, RN, z_nodes, X_to_node, output_file) | ||
|
|
||
| else: | ||
| numPEs, costhetaChEff = eas( | ||
| beta_tr, | ||
| altDec, | ||
| showerEnergy, | ||
| init_lat, | ||
| init_long, | ||
| cloudf=cloud, | ||
| conex=False, | ||
| client=optical_cluster.client() if use_cluster else None, | ||
| serial=not use_cluster, | ||
| store=sw, | ||
| plot=to_plot, | ||
| ) |
Contributor
There was a problem hiding this comment.
We need a more elegant implementation than this.
Jorgecvb1
commented
Nov 3, 2026
Jorgecvb1
left a comment
Author
There was a problem hiding this comment.
Tested the run with the conex output on. All variables are saved correctly, root file is saved, it runs very fast for any reasonable N. Ran output .root file as input for Auger Offline simulation framework, and it ran smoothly. Offline was able to read the .root file and all its variables, and run the simulation without any issues.
Author
|
Hi Alex!
Sorry for taking so long. I have reviewed the changes and they look great.
I tested it as much as I could think of, checking variable content and
running it in Auger Offline and it all worked flawlessly. I'm specially
surprised in how fast it runs compared to the previous version. It's
awesome!
Thanks,
Jorge.
El mar, 27 oct 2026 a las 11:48, Alex Reustle ***@***.***>)
escribió:
… ***@***.**** requested changes on this pull request.
I have updated this per my own concerns. It no longer uses 3rd party
libraries. Please test it out and let me know how you like it or if there
are issues.
------------------------------
In src/nuspacesim/compute.py
<#130 (comment)>
:
> + if config.simulation.conex_output:
+ numPEs, costhetaChEff, RN, z_nodes, X_to_node = eas(
+ beta_tr,
+ altDec,
+ showerEnergy,
+ init_lat,
+ init_long,
+ cloudf=cloud,
+ conex=True,
+ client=optical_cluster.client() if use_cluster else None,
+ serial=not use_cluster,
+ store=sw,
+ plot=to_plot,
+ )
+ conex_out(sim, RN, z_nodes, X_to_node, output_file)
+
+ else:
+ numPEs, costhetaChEff = eas(
+ beta_tr,
+ altDec,
+ showerEnergy,
+ init_lat,
+ init_long,
+ cloudf=cloud,
+ conex=False,
+ client=optical_cluster.client() if use_cluster else None,
+ serial=not use_cluster,
+ store=sw,
+ plot=to_plot,
+ )
We need a more elegant implementation than this.
—
Reply to this email directly, view it on GitHub
<#130?email_source=notifications&email_token=A5MRWJ66A2XBDWTLIGWUMVL5WDJPDA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKMZQHA2TMMBZGY3KM4TFMFZW63VGMFZXG2LHN2SWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#pullrequestreview-5308560966>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A5MRWJ3FIG7NFR3A6EYU2A35WDJPDAVCNFSNUABFKJSXA33TNF2G64TZHMZTCNJXG4ZDQOBVHNEXG43VMU5TKNJXGIZTSOBRHA22C5QC>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/A5MRWJ56FASMVKOBLIJ6VLL5WDJPDA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKMZQHA2TMMBZGY3KM4TFMFZW63VGMFZXG2LHN2SWK5TFNZ2KUZTPN52GK4S7NFXXG>
and Android
<https://github.com/notifications/mobile/android/A5MRWJ5ZAFIDRO6LZYUKUBL5WDJPDA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKMZQHA2TMMBZGY3KM4TFMFZW63VGMFZXG2LHN2SWK5TFNZ2K4ZTPN52GK4S7MFXGI4TPNFSA>.
Download it today!
You are receiving this because you were assigned.Message ID:
<NuSpaceSim/nuSpaceSim/pull/130/review/5308560966 <(530)%20856-0966>@
github.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the conex output functionality onto a .root file. Includes a flag -c and a variable in the .toml file that can be assigned as True to run nuSpaceSim with conex output. A GH fit is made to the profile to obtain the GH parameters (works directly with Greisen, parameterized GH or fluctuated GH). Events with decay altitude >20km and Xmax outside the atmosphere (RN max is the last element) are rejected and not saved as output. Resolves #129