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

Tripura Yerrapothu tripurasundariy at gmail.com
Sun Jul 7 19:41:31 MDT 2019


Thank you,this command worked well.
Could you please help me with the cdo command to create an .nc file with an
average of lat and lon values based on the given input files.

i.e..,Below are the list of .nc files that i have.
-rw-rw-r-- 1 tripura tripura 244836 Jul  6 17:30 rtma_2019050200_T_MS.nc
-rw-rw-r-- 1 tripura tripura 244836 Jul  6 17:32 rtma_2019050201_T_MS.nc
-rw-rw-r-- 1 tripura tripura 244456 Jun 10 23:57 rtma_2019050202_T_MS.nc
-rw-rw-r-- 1 tripura tripura 244456 Jun 10 23:57 rtma_2019050203_T_MS.nc
-rw-rw-r-- 1 tripura tripura 244456 Jun 10 23:57 rtma_2019050204_T_MS.nc
-rw-rw-r-- 1 tripura tripura 244456 Jun 10 23:57 rtma_2019050205_T_MS.nc
-rw-rw-r-- 1 tripura tripura 244456 Jun 10 23:57 rtma_2019050206_T_MS.nc
-rw-rw-r-- 1 tripura tripura 244456 Jun 10 23:57 rtma_2019050207_T_MS.nc
-rw-rw-r-- 1 tripura tripura 244456 Jun 10 23:57 rtma_2019050208_T_MS.nc
-rw-rw-r-- 1 tripura tripura 244456 Jun 10 23:57 rtma_2019050209_T_MS.nc
-rw-rw-r-- 1 tripura tripura 244456 Jun 10 23:57 rtma_2019050210_T_MS.nc
-rw-rw-r-- 1 tripura tripura 244456 Jun 10 23:57 rtma_2019050211_T_MS.nc
-rw-rw-r-- 1 tripura tripura 244456 Jun 10 23:57 rtma_2019050212_T_MS.nc
-rw-rw-r-- 1 tripura tripura 244456 Jun 10 23:57 rtma_2019050213_T_MS.nc
-rw-rw-r-- 1 tripura tripura 244456 Jun 10 23:57 rtma_2019050214_T_MS.nc
-rw-rw-r-- 1 tripura tripura 244456 Jun 10 23:57 rtma_2019050215_T_MS.nc
-rw-rw-r-- 1 tripura tripura 244456 Jun 10 23:57 rtma_2019050216_T_MS.nc
-rw-rw-r-- 1 tripura tripura 244456 Jun 10 23:57 rtma_2019050217_T_MS.nc
-rw-rw-r-- 1 tripura tripura 244456 Jun 10 23:57 rtma_2019050218_T_MS.nc
-rw-rw-r-- 1 tripura tripura 244456 Jun 10 23:57 rtma_2019050219_T_MS.nc
-rw-rw-r-- 1 tripura tripura 244456 Jun 10 23:57 rtma_2019050220_T_MS.nc
-rw-rw-r-- 1 tripura tripura 244456 Jun 10 23:57 rtma_2019050221_T_MS.nc
-rw-rw-r-- 1 tripura tripura 244456 Jun 10 23:57 rtma_2019050222_T_MS.nc
-rw-rw-r-- 1 tripura tripura 244456 Jun 10 23:57 rtma_2019050223_T_MS.nc
I want to ceate a file based on the average of lat and lon values for the
above files.

Thank you in advance.

Best regards
Tripura

On Wed, 3 Jul 2019 at 01:57, Karl-Hermann Wieners via ncl-talk <
ncl-talk at ucar.edu> wrote:

> Hi Tripura,
>
> both Dennis' and my proposal will split the file at each time step, but
> will not look into the actual time stamp data.
>
> Best,
> Karl
>
> On 7/3/19 4:25 AM, Tripura Yerrapothu wrote:
> > Hi Karl-Hermann
> >
> > Will his command split the files based on times stamps. Thank you in
> > advance.
> >
> > Best Regards
> > Bala Tripura Sundari
> >
> > On Tue, 2 Jul 2019 at 4:02 PM, Karl-Hermann Wieners
> > <karl-hermann.wieners at mpimet.mpg.de
> > <mailto:karl-hermann.wieners at mpimet.mpg.de>> wrote:
> >
> >
> >       cdo splitsel,1 rtma_20190501_T_interp_test.nc
> >     rtma_20190501_T_interp_test
> >
> >
>
> On 7/2/19 11:29 PM, Dennis Shea via ncl-talk wrote:
> > One approach: direct use of netCDF operators [ NCO ]:*
> > *
> > *
> > *
> > *%>* ncks -d time,0  z.nc <http://z.nc>  z_0.nc <http://z_0.nc>
> > *%>* ncks -d time,1  z.nc <http://z.nc>  z_1.nc <http://z_1.nc>
> > etc
> > ===
> > I speculate the Climate Data Operators [CDO] could be used also
> > ====
> >
> > Use (say) an NCL script to invoke the 'ncks' operator
> > ====
> >   diri = "./"         ; source input directory
> >   fili = "z.nc <http://z.nc>"       ; source input file
> >   pthi = diri+fili
> >
> >   diro = "./"         ; output directory
> >
> >   do nt=0,4
> >      nts  = sprinti("%0.1i", nt)    ; or ... sprinti("%0.2i", nt)
> >      filo = "z_"+nts+".nc"
> >      ptho = diro+filo
> >      nco  = "ncks -O -d time,"+nt+" "+pthi+" "+ptho
> >      print("nt="+nt+": "+nco)                                      ;
> > echo NCO command
> >      system(nco)
> >   end do
> >
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190707/0aa34dad/attachment.html>


More information about the ncl-talk mailing list