Skip to content

Commit

Permalink
round up values in climatology files
Browse files Browse the repository at this point in the history
  • Loading branch information
AugustinMortier committed Oct 3, 2024
1 parent c5b7d74 commit 930ccad
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
8 changes: 6 additions & 2 deletions aprofiles/cli/utils/json_climatology.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,20 @@ def compute_climatology(basedir, station_id, season_variables, all_variables, ae
ds.coords['time'] = (ds['time'].astype(int) * 1e-6).astype(int)
Qds.coords['time'] = (Qds['time'].astype(int) * 1e-6).astype(int)

# round altitude to 3 decimals
ds.coords['altitude'] = ds['altitude'].round(3)
Qds.coords['altitude'] = Qds['altitude'].round(3)

# select variables
multivars_dict = {}

# add seasonal variables
for var in season_variables + ["ndays"]:
multivars_dict[var] = Qds[var].to_dict()
multivars_dict[var] = Qds[var].round(6).to_dict()

# add all variables
for var in all_variables:
multivars_dict[var] = ds[var].to_dict()
multivars_dict[var] = ds[var].round(6).to_dict()

# add attributes as separate key
multivars_dict["attrs"] = attrs
Expand Down
5 changes: 5 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

:material-history:{ style="text-align: center; font-size: xx-large; display: block" }

## 0.9.7
Oct 3, 2024

- round up values in climatology files

## 0.9.6
Oct 2, 2024

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "aprofiles"
version = "0.9.6"
version = "0.9.7"
description = "Analysis of atmospheric profilers measurements"
authors = ["augustinm <[email protected]>"]
license = "GPL-3.0"
Expand Down

0 comments on commit 930ccad

Please sign in to comment.