xESMF | Universal Regridder for Geospatial Data | Dataset library
kandi X-RAY | xESMF Summary
kandi X-RAY | xESMF Summary
Universal Regridder for Geospatial Data
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Convert a dictionary to an ESM grid
- Construct an ESM grid from a 2D array
- Add a corner to the grid
- Warn if f_contiguous
- Warn a given latitude
- Convert lon and lat coordinates to 2D meshgrid
- Generate a grid of grid points
- Generate a 2D grid of grid points
- Calculate the centers and bounds for a grid
- Write weight file
- Build a regrid from sourcegrid to destgrid
- Destroy a regrid
- Read the README rst rst file
xESMF Key Features
xESMF Examples and Code Snippets
>>> arr
array([[0, 0, 0],
[0, 1, 2],
[0, 2, 4]])
>>> np.int_(np.kron(arr, np.ones((2,2))))
array([[0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0],
[0, 0, 1, 1, 2, 2],
[0,
# this results in bin centers on 100, 300, ...
reduced = (
output_ds
.groupby(((output_ds.x//200) + 0.5) * 200)
.mean(dim='x')
.groupby(((output_ds.y//200) + 0.5) * 200)
.mean(dim='y'))
output_d
Community Discussions
Trending Discussions on xESMF
QUESTION
I'm hoping to upsample values in a large 2-dimensional DataArray (below). Is there an xarray tool similar to np.repeat() which can be applied in each dimension (x and y)? In the example below, I would like to duplicate each array entry in both x and y.
...ANSWER
Answered 2021-Apr-26 at 04:37There is a simple solution for this with np.kron
.
QUESTION
I'm trying to resample a set of GRIB2 arrays at 0.25 degree resolution to a coarser 0.5 degree resolution using the xESMF package (xarray's coarsen method does not work here because there is an odd number of coordinates in the latitude).
I have converted the GRIB data to xarray format through the pygrib package, which then subsets out the specific grid I need:
...ANSWER
Answered 2021-Feb-12 at 19:38I would recommend first trying conservative instead of bilinear (it's recommended on their documentation) and maybe check if you're using the parameters correctly because it seems something is wrong, my first guess would be that something you're doing moves the latitud around for some reason, I'm leaving the docs link here and hope someone knows more.
Regridder docs: https://xesmf.readthedocs.io/en/latest/user_api.html?highlight=regridder#xesmf.frontend.Regridder.__init__
Upscaling recommendation (search for upscaling, there's also a guide for increasing resolution): https://xesmf.readthedocs.io/en/latest/notebooks/Compare_algorithms.html?highlight=upscaling
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install xESMF
You can use xESMF like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page