Tests broken netcdf4-python >= 1.5.1
NetCDF exporter does not work when using netcdf4-python >= 1.5.1, due to this issue https://github.com/Unidata/netcdf4-python/issues/939
The error happens with the call:
gts2_client.py -o /tmp/tmpkysro1fd -r test -l 53.036066 -k 12.559433 -i 53.238058 -j 12.737961 -b B02_B05 -s 20170410 -e 20170530 -m nc -a S2A -t L2A -v 0.13 -c False -z 0.1
-f 1.0 -g 10 -p False
Error:
[root@1f18d140dfe1 gts2_client]# gts2_client.py -o /tmp/tmpkysro1fd -r test -l 53.036066 -k 12.559433 -i 53.238058 -j 12.737961 -b B02_B05 -s 20170410 -e 20170530 -m nc -a S2A -t L2A -v 0.13 -c False -z 0.1
-f 1.0 -g 10 -p False
# gts2_client Requesting data from the GTS2 server ...
# gts2_client >>>>>> API-call: https://rz-vm175.gfz-potsdam.de:443/AC/B02_B05/20170410_20170530/12.55943_12.73796_53.03607_53.23806?minimum_fill=1.0&sensor=S2A&level=L2A&version=0.13&suffix=&max_cloudy=0.1&utm_zone=
# gts2_client >>>>>> Runtime of API: 0.56 minutes
# gts2_client Converting data to netcdf-file ...
Traceback (most recent call last):
File "/root/anaconda3/bin/gts2_client.py", line 679, in json_to_netcdf
data[:, :, :] = mask_arr
File "netCDF4/_netCDF4.pyx", line 4950, in netCDF4._netCDF4.Variable.__setitem__
File "/root/anaconda3/lib/python3.7/site-packages/netCDF4/utils.py", line 365, in _StartCountStride
datashape = broadcasted_shape(shape, datashape)
File "/root/anaconda3/lib/python3.7/site-packages/netCDF4/utils.py", line 973, in broadcasted_shape
return np.broadcast(a, b).shape
ValueError: shape mismatch: objects cannot be broadcast to a single shape
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/anaconda3/bin/gts2_client.py", line 950, in <module>
timeout=args.timeout)
File "/root/anaconda3/bin/gts2_client.py", line 828, in client
wl)
File "/root/anaconda3/bin/gts2_client.py", line 682, in json_to_netcdf
raise Exception("Something went wrong while saving as netcdf. " + traceback.format_exc())
Exception: Something went wrong while saving as netcdf. Traceback (most recent call last):
File "/root/anaconda3/bin/gts2_client.py", line 679, in json_to_netcdf
data[:, :, :] = mask_arr
File "netCDF4/_netCDF4.pyx", line 4950, in netCDF4._netCDF4.Variable.__setitem__
File "/root/anaconda3/lib/python3.7/site-packages/netCDF4/utils.py", line 365, in _StartCountStride
datashape = broadcasted_shape(shape, datashape)
File "/root/anaconda3/lib/python3.7/site-packages/netCDF4/utils.py", line 973, in broadcasted_shape
return np.broadcast(a, b).shape
ValueError: shape mismatch: objects cannot be broadcast to a single shape
[root@1f18d140dfe1 gts2_client]#
Edited by Romulo Pereira Goncalves