Make InvMu/PSD/flux dependency resolution species-aware and fixing PSD-unit bug - #74
Draft
Jaskirat121 wants to merge 7 commits into
Draft
Make InvMu/PSD/flux dependency resolution species-aware and fixing PSD-unit bug#74Jaskirat121 wants to merge 7 commits into
Jaskirat121 wants to merge 7 commits into
Conversation
Add HOPE proton processing script for RBSP
Add MagEIS proton processing script for RBSP
Add RBSP RBSPICE proton processing script
InvMu, PSD, and several saved output files (GFZStrategy's 'flux' and 'alpha_and_energy', MonthlyRBStrategy's netCDF output) hardcoded a dependency on Energy_FEDU / FEDU, even when saving proton data (Energy_FPDU / FPDU). Proton pipelines would fail validation entirely, or silently skip/empty output files. This introduces an "alternatives" concept to VariableInfo.dependencies and OutputFile.names_to_save: a dependency can now be a tuple of alternative names (e.g. ("Energy_FEDU", "Energy_FPDU")), resolved at save/load time to whichever one is actually present. This required threading an available_keys parameter through defined standards and datasets, all of which previously called get_dependencies()/names_to_save directly without resolving alternatives.
compute_phase_space_density() tagged its output with the SI unit but the actual computed values are in the standard convention (c/MeV/cm)^3, consistent with the (1e3/2.997e10) conversion factor already used in the PSD formula. convert_to_unit() was a silent no-op at save time.So, defined the correct unit once (psd_natural_unit, in units.py) and uses it consistently at the point PSD is computed.
Contributor
|
@Jaskirat121 Just to make things easy, always keep your main branch in-sync with the upstream main branch. And always use a new branch to make PRs. |
sahiljhawar
marked this pull request as draft
August 7, 2026 15:25
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.
InvMu, PSD, and several saved output files (GFZStrategy's 'flux' and 'alpha_and_energy', MonthlyRBStrategy's netCDF output) hardcoded a dependency on Energy_FEDU / FEDU, even when saving proton data (Energy_FPDU / FPDU). Proton pipelines would fail validation entirely, or silently skip/empty output files.
This introduces an "alternatives" concept to VariableInfo.dependencies and OutputFile.names_to_save: a dependency can now be a tuple of alternative names (e.g. ("Energy_FEDU", "Energy_FPDU")), resolved at save/load time to whichever one is actually present. This required threading an available_keys parameter through defined standards and datasets, all of which previously called get_dependencies()/names_to_save directly without resolving alternatives.
compute_phase_space_density() tagged its output with the SI unit but the actual computed values are in the standard convention (c/MeV/cm)^3, consistent with the (1e3/2.997e10) conversion factor already used in the PSD formula.
convert_to_unit() was a silent no-op at save time.So, defined the correct unit once (psd_natural_unit, in units.py) and uses it consistently at the point PSD is computed.