Skip to content

Commit

Permalink
set time adjustment flexible
Browse files Browse the repository at this point in the history
  • Loading branch information
chan-hoo committed Nov 23, 2024
1 parent 7db79aa commit 39069b8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ush/ghcn_snod2ioda.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,18 @@ def _read(self):
my_date = datetime.strptime(startdate, "%Y%m%d%H")

########################################################
# Adjust time stamp (+18hours) to match with JEDI : CHJ
# Adjust time stamp to match with JEDI : CHJ
# JEDI: 18h
# cyc: HH
# adjust = ( 18h - HH ) * 3600
########################################################
my_date_adj = my_date + timedelta(seconds=64800)
dt_adj_sec = (18-int(my_date.hour))*3600
my_date_adj = my_date + timedelta(seconds=dt_adj_sec)

epoch_time = np.int64(get_epoch_time(my_date_adj))

print(f"my_date: {my_date}")
print(f"dt_adj_sec: {dt_adj_sec}")
print(f"my_date_adj: {my_date_adj}")
print(f"epoch_time: {epoch_time}")

Expand Down

0 comments on commit 39069b8

Please sign in to comment.