Replies: 1 comment
-
Hi @nilsleh ! I'm don't know of people that have used xESMF for this kind of remapping, but I am only a volunteer maintainer and I do not work with satellite data... My first interrogation would be about the Looking at your example data and using the first file, I was able to do this: import xesmf as xe
import xarray as xr
ds = xr.open_dataset('Téléchargements/example/example_data/datafile_0.nc', chunks={})
grid_out = xe.util.cf_grid_2d(-60, 60, 1, -80, 80, 1)
reg = xe.Regridder(ds, grid_out, method='bilinear')
v1 = reg(ds.variable_1) So this gives a large rectangle domain with only the thin line of data in the middle. I guess one could do that for all files and then average them together ? Again, completely ignoring the dd = {}
for i in range(4):
dd[i] = xr.open_dataset(f'Téléchargements/example/example_data/datafile_{i}.nc', chunks={})
ddi = {}
for i in range(4):
ddi[i] = dd[i].drop_vars('time').stack(pts=['num_lines', 'num_pixels']).drop_vars(['num_lines', 'num_pixels', 'i_num_line', 'i_num_pixel'])
ds = xr.concat(ddi.values(), 'pts')
reg = xe.Regridder(ds, grid_out, method='nearest_s2d', locstream_in=True)
v1 = reg(ds.variable_1)
v1.plot() Well indeed, this doesn't work well as with only 4 files, the "nearest" method gives garbage. I'm sure other people have already thought of this problem with our common python tools... |
Beta Was this translation helpful? Give feedback.
-
Hi, I am quiet new to working with xarray data from different satellites and models, so apologies for potential misunderstandings. I am trying to work with Sea Surface Height Altimetry data from the SWOT mission, similarly as described in this challenge.
The single data example looks as follows:
Now, there are a several files that track measurements over different time stamps and spatial locations. A subset of such data is given in this example zip.
Essentially, my goal would be to have a data product with a regular grid over lat/lon and time, similarly to the Sea Level Product on Copernicus so that it can be matched with other data sources of the following structure:
Thanks in advance for any suggestions or pointers.
Beta Was this translation helpful? Give feedback.
All reactions