Skip to content

Commit

Permalink
Merge pull request #7 from RENCI/nowcastFix
Browse files Browse the repository at this point in the history
Added fix to defining nowcast_source for tropical runs
  • Loading branch information
PhillipsOwen authored Nov 20, 2023
2 parents 7f302c2 + ea09b9d commit 95e478b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/common/pg_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,15 @@ def get_station_data(self, **kwargs) -> str:
end_date = forecast_data['time_stamp'].iloc[-1]

# get nowcast data_source from forecast data_source
nowcast_source = 'NOWCAST_' + "_".join(kwargs['data_source'].split('_')[1:])
# check if data_source is tropical
if kwargs['data_source'][:2] == 'al':
# if tropical split data source and replace second value (OFCL) with NOWCAST
source_parts = kwargs['data_source'].split('_')
source_parts[1] = 'NOWCAST'
nowcast_source = "_".join(source_parts)
else:
# if synoptic split data source and replace fist value (GFSFORECAST) with NOWCAST
nowcast_source = 'NOWCAST_' + "_".join(kwargs['data_source'].split('_')[1:])

# get obs and nowcast data
obs_data = self.get_obs_station_data(kwargs['station_name'], start_date, end_date, nowcast_source)
Expand Down

0 comments on commit 95e478b

Please sign in to comment.