ORAC-CC / orac

Optimal Retrieval of Aerosol and Cloud
GNU General Public License v3.0
30 stars 19 forks source link

Fix ncdf #66

Closed simonrp84 closed 2 years ago

simonrp84 commented 2 years ago

ORAC reads netcdf files by first applying a fill value (-999) and then applying the scale + offset specified in the netcdf attributes. This is problematic in the case that -999 is a valid value in the unscaled netCDF data (such as for short int data in the range -32766 -> +32767).

In this PR I correct the netcdf read code so that this problem doesn't arise any more. I think I also have it set up to cover the case that the input netcdf data doesn't contain a fill value but can't actually check this as I don't have any such netcdf files available.

simonrp84 commented 2 years ago

Ok, good point @garethethomas. My new commit should fix this.

simonrp84 commented 2 years ago

Thanks for looking, guys.