Skip to content

Commit

Permalink
Minor addition to convert FILLVAL to appropriate units in xarray_to_cdf
Browse files Browse the repository at this point in the history
  • Loading branch information
bryan-harter committed Oct 18, 2023
1 parent 2d152bc commit 3694fd4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cdflib/xarray/xarray_to_cdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ def xarray_to_cdf(
# Grab the attributes from xarray, and attempt to convert VALIDMIN and VALIDMAX to the same data type as the variable
var_att_dict = {}
for att in d[var].attrs:
if (att == "VALIDMIN" or att == "VALIDMAX") and istp:
if (att == "VALIDMIN" or att == "VALIDMAX" or att == "FILLVAL") and istp:
var_att_dict[att] = [d[var].attrs[att], _datatype_to_string(cdf_data_type)]
else:
var_att_dict[att] = d[var].attrs[att]
Expand Down

0 comments on commit 3694fd4

Please sign in to comment.