@@ -686,6 +686,8 @@ def setdates(gribmessage grb):
686
686
elif grb.has_key(' stepRange' ):
687
687
# if forecastTime doesn't exist, use end of stepRange.
688
688
ftime = grb[' stepRange' ] # computed key, uses stepUnits
689
+ if grb.has_key(' stepUnits' ) and grb.stepUnits in _ftimedict:
690
+ grb.fcstimeunits = _ftimedict[grb.stepUnits]
689
691
# if it's a range, use the end of the range to define validDate
690
692
try :
691
693
ftime = float (ftime.split(' -' )[1 ])
@@ -873,9 +875,9 @@ cdef class gribmessage(object):
873
875
ftime = self [' stepRange' ] # computed key, uses stepUnits
874
876
if self .valid_key(' stepType' ) and self [' stepType' ] != ' instant' :
875
877
inventory.append(' :fcst time %s %s (%s )' % \
876
- (ftime,self .fcstimeunits ,self .stepType))
878
+ (ftime,_ftimedict[ self .stepUnits] ,self .stepType))
877
879
else :
878
- inventory.append(' :fcst time %s %s ' % (ftime,self .fcstimeunits ))
880
+ inventory.append(' :fcst time %s %s ' % (ftime,_ftimedict[ self .stepUnits] ))
879
881
elif self .valid_key(' forecastTime' ):
880
882
ftime = repr (self [' forecastTime' ])
881
883
inventory.append(' :fcst time %s %s ' % (ftime,self .fcstimeunits))
0 commit comments