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

Feature/use onestep zarr train data #207

Merged
merged 29 commits into from
Apr 3, 2020
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
checkout to dev version of runfile for one step workflow
Anna Kwa committed Apr 1, 2020
commit 5f65a42990673f02b0866a6b459f769d21aaa16c
16 changes: 12 additions & 4 deletions workflows/one_step_jobs/runfile.py
Original file line number Diff line number Diff line change
@@ -153,10 +153,18 @@ def create_zarr_store(


def _get_forecast_time(time) -> xr.DataArray:
logger.info(f"time before setting to forecast time: {time}")
dt = np.asarray(time - time[0]).astype("timedelta64[ns]")
logger.info(f"setting to forecast time: {dt}")
return xr.DataArray(dt, name="time", dims=["time"], attrs={"units": "ns"})
dt = np.asarray(time - time[0])
return xr.DataArray(
_convert_time_delta_to_float_seconds(dt),
name="time",
dims=["time"],
attrs={"units": "s"},
)


def _convert_time_delta_to_float_seconds(a):
ns_per_s = 1e9
return a.astype("timedelta64[ns]").astype(float) / ns_per_s


def _merge_monitor_data(paths: Mapping[str, str]) -> xr.Dataset: