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
After reprojecting my xarray dataset to a target geobox, the obtained dataset has the geobox (ds_repr.odc.geobox) of the target dataset and the same spatial resolution. However, some lat lon coordinates do not match by a very small value (e.g. when I do: ds_repr["lat"][1] - ds_target["lat"][1] I obtain: -1.7763568394002505e-15). This is a bit weird, do you have any ideas?
@Riccardo7-DS the error you are reporting is due to numeric precision. Your reference dataset was loaded from zarr, so it has whatever coordinates that were put in there by the process that created it. odc-geo then computes linear mapping from pixel coordinates to world coordinates (scale*(pix_idx + 0.5) + offset x2 for X/Y), and then reproject function recomputes coordinates given that linear mapping.
This problem is common when working with lon/lat coordinates #127, and especially when pixels snapping is not used. In this specific case there is nothing we can do at the library level, other than adding better docs and an FAQ.
Best I can offer is a work-around: after reproject you can copy coordinate values from your reference dataset into the warped one, use something like ds_repr.lon.data[:] = target_ds.lon.data.
After reprojecting my xarray dataset to a target geobox, the obtained dataset has the geobox
(ds_repr.odc.geobox)
of the target dataset and the same spatial resolution. However, some lat lon coordinates do not match by a very small value (e.g. when I do:ds_repr["lat"][1] - ds_target["lat"][1]
I obtain: -1.7763568394002505e-15). This is a bit weird, do you have any ideas?The text was updated successfully, but these errors were encountered: