Skip to content

Commit

Permalink
Added fix to defining nowcast_source for tropical runs
Browse files Browse the repository at this point in the history
  • Loading branch information
jmpmcmanus committed Nov 20, 2023
1 parent 7f302c2 commit ea09b9d
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 ea09b9d

Please sign in to comment.