Skip to content

feat: add GK2A and NASA data model implementations with shared prepro… - #89

Merged
bnb32 merged 12 commits into
mainfrom
bnb/gk2a
Jun 8, 2026
Merged

feat: add GK2A and NASA data model implementations with shared prepro…#89
bnb32 merged 12 commits into
mainfrom
bnb/gk2a

Conversation

@bnb32

@bnb32 bnb32 commented Apr 29, 2026

Copy link
Copy Markdown
Collaborator

…cessing utilities

  • Implemented GK2A data model for converting GK2A data to UWISC format.
  • Added NASA data model for converting NASA data to UWISC format.
  • Introduced shared utilities in base_data_model.py for preprocessing tasks.
  • Created pytest fixtures for testing in conftest.py.
  • Added tests for base data model and GK2A data model functionalities.

bnb32 added 4 commits April 29, 2026 11:06
…cessing utilities

- Implemented GK2A data model for converting GK2A data to UWISC format.
- Added NASA data model for converting NASA data to UWISC format.
- Introduced shared utilities in base_data_model.py for preprocessing tasks.
- Created pytest fixtures for testing in conftest.py.
- Added tests for base data model and GK2A data model functionalities.
… and timestamp improvements

refactor: update method names for clarity and consistency
test: add tests for GK2A output filename and improve existing test structure

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 shared BaseUwiscDataModel preprocessing pipeline plus a new GK2A converter, and refactors the existing NasaDataModel to inherit from it. Also adds a multi-pattern CLI helper, pytest fixtures, and unit tests for the new helpers.

Changes:

  • New nsrdb/preprocessing/base_data_model.py with the shared conversion pipeline, expand_input_patterns, and run_data_model_jobs (supports multiple recursive glob patterns and grouped inputs).
  • New nsrdb/preprocessing/gk2a_data_model.py handling per-channel files, raw count → radiance/temperature/reflectance conversion, 4× coarsening, GK2A timestamp parsing, and cloud-phase remapping.
  • NasaDataModel refactored onto the shared base; NASA CLI now accepts nargs='+' patterns; minor docstring/TODO touch-ups in spa.py and variable_factory.py.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
nsrdb/preprocessing/base_data_model.py Adds shared UWISC conversion pipeline, timestamp parsing, dim/coord normalization, batch runner.
nsrdb/preprocessing/gk2a_data_model.py New GK2A-specific subclass, multi-file combining/coarsening, timestamp grouping.
nsrdb/preprocessing/nasa_data_model.py Refactored to subclass the shared base; CLI accepts multiple input patterns.
nsrdb/solar_position/spa.py Docstring fixes for azimuth() / zenith().
nsrdb/data_model/variable_factory.py Adds a TODO comment on the variable mapping.
tests/preproc/conftest.py New shared pytest fixtures.
tests/preproc/test_base_data_model.py Tests for dim remapping and multi-pattern job dispatch.
tests/preproc/test_gk2a_data_model.py Tests for grouping, naming, file combining/coarsening, cloud-phase remap.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread nsrdb/preprocessing/base_data_model.py
Comment on lines +181 to +195
def get_solar_zenith(self, ds):
"""Derive the solar zenith angle for the dataset."""
lats = ds['latitude'].values
lons = ds['longitude'].values
return SolarPosition._zenith(
self.time_index, lats, lons
)

def get_solar_azimuth(self, ds):
"""Derive the solar azimuth angle for the dataset."""
lats = ds['latitude'].values
lons = ds['longitude'].values
return SolarPosition._azimuth(
self.time_index, lats, lons
)
Comment thread nsrdb/preprocessing/gk2a_data_model.py Outdated
Comment thread nsrdb/preprocessing/base_data_model.py Outdated
bnb32 and others added 5 commits June 1, 2026 11:24
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@bnb32
bnb32 merged commit d53d203 into main Jun 8, 2026
3 of 5 checks passed
@bnb32
bnb32 deleted the bnb/gk2a branch June 8, 2026 23:44
github-actions Bot pushed a commit that referenced this pull request Jun 8, 2026
Bespoke data model for GK2A data. NASA and GK2A data models now subclass base model. Eventually this should be refactored to rely more on nsrdb_vars.csv for variable definitions.
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.

3 participants