Project

General

Profile

How to set hourly data forward one day

Added by wu yy 4 months ago

Hello all
Hi, I have two sets of data, one set is from 22:00:00 to 24:00:00 from 1994-04-01 to 2023-09-30 and the other is from 00:00:00 to 04:00 : 00 from 1994-04-01 to 2023-09-30. after converting the time zones, I want to combine the two sets of data together, the date of the data will change, the day's The data becomes the next day's data, in order to merge the correct day's data how to convert the hourly data from 1994-04-01 to 2023-09-30 to 00:00:00 to 04:00 : 00 from 1994-04-02 to 2023-10-01?

Best Regards.
!!


Replies (5)

RE: How to set hourly data forward one day - Added by Karin Meier-Fleischer 4 months ago

Sorry, but that is confusing, the PNG shows hours from 9 to 17.

Does your files contail time steps as follows:

1994-04-01 00:00:00
1994-04-01 01:00:00
1994-04-01 02:00:00
1994-04-01 03:00:00
1994-04-01 04:00:00
1994-04-02 00:00:00
1994-04-02 01:00:00
1994-04-02 02:00:00
...
2023-09-30 04:00:00

and the other file:

1994-04-01 22:00:00
1994-04-01 03:00:00
1994-04-01 24:00:00 ? same as 00:00:00
1994-04-01 22:00:00
1994-04-01 23:00:00
1994-04-02 24:00:00
...
2023-09-30 24:00:00

Please describe it in more detail?

RE: How to set hourly data forward one day - Added by Karin Meier-Fleischer 4 months ago

Sorry, there was something wrong while editing. I've corrected my last post.

RE: How to set hourly data forward one day - Added by wu yy 4 months ago

You are right about the timesteps, and I apologize for my lack of clarity. Both files are actually the same variable, but in the region I studied, 22:00:00-00:00:00 on the first day and 0:00:00-04:00:00 and on the second day are in the same day, which means that 22:00:00-00:00:00 on 1994-04-01 and 0:00:00-04:00:00 on 1994-04-02 should be in the same day, and so on. How can I combine these two files for the same day in my study area?

RE: How to set hourly data forward one day - Added by Karin Meier-Fleischer 4 months ago

You can shift the time back by 4 hours do your computations and then shift it forward to the original time and day.

See shifttime operator https://code.mpimet.mpg.de/projects/cdo/embedded/cdo.pdf#subsection.2.6.4

RE: How to set hourly data forward one day - Added by wu yy 4 months ago

Thank you very much for your answer

    (1-5/5)