-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
In sidecar.py the default fill_value is -1, but the datatype for SIDs is unit64, which can't have negative values. This results is a netcdf write error.
def write_sids(self, sids, nom_res=None, group=None, fill_value=-1):
i = sids.shape[0]
j = sids.shape[1]
varname = 'STARE_index'.format(nom_res=nom_res)
i_name = 'i'
j_name = 'j'
if nom_res:
varname += '_{nom_res}'.format(nom_res=nom_res)
i_name += '_{nom_res}'.format(nom_res=nom_res)
j_name += '_{nom_res}'.format(nom_res=nom_res)
with netCDF4.Dataset(self.file_path, 'a', format="NETCDF4") as rootgrp:
if group:
grp = rootgrp.createGroup(group)
else:
grp = rootgrp
sids_netcdf = grp.createVariable(varname=varname,
datatype='u8',
dimensions=(i_name, j_name),
chunksizes=[i, j],
shuffle=self.shuffle,
zlib=self.zlib,
fill_value=fill_value)
print("HERE")
sids_netcdf.long_name = 'SpatioTemporal Adaptive Resolution Encoding (STARE) index'
sids_netcdf[:, :] = sids
Metadata
Metadata
Assignees
Labels
No labels