Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOBT-430: Synthetic data utilities for creating spot-cubes #1993

Merged
merged 7 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions improver/blending/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
MANDATORY_ATTRIBUTE_DEFAULTS,
MANDATORY_ATTRIBUTES,
)
from improver.metadata.constants.time_types import TIME_COORDS
from improver.metadata.constants.time_types import DT_FORMAT, TIME_COORDS
from improver.metadata.forecast_times import add_blend_time, forecast_period_coord
from improver.utilities.round import round_close
from improver.utilities.temporal import cycletime_to_number
Expand Down Expand Up @@ -334,7 +334,7 @@ def store_record_run_as_coord(
cycle = datetime.utcfromtimestamp(
cube.coord("forecast_reference_time").points[0]
)
cycle_str = cycle.strftime("%Y%m%dT%H%MZ")
cycle_str = cycle.strftime(DT_FORMAT)

blending_weight = 1
run_attr = (
Expand Down
2 changes: 2 additions & 0 deletions improver/metadata/constants/time_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@

TimeSpec = namedtuple("TimeSpec", ("calendar", "dtype", "units"))

DT_FORMAT = "%Y%m%dT%H%MZ"

_TIME_REFERENCE_SPEC = TimeSpec(
calendar="gregorian", dtype=np.int64, units="seconds since 1970-01-01 00:00:00"
)
Expand Down
Loading
Loading