feat(plasmasphere): add density cube API with multi-column support#62
Open
sahiljhawar wants to merge 4 commits intomainfrom
Open
feat(plasmasphere): add density cube API with multi-column support#62sahiljhawar wants to merge 4 commits intomainfrom
sahiljhawar wants to merge 4 commits intomainfrom
Conversation
Collaborator
sahiljhawar
commented
Mar 13, 2026
- add PlasmasphereDensityCube as a structured container for gridded outputs
- Add build_density_cube() to reshape predictions into time x L x MLT
- Keep legacy order=F reshaping behavior for compatibility with existing 2D slices
- Simplify prediction filename formatting with strftime('%Y%m%dT%H00')
- Return None cleanly when no file exists for the requested date
- add PlasmasphereDensityCube as a structured container for gridded outputs
- Add build_density_cube() to reshape predictions into time x L x MLT
- Keep legacy order=F reshaping behavior for compatibility with existing 2D slices
- Simplify prediction filename formatting with strftime('%Y%m%dT%H00')
- Return None cleanly when no file exists for the requested date
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a structured “density cube” API to the plasmasphere prediction reader so callers can obtain gridded electron density outputs (time × L × MLT), including support for multiple density columns, while keeping legacy Fortran-order reshaping behavior for compatibility.
Changes:
- Introduces
PlasmasphereDensityCubedataclass as a container for gridded outputs. - Adds
build_density_cube()plus helpers to validate input data and reshape predictions into time × L × MLT (single or multi-column). - Simplifies filename formatting using
strftime('%Y%m%dT%H00')and returnsNonewhen files are missing.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| raise ValueError(msg) | ||
|
|
||
| if not pd.api.types.is_datetime64_any_dtype(data["t"]): | ||
| msg = "values of date column must be datetime objects" |
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.