Problem reading aggregated VIIRS in satpy

26 views
Skip to first unread message

Nigel Atkinson

unread,
Aug 18, 2021, 4:21:13 AM8/18/21
to pytroll

I wanted to test the generation of VIIRS true-color images using our own DB data processed with CSPP, so followed the recipe at https://github.com/pytroll/pytroll-examples/blob/main/satpy/viirs_smoke.ipynb

It worked fine when the data are in 85-second granules but failed when the granules are aggregated with nagg (option "-a" in the CSPP script viirs_sdr.sh). Error messages like this are generated:

>>> scn.load([composite])
Could not load dataset 'DataID(name='I01', wavelength=WavelengthRange(min=0.6, central=0.64, max=0.68, unit='µm'), resolution=371, calibration=<calibration.reflectance>, modifiers=('sunz_corrected_iband',))': arguments without labels along dimension 'y' cannot be aligned because they have different dimension sizes: {13792, 13788}
Traceback (most recent call last):
  File "/data/users/frna/miniconda/install/lib/python3.8/site-packages/satpy/readers/yaml_reader.py", line 841, in _load_dataset_with_area
    ds = self._load_dataset_data(file_handlers, dsid, **kwargs)
  File "/data/users/frna/miniconda/install/lib/python3.8/site-packages/satpy/readers/yaml_reader.py", line 713, in _load_dataset_data
    proj = self._load_dataset(dsid, ds_info, file_handlers, **kwargs)
  File "/data/users/frna/miniconda/install/lib/python3.8/site-packages/satpy/readers/yaml_reader.py", line 689, in _load_dataset
    projectable = fh.get_dataset(dsid, ds_info)
  File "/data/users/frna/miniconda/install/lib/python3.8/site-packages/satpy/readers/viirs_sdr.py", line 368, in get_dataset
    data = self.scale_swath_data(data, factors)
  File "/data/users/frna/miniconda/install/lib/python3.8/site-packages/satpy/readers/viirs_sdr.py", line 233, in scale_swath_data
    data = data * factors[:, 0] + factors[:, 1]
  File "/data/users/frna/miniconda/install/lib/python3.8/site-packages/xarray/core/_typed_ops.py", line 212, in __mul__
    return self._binary_op(other, operator.mul)
  File "/data/users/frna/miniconda/install/lib/python3.8/site-packages/xarray/core/dataarray.py", line 3059, in _binary_op
    self, other = align(self, other, join=align_type, copy=False)
  File "/data/users/frna/miniconda/install/lib/python3.8/site-packages/xarray/core/alignment.py", line 346, in align
    raise ValueError(
ValueError: arguments without labels along dimension 'y' cannot be aligned because they have different dimension sizes: {13792, 13788}
Could not load dataset 'DataID(name='M03', wavelength=WavelengthRange(min=0.478, central=0.488, max=0.498, unit='µm'), resolution=742, calibration=<calibration.reflectance>, modifiers=('sunz_corrected',))': arguments without labels along dimension 'y' cannot be aligned because they have different dimension sizes: {6896, 6894}
Traceback (most recent call last):
etc.

Does it look like this is a problem in satpy or in nagg?

Thanks,

Nigel

Raspaud Martin

unread,
Aug 18, 2021, 4:26:32 AM8/18/21
to pyt...@googlegroups.com
Hi Nigel,

It is probably a problem in Satpy, one that has been adress and fixed
very recently. We will make a release soon (within a couple of weeks I
expect) that should work fine.

Best regards,
Martin

Raspaud Martin

unread,
Aug 18, 2021, 4:29:38 AM8/18/21
to pyt...@googlegroups.com
For further reference, here is the PR solving this I think:
https://github.com/pytroll/satpy/pull/1787

If you feel adventurous, you could even try to get the latest satpy
main branch from github and give it a spin to see if it works before we
actually make the release.

Best regards,
Martin

On Wed, 2021-08-18 at 01:21 -0700, Nigel Atkinson wrote:
>

Nigel Atkinson

unread,
Aug 18, 2021, 4:38:41 AM8/18/21
to pytroll
Thanks Martin. I'm in no hurry so will wait for the release!

Regards,

Nigel

Nigel Atkinson

unread,
Aug 19, 2021, 5:12:04 AM8/19/21
to pytroll
Update: I installed just the new version of viirs_sdr.py ... it works with the aggregated data that I was testing. Thanks!

Nigel

Adam Dybbroe

unread,
Aug 19, 2021, 5:26:51 AM8/19/21
to pyt...@googlegroups.com, adam.d...@smhi.se

Splendid, and thanks for testing and reporting!

-Adam

--
You received this message because you are subscribed to the Google Groups "pytroll" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pytroll+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/pytroll/dede7ba4-01af-4ddc-aa48-0c19a5f828a2n%40googlegroups.com.
-- 
Adam Dybbroe,
Satellite Remote Sensing Scientist,
Atmospheric Research unit, Research and Development
Swedish Meteorological and Hydrological Institute (SMHI)
www.pytroll.org
nwcsaf.smhi.se
www.smhi.se
Reply all
Reply to author
Forward
0 new messages