Project

General

Profile

CDO remapbil Results in All NaN Values for Unevenly Spaced Latitude Grid

Added by nazanin tavakoli 2 months ago

Hello,

I hope this message finds you well. I am encountering an issue while using CDO to remap soil moisture data, and I would appreciate your assistance in resolving it.

I have a Netcdf file that it is unevenly spaced in latitude. I attempted to remap the soil moisture data from 84.65 to -59.9 using the following CDO command:

cdo remapbil,SMAP_0.1.txt 20150407.nc 20150407_bil.nc

Here is the structure and attributes of the source NetCDF file:

 <xarray.Dataset>
Dimensions:        (time: 1, lat: 1624, lon: 3856)
Coordinates:
  * time           (time) int64 0
  * lat            (lat) float32 84.66 83.95 83.35 ... -83.33 -83.95 -84.66
  * lon            (lon) float32 -180.0 -179.9 -179.8 ... 179.8 179.9 180.0
Data variables:
    soil_moisture  (time, lat, lon) float32 ...
{'long_name': 'Representative DCA soil moisture measurement for the Earth based grid cell.', 'units': 'cm**3/cm**3', 'valid_min': 0.02}

After executing the remapping command, the output NetCDF file (20150407_bil.nc) contains all NaN values for the soil_moisture variable. Could the uneven latitude spacing be the primary cause of the NaN values in the remapped output? Are there alternative CDO functions or parameters that can handle irregular grids more effectively? Any additional suggestions to resolve this remapping issue?

Target Grid Description (SMAP_0.1.txt):

gridtype=lonlat
gridsize=5223600
xname=longitude
xlongname=longitude
xunits=degrees_east
yname=latitude
ylongname=latitude
yunits=degrees_north
xsize=3600
ysize=1451
xfirst=-179.95
xinc=0.1
yfirst=84.65
yinc=-0.1

Thank you!


Replies (1)

RE: CDO remapbil Results in All NaN Values for Unevenly Spaced Latitude Grid - Added by Estanislao Gavilan about 2 months ago

Hi nazanin,

I have just taken a look to your data. It seems you are using satellite data. I can see that there are a lot of NaN because the satellite only records data on its swath. You could try to use remapnn (Nearest neighbor) or remapcon (conservative remaping).

Kind regards,

Estanislao

    (1-1/1)