How to interpolate a mask file to match the grid size of a file containing data?
Added by Navajyoth MP almost 8 years ago
Hey,
I'm all new to CDO. I have a netCDF mask of a particular region, say a country, called mask.nc (in the region : 1, outside the region : missing values) and this is of the size 131x129. Another file, data.nc, that contains data has a grid size of 217x151. I want to get a new file, output.nc with grid size 217x151 which has different values for inside and outside the region (so that I could just set the values outside to zero and inside to 1 and multiply with the data file to get the values for the region). I'm not much familiar with bilinear interpolation and when I use the remapbil command, I end up getting a file with missing values inside the region under concern.
Hope the query contains enough information.
(I'm a summer intern and I don't really have the permission to upload the data. Apologies for that.)
Replies (2)
RE: How to interpolate a mask file to match the grid size of a file containing data? - Added by Karin Meier-Fleischer almost 8 years ago
Hi Navajyoth,
if you already have an example file of grid size 217x151 like data.nc you can use it as template grid file:
cdo remapnn,data.nc mask.nc mask_217x151.nc
The new mask_217x151.nc file will be generated using the interpolation method "nearest neighbor".
Hope this helps,
Karin
RE: How to interpolate a mask file to match the grid size of a file containing data? - Added by Navajyoth MP almost 8 years ago
It helped ! Thank you much for your concern.