geobeyond / Arpav-PPCV-backend

Backend di Piattaforma Proiezioni Climatiche per il Nord-Est.
Creative Commons Attribution 4.0 International
0 stars 1 forks source link

Invalid NetCDF files get generated when downloading tas 30yr anomalies #293

Closed ricardogsilva closed 2 weeks ago

ricardogsilva commented 2 weeks ago

Check for example:

https://arpav.geobeyond.dev/api/v2/coverages/forecast-data/tas_30yr_anomaly_seasonal_agree_model_ensemble-30yr-forecast-model_ensemble-tas-anomaly-rcp85-tw1-winter?datetime=1976-01-01/2099-12-31&coords=POLYGON((14.2%2044.4,%2010%2044.4,%2010%2047.3,%2014.2%2047.3,%2014.2%2044.4))

The problem seems to lie in the handling of the datetime parameter - if this is omitted then the generated NetCDF file is good.

Try it locally with:

http://localhost:8877/api/v2/coverages/forecast-data/tas_30yr_anomaly_seasonal_agree_model_ensemble-30yr-forecast-model_ensemble-tas-anomaly-rcp85-tw1-winter?datetime=1976-01-01/2099-12-31&coords=POLYGON((14.2%2044.4,%2010%2044.4,%2010%2047.3,%2014.2%2047.3,%2014.2%2044.4))

ricardogsilva commented 2 weeks ago

Upon closer inspection, we have this output:

http http://localhost:8081/thredds/ncss/grid/ensembletwbc/std/clipped/tas_avgagree_anom_tw1_rcp85_DJF_VFVGTAA.nc accept==netCDF4 var=="tas,tas_agree" time_start=="1976-01-01T00:00:00+00:00" time_end=="2099-12-31T00:00:00+00:00" north==47.097 south==44.697 east==13.979 west==10.279
HTTP/1.1 403 
Connection: keep-alive
Content-Disposition: inline;filename=f.txt
Content-Length: 88
Content-Type: text/plain
Date: Tue, 12 Nov 2024 17:27:36 GMT
Keep-Alive: timeout=20
Server: Apache
Strict-Transport-Security: max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
vary: Origin

Request Too Large: time: no points in subset: lower 54817.000000 > end 31500.500000;

So, we need to be able to wrap this in our code and deal with the error