Closed lbesnard closed 6 years ago
from ncwriter import DatasetTemplate import numpy as np template = DatasetTemplate.from_json('test_ncwriter/template1.json') template.variables[u"TEST"] = { "dimensions": ["TIME"], "type": "float32", "attributes": { "standard_name": "sea_water_temperature", "units": "degC", "valid_min": 0.0, "valid_max": 42.00, "_FillValue":-999.9 } } template.variables['TIME']['values'] = np.arange(10) template.variables['DEPTH']['values'] = np.arange(10) del(template.variables['TEMP']) template.variables['TEST']['values'] = np.array([-999.9, -999.9, -999.9, -999.9, -999.9, 12.6, 12.7, 12.8, 12.9, 13.0]) template.to_netcdf('example2.nc')
This generates a example2.nc file. with a TEST variable containing a np.array(unmasked) with a _FillVlaue attribute. Checking the file afterwards, the _FillValue attribute disappears. And the values aren't being masked as they should.
TEST
Test required!
@lbesnard I have fixed this in #7 if you'd care to review?
thx. will check this today
This generates a example2.nc file. with a
TEST
variable containing a np.array(unmasked) with a _FillVlaue attribute. Checking the file afterwards, the _FillValue attribute disappears. And the values aren't being masked as they should.