Closed gerritholl closed 3 years ago
This may be due to a bug in pint, see https://github.com/hgrecco/pint/issues/1274. I'm not sure why it affects processing NOAA but not Metop files.
Correction: it does also affect Metop files, but for some reason that code isn't reached for Metop in our trollflow2 production.
I think that bug appeared in newer versions of pint. This was flagged by @tecnavia-dev a while ago, but we never got around to fixing it.
After thinking about this for a while, I think pint is overkill here. The only thing we need to convert between for ninjo is celsius to kelvin or kelvin to celsius. So I think we should just do the conversion with + or - 273.15 ourselves. That would allow us to remove the pint requirement altogether.
(And I think this is done in satpy's ninjo writer)
On a closer look it's indeed in satpy.ninjotiff
, should we move this issue to the satpy repository?
I don't know what the writer is trying to do here. It shouldn't be converting between celsius and kelvin for a reflectance channel!
yes, we should move it. No, the conversion should just be done for IR channels
Describe the bug
When loading a NOAA AVHRR HRPT Level-1B file produced with AAPP and saving it to NinJoTIFF, pint raises an exception
AttributeError: 'NoneType' object has no attribute 'evaluate'
.To reproduce
Expected behaviour
I expect that a NinJoTIFF file is written with the indicated information.
Actual results
Environment info
Python 3.9.2, satpy 0.26, pyresample 0.18.1, pyninjotiff 0.3.0, pint 0.17.
Additional context
I'm not sure if this is a problem in Satpy, pyninjotiff, or pint, but I think pyninjotiff is the prime suspect.
Saving AAPP-processed Metop AVHRR files to NinJoTIFF works fine.
Unfortunately the files in question are larger than 10 MB, so I cannot upload them here.