Closed pnuu closed 6 years ago
@pnuu I don't get the same error as you! I seem to lack a platform_name
? I run Python 3.6.4, latest pyspectral, pyorbital and satpy master branches. So, what's happening?
~/usr/src/satpy/satpy/composites/__init__.py in __call__(self, projectables, optional_datasets, **info)
468 for wavelength outside [3, 4] µm.
469 """
--> 470 self._init_refl3x(projectables)
471 _nir, _ = projectables
472 refl = self._get_reflectance(projectables, optional_datasets) * 100
~/usr/src/satpy/satpy/composites/__init__.py in _init_refl3x(self, projectables)
489
490 _nir, _tb11 = projectables
--> 491 self._refl3x = Calculator(_nir.attrs['platform_name'], _nir.attrs['sensor'], _nir.attrs['name'])
492
493 def _get_reflectance(self, projectables, optional_datasets):
KeyError: 'platform_name'
I have a fix for the platform_name
, I'll create PR shortly. You can also check satpy branch bugfix-aapp-platform_name
.
Ok, nice. I am looking at it!
PR for SatPy created: https://github.com/pytroll/satpy/pull/386
Ok, can you try my new PR branch: fix_avhrr_ch3b_naming
@pnuu ?
I get another error in satpy then...
~/usr/src/satpy/satpy/composites/__init__.py in _get_reflectance(self, projectables, optional_datasets)
500
501 for dataset in optional_datasets:
--> 502 if (dataset.attrs['units'] == 'K' and
503 "wavelengh" in dataset.attrs and
504 dataset.attrs["wavelength"][0] <= 13.4 <= dataset.attrs["wavelength"][2]):
KeyError: 'units'
I'll take a look on monday :-)
Thanks @pnuu . I believe I solved it now in the PR pytroll/satpy#386 Waiting for that to be merged....
Great, now (with your update to pytroll/satpy#386) everything I've tried works!
Great, thanks @pnuu
Code Sample, a minimal, complete, and verifiable piece of code
Problem description
Use of PySpectral via SatPy for AVHRR data fails. The above script works fine for MSG/SEVIRI data.
Actual Result, Traceback if applicable
Traceback relevant to PySpectral:
Here
'3b'
is the channel name SatPy uses for 3.8 um AVHRR channel. Looking at the HDF5 file in~/.local/share/pyspectral/
the group ("folder") names arech1
, ...ch3b
, ...ch5
, so there is an inconsistency in the channel naming between SatPy and PySpectral.Versions of Python, package at hand and relevant dependencies
Conda, Python 3.6, current PySpectral master branch, current SatPy master branch.