TNO Intern

Commit 167e0548 authored by Arjo Segers's avatar Arjo Segers
Browse files

Fixed timesteps setup.

parent 436d7701
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -40,6 +40,9 @@
# 2025-09, Arjo Segers
#   Updated calculation of temporal means for files with time records.
#
# 2026-01, Arjo Segers
#   Fixed timerange setup.
#


########################################################################
@@ -593,14 +596,12 @@ class CSO_GriddedAverage(utopya.UtopyaRc):
                elif tstep in ["day", "daily"]:
                    # start and end of days:
                    rtt1 = pandas.date_range(start=outfile_t1, end=outfile_t2, freq="D")[:-1]
                    rtt2 = pandas.date_range(
                        start=rtt1[0] + pandas.Timedelta(days=1), periods=len(rtt1)
                    )
                    rtt2 = pandas.date_range(start=rtt1[0] + pandas.Timedelta(days=1), periods=len(rtt1))
                #
                elif tstep in ["hour", "hourly"]:
                    # hours, end is now the same as start ...
                    rtt1 = pandas.date_range(start=outfile_t1, end=outfile_t2, freq="h")[:-1]
                    rtt2 = tt1
                    rtt2 = rtt1
                else:
                    logging.error(f"unsupported output file frequency {tstep}")
                    raise Exception