ARPA-SIMC / meteosatlib

OpenMTP/HRI/HRIT C++ access libraries, gdal drivers and other tools
GNU General Public License v2.0
8 stars 2 forks source link

"ValueError" with latest `products` script #26

Closed brancomat closed 3 years ago

brancomat commented 3 years ago

Tried with test data available here: https://github.com/ARPA-SIMC/qc_sample_data/tree/master/satellite/hrit

$ /home/branco/git/meteosatlib/examples/products -t 202002231200 -s /home/branco/buttami/qc_sample_data/satellite/hrit/ --warp='-t_srs "+proj=latlong" -te -10 30 30 60' -d ../ --cachedir=/tmp/ --msat=MSG4
Traceback (most recent call last):
  File "/home/branco/git/meteosatlib/examples/products", line 883, in <module>
    sat.make_product(prod, args.format, args.shp, destdir=args.destdir)
  File "/home/branco/git/meteosatlib/examples/products", line 252, in make_product
    res = maker.compute()
  File "/home/branco/git/meteosatlib/examples/products", line 723, in compute
    return upscaledr * hrvnorm, upscaledg * hrvnorm, upscaledb * hrvnorm
ValueError: operands could not be broadcast together with shapes (716,955) (2105,2806)
spanezz commented 3 years ago

Confirmed, I managed to reproduce it

spanezz commented 3 years ago

Ok, losing imresize (see #23) we need a function that does both contrast stretch and occasionally image resize.

The imresize implementation did a lot of work. We unfortunately cannot use skimage because, as usual, of Centos.

I'll try to retrofit a custom implementation, and I cannot guarantee there won't be a little loss of image quality as a consequence of "custom": it's not really my field.

brancomat commented 3 years ago

After some analysis, the best option would be if the products script could test for imresizeor skimage presence, and then use the one that's present in the system.