Project

General

Profile

remapbil returns file with no data only

Added by Pauline Millet about 3 years ago

Hello all,

I would like to apply a mask on my netcdf file to have only data over my area of interest with maskregion command.
From what I got from the documentation and forum talks, I should first remap my data to a regular lon/lat grid. Do to so, I use remapbil command as follow:

cdo -P 8 remapbil,targetgrid.nc myfile.nc myfile-remap.nc

I have no error during the computation but when I have a look at the content of the output file 'myfile-remap.nc', it is full of nan value, no matter the method used to specify the target grid.
I tried to compute the target grid from:

cdo -sellonlatbox,-6,10,41,52 -topo,global_0.11 targetgrid.nc

and I also tried the option of setting the grid parameters (inspired from the original data file) in a text file:

gridtype  = lonlat
gridsize  = 174688
xsize     = 424
ysize     = 412
xname     = lon
xlongname = "longitude" 
xunits    = "degrees_east" 
yname     = lat
ylongname = "latitude" 
yunits    = "degrees_north" 
xfirst    = -28.375
xinc      = 0.110000001623275
yfirst    = -23.375
yinc      = 0.10999999777244

Any idea where I could get wrong ?

I attach a sample of my data (CORDEX EUR-11 data)

Thanks for your help,
Pauline

sample.nc (27.4 MB) sample.nc

Replies (3)

RE: remapbil returns file with no data only - Added by Kyle Lesinger about 3 years ago

I would recommend turning your targetgrid.nc into a .grd file and then re-run it.

Here are my steps for doing it:
1. Open file, save as .grd file.
a. cdo griddes yourfilename.nc > yourfilename.grd
2. Manually edit the following for your resolution. First type: vim yourfilename.grd
a. Change gridsize
b. Xsize
c. Ysize
d. Xinc
e. Yinc
3. Press escape, then type :wq to save and close.
4. Then type cdo remapbil inputfile.nc outputfile.nc
5. Then enter your new .grd file
6. or enter it all in 1 line of code to not have to input the .grd file

Sorry for the format, I have my instructions saved in a document.

RE: remapbil returns file with no data only - Added by Karin Meier-Fleischer about 3 years ago

Hi Pauline,

I don't know what was going wrong, maybe you are using an old CDO version.

@Kyle it is not necessary to generate the grid description file from the target netCDF file because you can directly use it.

cdo -sellonlatbox,-6,10,41,52 -topo,global_0.11 targetgrid.nc

cdo remapbil,targetgrid.nc sample.nc sample_targetgrid_zoom.nc

-Karin

RE: remapbil returns file with no data only - Added by Pauline Millet about 3 years ago

Well, I don't know neither, it's now working perfectly (I'm using cdo 1.9.9) and I'm able to finally apply maskregion to my data.

Anyway thank you Kyle and Karin for your quick answer!

Pauline

    (1-3/3)