Skip to content

Commit

Permalink
Add forecast ref time fixture & use in test.
Browse files Browse the repository at this point in the history
  • Loading branch information
truth-quark committed Oct 10, 2024
1 parent 6e8b5e2 commit 0925960
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/test_um2netcdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1134,15 +1134,21 @@ def time_points():


@pytest.fixture
def forecast_ref_time_coord(time_points):
def forecast_ref_time_points():
"""Use for cube.coord('forecast_reference_time').points attribute."""
return [-16383336.]


@pytest.fixture
def forecast_ref_time_coord(forecast_ref_time_points):
# units & point data ripped from aiihca.paa1jan data file:
# cubes = iris.load("aiihca.paa1jan")
# cubes[0].long_name --> 'atmosphere_optical_thickness_due_to_sulphate_ambient_aerosol'
# cubes[0].coord("time").points --> array([-16382964.])
unit = cf_units.Unit(unit="hours since 1970-01-01 00:00:00")
assert unit.calendar == cf_units.CALENDAR_STANDARD

return iris.coords.DimCoord(time_points,
return iris.coords.DimCoord(forecast_ref_time_points,
standard_name=um2nc.FORECAST_REFERENCE_TIME,
units=unit)

Expand Down

0 comments on commit 0925960

Please sign in to comment.