Skip to content

Commit

Permalink
Write output coordinates of RawOutput as floats (#78)
Browse files Browse the repository at this point in the history
* store coordinates as floats

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
frazane and pre-commit-ci[bot] authored Dec 11, 2024
1 parent 584ddb7 commit ed46f8e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/anemoi/inference/outputs/raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ def write_state(self, state):
date = state["date"].strftime(self.strftime)
fn_state = f"{self.path}/{self.template.format(date=date)}"
restate = {f"field_{key}": val for key, val in state["fields"].items()}
for key in ["date", "longitudes", "latitudes"]:
for key in ["date"]:
restate[key] = np.array(state[key], dtype=str)
for key in ["latitudes", "longitudes"]:
restate[key] = np.array(state[key])
np.savez_compressed(fn_state, **restate)

0 comments on commit ed46f8e

Please sign in to comment.