Open uzzzaldash opened 10 months ago
hi @uzzzaldash
this is an interesting application! My understanding is that your input data is not defined everywhere and the resulting field looks like a dilution of the original. Have you tried to define a mask for your input data? you can add a variable "mask" in your dataset that you could define like ds["mask"] = xr.where(np.isnan(data), 0, 1)
Hi @raphaeldussin , Thanks for the response. i'm not fully sure what do you mean by 'defining my input data'. So, I am telling you what did after getting your response.
CrIS_ISOP
is my input dataset. It has actually two variables. 1. Isop 2.Ndata
So, modified my code like:
CrIS_ISOP_path = '.../CrIS_ISOP_data/201907_daily_CrIS_Isoprene_screened.nc'
CrIS_ISOP_data = xr.open_dataset(CrIS_ISOP_path, decode_times=True)
CrIS_ISOP = CrIS_ISOP_data['Isop']
This what I understood by defining input data.
Then I added your suggested line at the end of section named Import in Daily CrIS Data
which is 3rd paragraph in my code. So, the modified code is like:
CrIS_ISOP_path = '.../CrIS_ISOP_data/201901_daily_CrIS_Isoprene_screened.nc'
CrIS_ISOP = xr.open_dataset(CrIS_ISOP_path, decode_times=True)
# Need to get time as an xarray coordinate
# Bcz GC dim [time, lat, lon] but CrIS dim [day, lat, lon]
temp_staging_area = pd.to_datetime(CrIS_ISOP['day']+1,format='%d') + pd.DateOffset(hour=12, month=1, years=2019-1900)
CrIS_ISOP['day'] = temp_staging_area
# Rename CrIS coordinate of day to time to match with GEOS-Chem naming convention
CrIS_ISOP = CrIS_ISOP.rename({'day':'time'})
CrIS_ISOP['time'].attrs['long_name'] = 'Time'
CrIS_ISOP['time'].attrs['axis'] = 'T'
CrIS_ISOP #time: 31 lat: 361 lon: 576
CrIS_ISOP["mask"] = xr.where(np.isnan(CrIS_ISOP),0,1)
After doing these, The figures I am getting still the same. Could you please tell me little detail about it?
Hi, I'm new to xESMF, trying to regridding from high resolution to low resolution for rectilinear grids following https://xesmf.readthedocs.io/en/latest/notebooks/Rectilinear_grid.html. First, I tried to regrid from GEOS-Chem model data (Res:4x5) to CrIS Satellite data (Res:0.5x0.625). And it seems worked perfectly as the spatial maps for original data and regridded data was same. Then I tried to do opposite which is regidded from CrIS Satellite data (Res:0.5x0.625) to GEOS-Chem model data (Res:4x5). In this case, I just changed the input and output under the
xe.Regridder
function and plotted the spatial maps. However the maps generated from original and regridded data are not look same in this case. I am giving my code and figures below:Import in a Sample GEOS-Chem 4x5 Model Run
Import in Daily CrIS Data
Setting up the CrIS grid (0.5x0.625)
Setting up Grid for GEOS-Chem 4x5
Make a Regridding Object
Perform the Regridding from 0.5x0.625 to 4x5
CrIS_ISOP_regridded = regridder(CrIS_ISOP, keep_attrs=True)
Plot rigridded data
CrIS_ISOP_regridded.isel(time=0).plot()
Plot Original data
CrIS_ISOP['Isop'].isel(time=0).plot()
Here, the first figure is for regridded data and the second one is for the original data. But they are not same. But when I regidded from low to high resolution (4x5 to 0.5x0.625) in the same way, I got the exactly same figure for original and regridded data. What I am missing here then?