-
Notifications
You must be signed in to change notification settings - Fork 47
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
Using xESMF with WRFChem #41
Comments
Thanks for the sample file.
Do you mean a plotting issue instead of an xESMF regridding issue? The same problem will happen for the original data (before regridding). You just need to pass %matplotlib inline
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import numpy as np
import xarray as xr
ds = xr.open_dataset("sample")
fig = plt.figure(figsize=[8, 4])
proj = ccrs.LambertConformal(central_latitude=20,central_longitude=-95,
standard_parallels = (20, 20))
ax = plt.axes(projection=proj)
ax.coastlines()
ax.gridlines(linestyle='--')
ds['CG_FLASHCOUNT'][0].plot(ax=ax, transform=ccrs.PlateCarree())
You can also use
The safest way is to compute the boundaries manually. Automatically inferring bounds from centers can be quite error-prone, especially for non-orthogonal grids. Alternatively you can try xgcm: #13 (comment) |
@JiaweiZhuang Thank you for your help! You can check the script and result generated by
By the way, the setting of Lambert projection in my model is:
|
Also need to pass %matplotlib inline
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import numpy as np
import xarray as xr
ds = xr.open_dataset("sample")
fig = plt.figure(figsize=[8, 4])
proj = ccrs.LambertConformal(central_latitude=20,central_longitude=-95, standard_parallels = (20, 20))
ax = plt.axes(projection=proj)
ax.coastlines()
ax.gridlines(linestyle='--')
ds['CG_FLASHCOUNT'][0].plot(ax=ax, transform=ccrs.PlateCarree(), x='XLONG', y='XLAT') |
Closing as it is not regridding related. Welcome to post general questions on https://github.com/geoschem/GEOSChem-python-tutorial, though. |
Thank you for your work!
I'm trying to regridding variables in the wrfout* file generated by WRFChem.
So, I have modified
lon
andlat
offrontend.py
for bilinear regridding.Here's my plot script and result:
The coastlines and boundary aren't shown correct.
By the way, I want to use
Conservative regridding
, butlon_b
andlat_b
aren't variables in wrfout files. How do you get the value oflon_b
andlat_b
?The text was updated successfully, but these errors were encountered: