Skip to content

Commit

Permalink
Changed PressureLevelModel.data_from_xarray to add sim_time to data…
Browse files Browse the repository at this point in the history
…set if not included.

PiperOrigin-RevId: 612952757
  • Loading branch information
kochkov92 authored and NeuralGCM authors committed Mar 5, 2024
1 parent 29c6bd8 commit 2f0a834
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions neuralgcm/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ def data_from_xarray(
self, dataset: xarray.Dataset
) -> tuple[Inputs, Forcings]:
"""Extracts data and forcings from xarray.Dataset."""
ref_datetime = self._structure.specs.aux_features['reference_datetime']
dataset = xarray_utils.ds_with_sim_time(
dataset,
self._structure.specs.physics_specs,
reference_datetime=ref_datetime,
)
dataset_coords = model_builder.coordinate_system_from_dataset(dataset)
if not np.allclose(
dataset_coords.horizontal.longitudes,
Expand Down

0 comments on commit 2f0a834

Please sign in to comment.