Skip to content

feat(plasmasphere): add density cube API with multi-column support#62

Open
sahiljhawar wants to merge 4 commits intomainfrom
sahiljhawar/pine-cube-reader
Open

feat(plasmasphere): add density cube API with multi-column support#62
sahiljhawar wants to merge 4 commits intomainfrom
sahiljhawar/pine-cube-reader

Conversation

@sahiljhawar
Copy link
Collaborator

  • 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
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 PlasmasphereDensityCube dataclass 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 returns None when 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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants