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

Re: [netcdf-java] Writing unsigned data to attributes



Hi Alex:

It wont work because the _FillValue is used to prefill the data array, so it must match the actual data type. IMO, it should not be used as missing value, what it really means is "never written value".

John



On 7/3/2013 5:45 PM, Alex Fraser wrote:
Hi John,

----- Original Message -----
Yes, that should work.
Thanks for that.

[...]
If anyone on these lists have further opinions, they would be welcome
before we standardize on it.
Now that I know how it works, I'm happy with the current situation. But I was 
hoping I could just promote the data type of the fill value for unsigned 
variables - that way I could treat valid ranges and fill values the same way. 
That is, ideally I'd like to do this:

     byte Band1(y, x);
        Band1:_Unsigned = "true";
        Band1:_FillValue = 255s; // short

     byte Band2(y, x);
        Band2:_Unsigned = "true";
        Band2:valid_range = 0s, 254s; // short

But I suspect that wouldn't be backwards-compatible with existing code.

Cheers,
Alex