Skip to content

Commit

Permalink
fix timezone issue in wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
jemissik committed Aug 31, 2023
1 parent 2ac5f5d commit 6292864
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fetch3/optimize/fetch_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def get_model_sapflux(modelfile, obs_file, obs_var, output_var, hour_range=None,
obsdf = pd.read_csv(obs_file, parse_dates=[0])
# Converting time since sapfluxnet data is in GMT
if obsdf['TIMESTAMP'].dt.tz is not None:
obsdf["Timestamp"] = obsdf.TIMESTAMP.dt.tz_localize(None) + obsdf.TIMESTAMP.dt.tz.utcoffset(obsdf.TIMESTAMP[0])
obsdf["Timestamp"] = obsdf.TIMESTAMP.dt.tz_localize(None)
obsdf = obsdf.set_index("Timestamp")

# Read in model output
Expand Down Expand Up @@ -131,7 +131,7 @@ def get_model_nhl_trans(modelfile, obs_file, obs_var, output_var, hour_range=Non
obsdf = pd.read_csv(obs_file, parse_dates=[0])
# Converting time since sapfluxnet data is in GMT
if obsdf['TIMESTAMP'].dt.tz is not None:
obsdf["Timestamp"] = obsdf.TIMESTAMP.dt.tz_localize(None) + obsdf.TIMESTAMP.dt.tz.utcoffset(obsdf.TIMESTAMP[0])
obsdf["Timestamp"] = obsdf.TIMESTAMP.dt.tz_localize(None)
obsdf = obsdf.set_index("Timestamp")

# Read in model output
Expand Down

0 comments on commit 6292864

Please sign in to comment.