New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Saving AAPP-processed NOAA HRPT to NinJoTIFF fails with AttributeError #1614
Comments
This may be due to a bug in pint, see hgrecco/pint#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. 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 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. |
Add a test for NinJoTIFF unit conversion. Currently only tests that % maps to % correctly, corresponding to the failure in pytroll#1614
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.
The text was updated successfully, but these errors were encountered: