[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

netcdf file returns corrupt byte data if using fill



Title: netcdf file returns corrupt byte data if using fill

 
Hopefully I'm not repeating a known issue but I searched the mail archives and didn't come across it. I've been using java netcdf to store radar scans, using a dynamic dimension of time to write data as it arrives throughout the day. Data was being written in float format and everything was working fine. Recently switched to store data in byte format instead, to reduce the size of information being stored. Do not require fill mode, as the entire each radar scan arrives in a complete chunk. Discovered afterwards that if the server was restarted new data written to the file became corrupted. I downloaded the netcdf source and traced thru it to find that when an existing netcdf file is opened in write mode, fill mode defaults to true. (This is interesting because the default when you first create a file, is off. I see in more recent documentation this is clarified a bit better.) Anyway, it turns out, the fill logic, ends up corrupting the file and adds an extra 4K chunk of 'fill' data. A hex dump of the file easily shows the problem.  Luckily for me the work around was simple, use the setFill() method to disable fill as I didn't need fill capability.

The exact version I was testing  2.1.10 Build Date = 2004-07-08 08:59:07.

Not sure if this stream is still being maintained etc. but if interested, I will send a small sample program that demonstrates this bug.