Skip to content

Commit

Permalink
updated docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
veenstrajelmer committed Jan 29, 2025
1 parent d4a3729 commit 18767c8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dfm_tools/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,10 +397,13 @@ def copernicusmarine_credentials():

def copernicusmarine_dataset_timeshift(ds, dataset_id):
"""
correct daily means from start-of-interval to center-of-interval times
correct daily means from start-of-interval to center-of-interval times.
Only the daily data is currently corrected with an offset of 12 hours.
This does not shift yearly, monthly, hourly, 3hourly or 6hourly data.
https://help.marine.copernicus.eu/en/articles/6820094-how-is-defined-the-nomenclature-of-copernicus-marine-data
"""
if "P1D-m" in dataset_id:
# first check if dataset times are indeed at midnight (start-of-interval)
# check if dataset times are indeed at midnight (start-of-interval)
assert (ds["time"].to_pandas().dt.hour == 0).all()
# add offset to move to noon (center-of-interval)
time_offset = pd.Timedelta(hours=12)
Expand Down

0 comments on commit 18767c8

Please sign in to comment.