0

I have data files of min/max temperature in .grd or netCDF format. From these files, I want to fetch the data date wise for India lat/long points only using CDO or grADS software. The data format is:

lat lon tmax
8 77 26.43
8 78 26.47

and I want in:

lat lon ind_lat_lon obs_date tmax
8 77 1 02-01-2021 26.43
8 78 1 02-01-2021 26.47

this format using CDO/grADS.

Adrian Tompkins
  • 4,261
  • 1
  • 23
  • 56
  • There are numerous options available in CDO, as the user guide shows: https://code.mpimet.mpg.de/projects/cdo/embedded/cdo.pdf. What have you tried doing? – Robert Wilson Feb 03 '21 at 09:03
  • Can you suggest to me what option I should try..? Actually, I haven't tried any option because I am new to CDO. – Rohit Sharma Feb 03 '21 at 09:24
  • Please search through the user guide. It should not be dificult to find a suitable method – Robert Wilson Feb 03 '21 at 09:36
  • I have tried 'seldate' function in CDO but I am not getting the date column while converting the netCDF file into .csv format. The output I am getting is lat, lon, time, tmax. In time column timestamp data I am getting for e.g. "17455848.0" but I want dates in place of "17455848.0". – Rohit Sharma Feb 04 '21 at 06:56
  • hi CDO doesn't convert into csv... CDO will allow to extract a region to another netcdf or GRIB file... then to dump the file information you can use ncdump to view the header and contents as a CDL file. If instead you want to convert to a full csv file (there is NEVER a good reason to want to do that though!) you can use R or python... but as I say, there is not a single reason why you would want to have gridded information in a CSV format, netcdf is so much easier and safer to work with directly – Adrian Tompkins Feb 19 '21 at 07:43

1 Answers1

1

I think the slicing functions you need in space is

 cdo sellonlatbox,lon1,lon2,lat1,lat2 in.nc out.nc 

to select a region around india,

and

 cdo seldate,yyyymmdd1,yymmdd2 in.nc out.nc 

to select the date range.

Adrian Tompkins
  • 4,261
  • 1
  • 23
  • 56