;+
; Contains the valid_hour function
;
; :Author:
; Gaƫlle Boisnard
;
; :History:
; 2004/03/29: Created
;
; 2004/03/29: Last Edit
;-
;
;+
; Transforms the string hour in a long integer, if possible
;
; :Returns:
; <return desc here>
;
; :Params:
; hour: in, required, type=string
; a string
;-
FUNCTION valid_hour, hour
tab01_24=['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '00', '01', '02', '03', '04', '05', '06', '07', $
'08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', $
'22', '23', '24']
hour=strtrim(hour, 2)
length=strlen(hour)
ind=where(length eq tab01_24, count)
if (count eq 0) then begin
return, 100
endif
return, long(length)
end