Closed luigibrancati closed 1 year ago
@GiuliaFiantanese and I started investigating this bug tonight. We tried to replicate your error selecting the same countries listed in the issue:
So, these are the next steps to solve this issue:
We further investigated the issue. The problem seems to be with Portugal data, as we had already noticed at the beginning. If we try to create the anomalies plot with multiple countries that don't include Portugal, we do not get any error.
In the clipping function (clip_and_concat_countries
, line 24 with rio.clip
), if we have drop=True
as argument we get this error:
NoDataInBounds: No data found in bounds. Data variable: tcno2
If we use drop=False
, the function works but there seem to be no data in the anomalies plot (for Portugal only):
We also tried to create a geospatial plot out of the same data, which supports this idea:
Strangely enough, we don't have such issues if we select Vatican as a country. So it's probably not a matter of small shapefile, but something else.
Our suggested solution would be to leave drop=False
as default. This way, plots wouldn't break anyway.
We should also discuss with mentors about this issue.
I agree with everything except with the Latitude Plot: we should provide a clipping based on the bounding box of the country, i.e. the latitudes included in the selection
I selected multiple countries (Italy, Spain, France and Portugal) on the Streamlit app and tried generating the Anomalies and Hovmoeller plots, but they broke. The issue is with the clipping of the xarray dataset most likely.