Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for issue #241 #243

Merged
merged 2 commits into from
Apr 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/pygrib/_pygrib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,8 @@ def setdates(gribmessage grb):
elif grb.has_key('stepRange'):
# if forecastTime doesn't exist, use end of stepRange.
ftime = grb['stepRange'] # computed key, uses stepUnits
if grb.has_key('stepUnits') and grb.stepUnits in _ftimedict:
grb.fcstimeunits = _ftimedict[grb.stepUnits]
# if it's a range, use the end of the range to define validDate
try:
ftime = float(ftime.split('-')[1])
Expand Down Expand Up @@ -873,9 +875,9 @@ cdef class gribmessage(object):
ftime = self['stepRange'] # computed key, uses stepUnits
if self.valid_key('stepType') and self['stepType'] != 'instant':
inventory.append(':fcst time %s %s (%s)'%\
(ftime,self.fcstimeunits,self.stepType))
(ftime,_ftimedict[self.stepUnits],self.stepType))
else:
inventory.append(':fcst time %s %s'% (ftime,self.fcstimeunits))
inventory.append(':fcst time %s %s'% (ftime,_ftimedict[self.stepUnits]))
elif self.valid_key('forecastTime'):
ftime = repr(self['forecastTime'])
inventory.append(':fcst time %s %s'% (ftime,self.fcstimeunits))
Expand Down
Loading