[ncl-talk] To split nc file based on timestamp

Karl-Hermann Wieners karl-hermann.wieners at mpimet.mpg.de
Tue Jul 2 15:04:13 MDT 2019


Hi Tripura,

this is strictly speaking not an NCL answer, but seeing that you have
used cdo before, you may simply use

  cdo splitsel,1 rtma_20190501_T_interp_test.nc rtma_20190501_T_interp_test
 
which will create 5 separate files named

  rtma_20190501_T_interp_test000000.nc
  rtma_20190501_T_interp_test000001.nc
  ...

Best,
Karl

On 7/2/19 9:58 PM, Tripura Yerrapothu via ncl-talk wrote:
> Hello Team,
>
> I am currently looking the command that helps me to split the .nc file
> based on time stamp. Below is the file opened using ncdump
>
> netcdf rtma_20190501_T_interp_test {
> dimensions:
>     time = UNLIMITED ; // (5 currently)
>     lon = 309 ;
>     lat = 195 ;
> variables:
>     double time(time) ;
>         time:standard_name = "time" ;
>         time:long_name = "verification time generated by wgrib2
> function verftime()" ;
>         time:units = "seconds since 1970-01-01 00:00:00.0 0:00" ;
>         time:calendar = "standard" ;
>         time:axis = "T" ;
>     float lon(lon) ;
>         lon:standard_name = "longitude" ;
>         lon:long_name = "longitude" ;
>         lon:units = "degrees_east" ;
>         lon:axis = "X" ;
>     float lat(lat) ;
>         lat:standard_name = "latitude" ;
>         lat:long_name = "latitude" ;
>         lat:units = "degrees_north" ;
>         lat:axis = "Y" ;
>     float TMP_2maboveground(time, lat, lon) ;
>         TMP_2maboveground:long_name = "Temperature" ;
>         TMP_2maboveground:units = "K" ;
>         TMP_2maboveground:_FillValue = 9.999e+20f ;
>         TMP_2maboveground:missing_value = 9.999e+20f ;
>         TMP_2maboveground:short_name = "TMP_2maboveground" ;
>         TMP_2maboveground:level = "2 m above ground" ;
>
> // global attributes:
>         :CDI = "Climate Data Interface version 1.9.3
> (http://mpimet.mpg.de/cdi)" ;
>         :Conventions = "CF-1.0" ;
>         :history = "Thu Jun 20 15:36:01 2019: cdo intntime,4
> rtma_20190501_T_test.nc rtma_20190501_T_interp_test.nc\n",
>             "Thu Jun 20 15:31:22 2019: ncrcat
> ../20190501/rtma_2019050123_T_MS.nc rtma_2019050202_T_MS.nc
> rtma_20190501_T_test.nc\n",
>             "Mon Jun 10 16:53:02 2019: cdo
> remapbil,/home/tripura/2019CMA/Concorde-final/data/MS_Sound_Grid_90.13W-87.05W_29N-30.94N
> tmp.nc <http://tmp.nc>
> /home/tripura/2019CMA/Concorde-final/download/201905/20190501/rtma_2019050123_T_MS.nc"
> ;
>         :History = "created by wgrib2" ;
>         :GRIB2_grid_template = 30 ;
>         :NCO = "4.7.2" ;
>         :nco_openmp_thread_number = 1 ;
>         :CDO = "Climate Data Operators version 1.9.3
> (http://mpimet.mpg.de/cdo)" ;
> }
>
>
> Now i want this file to split into 5 files i.e.. i am looking for the
> command to split the files based on the timestamps.
>
> Please kindly help me on this.
>
> Thank you in advance.
>
> Tripura
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk


-- 
Karl-Hermann Wieners
Max-Planck-Institut für Meteorologie
Bundesstraße 53
20146 Hamburg
Germany
phone: +49 40 41173 161
email: karl-hermann.wieners at mpimet.mpg.de



More information about the ncl-talk mailing list