Menu

select hours in ncrcat

2018-08-17
2018-08-22
  • Frédéric Dubuis

    Hello,
    I am working with radar data on ice clouds in arctic. I would like to compare some radiosonde's variables as temperature and relative humidity to radar reflectivity and Doppler velocitiy. To do it I would like to concatenate only two hours of radar data per day (around the time the radiosonde is launched) during one month to have one final file containing all the data from 5pm to 7pm for all the days of that month. The netCDF4 files are daily so I have to concatenate 30 files but only for 2 hours a day.
    Until now, what I do is taking 2 hours of each files day per day and then concatenate the resulting files:

    day 1:
    ncrcat -d time,"2013-03-01 17:00:0.0","2013-03-1 19:00:0.0" -v Reflectivity in1.nc -o out1.nc
    day 2:
    ncrcat -d time,"2013-03-02 17:00:0.0","2013-03-2 19:00:0.0" -v Reflectivity in2.nc -o out2.nc
    and then after 30 files:
    ncrcat out1 out2...out30 -o final.nc

    Is there a more efficient way to do it that could save time (not treating it day per day) as my next goal is to do the same thing but for all the winter months for 5 years.

    thank you for your help

     
    • Charlie Zender

      Charlie Zender - 2018-08-22

      Frédéric,
      Please read the "sub-cycle" feature documentation and examples: http://nco.sf.net/nco.html#ssc
      Together with the multi-record-output switch (--mro) , I think this feature might do what you want, but you'll need to try it out as I do not know the full format of your input data.
      cz

       

Log in to post a comment.

MongoDB Logo MongoDB