Skip to content

Commit

Permalink
fix quality flag attrs type
Browse files Browse the repository at this point in the history
  • Loading branch information
AugustinMortier committed Sep 21, 2024
1 parent e134c26 commit 9963096
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions aprofiles/io/write_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,8 @@ def _classify_retrieval_scene(ds):
if var.dtype == np.int64:
encoding[varname] = {"dtype": np.int32}

# convert also the quality_flag's variable flag_values attribute also to NC_INT instead of NC_INT64
ds_towrite["quality_flag"] = ds_towrite.quality_flag.assign_attrs({'flag_values': np.array([0,1,2], dtype=np.int32)})

# writes to netcdf
ds_towrite.to_netcdf(path, mode='w', encoding=encoding)

0 comments on commit 9963096

Please sign in to comment.