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
Hi,
I've been using xesmf inorder to regrid xarray data from one coordinate system to a regular grid in a UTM zone. Looking at the original data there is no "speckling" and if using xarray.Dataset.interp to interpolate onto the points of the regular UTM grid transformed back into the native coordinate system there is also no "speckling". I was wondering if you might know what causes this and if there is a workaround?
# Create the 2D meshgrid
xx, yy = np.meshgrid(x_values, y_values)
# Create a transformer to perform the coordinate transformation
transformer = Transformer.from_crs(epsg, 4326, always_xy=True)
# Perform the coordinate transformation
new_xx, new_yy = transformer.transform(xx, yy)
ds = ds.rename({'XLAT': 'lat', 'XLON': 'lon'})
# Step 1: Create the regridder from the source grid (latitude-longitude) to the target grid (UTM)
regridder = xe.Regridder(ds, xr.Dataset(data_vars={},
coords={'lon': (['y', 'x'], new_xx),
'lat': (['y', 'x'], new_yy)}),
'bilinear', periodic=True)
The text was updated successfully, but these errors were encountered:
Interesting issue! Do you think, it would be possible to provide a complete working example ? What are x_values, y_values and Transformer ? I am asking because it might be an issue with the data, or at least that there's something with the data that xESMF doesn't like.
Hi,
I've been using xesmf inorder to regrid xarray data from one coordinate system to a regular grid in a UTM zone. Looking at the original data there is no "speckling" and if using xarray.Dataset.interp to interpolate onto the points of the regular UTM grid transformed back into the native coordinate system there is also no "speckling". I was wondering if you might know what causes this and if there is a workaround?
The text was updated successfully, but these errors were encountered: