Regrid rectilinear to Curvilinear #367
Unanswered
pramodadhikari
asked this question in
Q&A
Replies: 1 comment
-
Hi! Sorry for the delayed response. I suspect some of your inputs to your If that doesn't clear things up for you, if you could give me the sizes of the input variables I could also get a better idea of where that error is coming from. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have a Precipitation field from PRISM datasets (for the entire United States) and want to re-grid it to match up with the WRF dataset dimension (which is only for the western US).
PRISM precipitation data: 4km with shape 621 x 1405
prism_latitude 1D array([24.083333, 24.125, 24.166667, ..., 49.833333, 49.875, 49.916667]) and
prism_longitude 1D array([-125. , -124.958333, -124.916667, ..., -66.583333, -66.541667, -66.5 ]).
WRF data: 9 km with shape 340 x 270
WRF lat is 2D XLAT (from 22 to 57 degrees) and WRF lon is 2D XLONG (from -139 to -94 degrees)
I used the following code but it gave me a ValueError: axes don't match array.
`
import numpy as np
import xarray as xr
import geocat.comp
#PRISM data
ds_rect = xr.open_dataset('prism_file.nc')
ppt_rect =ds_rect['precip'][:]
lat1D_rect=ds_rect.lat[:]
lon1D_rect=ds_rect.lon[:].
#WRF latitude and longitude
data = xr.open_dataset("wrf_file.nc")
newlat2D_curv=data.variables["XLAT"][0,:,:]
newlon2D_curv=data.variables["XLONG"][0,:,:]
ppt_curv = geocat.comp.rgrid2rcm(lat1D_rect, lon1D_rect, ht_rect, newlat2D_curv, newlon2D_curv)
`
Thank you in advance for any help in solving this issue.
Pramod
Beta Was this translation helpful? Give feedback.
All reactions