orocos-toolchain / ocl

Orocos Component Library
Other
16 stars 33 forks source link

Add support for netCDF4 and padding with NaN values. #77

Open ernestum opened 6 years ago

ernestum commented 6 years ago

By default, the NetCDFReporter does zero oder hold for reported ports with a lower data rate. If we set the reportOnlyNewdata flag of the reporter, its fills the missing values with some funny, arbitrarily high values (for float and double that is 9.9692099683868690e+36 as defined in netcdf.h). This totally destroys any visualisation. The newer NetCDF4 format supports defining a different placeholder value (e.g. NaN would make more sense and is something that most visualisation software supports).

This patch adds a flag to the NetCDFReporter to switch to the newer netCDF4 format. Then missing values are automatically padded with NaN. netCDF4 does not allow shared access to the .nc files any more (this is why we still support the old format).