Skip to content

Commit

Permalink
store raw predictions as well as transformed ones when sampling
Browse files Browse the repository at this point in the history
  • Loading branch information
henryaddison committed Mar 8, 2024
1 parent d74e255 commit 768d024
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bin/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,12 @@ def np_samples_to_xr(np_samples, target_transform, coords, cf_data_vars):
# add ensemble member axis to np samples
np_samples = np_samples[np.newaxis, :]
pred_pr_var = (pred_pr_dims, np_samples, pred_pr_attrs)

data_vars = {**cf_data_vars, "target_pr": pred_pr_var}
raw_pred_var = (
pred_pr_dims,
np_samples,
{"grid_mapping": "rotated_latitude_longitude"},
)
data_vars = {**cf_data_vars, "target_pr": pred_pr_var, "raw_pred": raw_pred_var}

samples_ds = target_transform.invert(
xr.Dataset(data_vars=data_vars, coords=coords, attrs={})
Expand Down

0 comments on commit 768d024

Please sign in to comment.