-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate SCRIP grid file from scratch #4
Comments
Also, will the Python version of |
We are very close to an implementation. Dealing with a couple test failures gratingly unrelated to the weight file writing.
CF-Grid is the main structured grid format read by
import ocgis
import numpy as np
time = ocgis.TemporalVariable(name='time', value=[1, 2, 3, 4, 5, 6], dimensions='time')
lat = ocgis.Variable(name='lat', value=[-90, 0, 90.], dimensions='lat')
lon = ocgis.Variable(name='lon', value=[0., 90., 180., 270., 359.], dimensions='lon')
data = ocgis.Variable(name='data', value=np.random.rand(6, 3, 5), dimensions=['time', 'lat', 'lon'])
grid = ocgis.Grid(lon, lat, crs=ocgis.crs.Spherical())
field = ocgis.Field(time=time, grid=grid, is_data=data)
path = '/tmp/cf-data.nc'
field.write(path)
ocgis.RequestDataset(path).inspect() One can also create an
...
from ocgis.regrid.base import get_esmf_field_from_ocgis_field
efield = get_esmf_field_from_ocgis_field(field)
print(type(efield))
It will work from pure numpy arrays. Let me know if I missed anything... |
Sounds great! Please do tell me once it is released, so can I make a major update on xESMF 😃 (close this issue as SCRIP doesn't have to be a hard dependence) |
add HPC regridding documentation (replace PR JiaweiZhuang#4)
To solve #2 (the biggest, or perhaps the only barrier for xESMF), I would like a Python version of
ESMF_RegridWeightGen
. According to @bekozi and @rokuingh, this function will eventually be available in ESMPy. Before that, we can actually use the Fortran version ofESMF_RegridWeightGen
to generate offline regridding weights. This command line utility comes with conda ESMF so users don't need to worry about compiling Fortran source code. In the future we can easily replace it by the Python equivalent, without affecting other parts of xESMF.However,
ESMF_RegridWeightGen
requires the grid information to be stored in SCRIP Grid File Format. Here are possible ways to get this format:I am wondering what's the best&quickest way to convert pure numpy arrays to SCRIP format, which can then be fed to
ESMF_RegridWeightGen
? xESMF only focuses on quadrilateral (i.e. logically rectilinear) grids so there's no need to worry about unstructured meshes. @bekozi and @rokuingh do you have minimal Python scripts to make this format?The text was updated successfully, but these errors were encountered: