Menu

shifting time dimension

Help
Heffalump
2016-07-11
2016-07-19
  • Heffalump

    Heffalump - 2016-07-11

    Hello again,

    I have climate forcings for my model but the time dimensions are shifted.

    Is there a easy way to loop through the files and simply shift time dimenions by e.g. -3 ?

    Cheers.

     
  • Charlie Zender

    Charlie Zender - 2016-07-11

    What do you mean "shifted"?
    time_new(0)=time_old(3)?
    Are you willing to lose the first three timesteps?
    You could just hyperslab them out of everything with, e.g.,

    ncks -d time,3,, in.nc out.nc
    

    Or use ncap2 for more precise per-variable control, or to copy values of time from later to earlier indices.
    cz

     
  • Heffalump

    Heffalump - 2016-07-19

    I just overwrote the old time dimension with my new ones, probably there would have been a different solution but for me it this was simplest.

     

Log in to post a comment.