You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am plotting a temperature field. Before calling the earthkit.plots.quickmap.plot function, the longitude of the data ranges from 0 to 360. After plotting, the xarray.DataArray's own longitude has changed (!) to -180 to 180, and the plot itself is wrong, with the map lines and axis labels using the -180 to 180 range, but the data still assuming that everything is in 0 to 360 (e.g. South America's temperatures are plotted on the map lines of Australia).
What are the steps to reproduce the bug?
I think this issue relates to xarray's indices being mutable: pydata/xarray#7463. Somewhere in the plotting, I assume there is some code to standardize the longitude to the -180 to 180 range, which assumes it's operating on a copy of the data. However, it is able to mutate the actual longitude index. When later code checks, it sees that the longitude index is correct (even though the temperature data has not been shifted yet), and so doesn't do anything else. As a result, after plotting, the plot is wrong and the data array has been changed.
What happened?
I am plotting a temperature field. Before calling the
earthkit.plots.quickmap.plot
function, the longitude of the data ranges from 0 to 360. After plotting, the xarray.DataArray's own longitude has changed (!) to -180 to 180, and the plot itself is wrong, with the map lines and axis labels using the -180 to 180 range, but the data still assuming that everything is in 0 to 360 (e.g. South America's temperatures are plotted on the map lines of Australia).What are the steps to reproduce the bug?
I think this issue relates to xarray's indices being mutable: pydata/xarray#7463. Somewhere in the plotting, I assume there is some code to standardize the longitude to the -180 to 180 range, which assumes it's operating on a copy of the data. However, it is able to mutate the actual longitude index. When later code checks, it sees that the longitude index is correct (even though the temperature data has not been shifted yet), and so doesn't do anything else. As a result, after plotting, the plot is wrong and the data array has been changed.
Version
0.2.3
Platform (OS and architecture)
Emscripten WebAssembly (lab.climet.eu)
Relevant log output
No response
Accompanying data
https://a3s.fi/compression.lab.climet.eu/era5_t2m_2012_12_01_14:00.nc
Organisation
University of Helsinki
The text was updated successfully, but these errors were encountered: