Commit 6572257f authored by Miguel Tremblay's avatar Miguel Tremblay
Browse files

Change the condition to indicate there is less than 3 hours of observations.

This was a bug identified. See this email thread for more information:
https://mail.gna.org/public/metro-developers/2013-01/msg00000.html
parent b732d525
......@@ -215,8 +215,7 @@ class Metro_preprocess_qa_qc_observation(Metro_preprocess):
npTime = ro_controlled_data.get_matrix_col('Time')
npCheck = metro_util.get_difference_array(npTime)
# If a gap of more than nGapMinuteObservation
# minutes is identify, cut the value before.
npCheck = metro_util.get_difference_array(npTime)
# minutes is identified, cut the value before.
npBad = numpy.where( npCheck > metro_constant.\
nGapMinuteObservation*60, 1, 0)
npBadIndice = (numpy.nonzero(npBad))[0]
......@@ -288,7 +287,8 @@ class Metro_preprocess_qa_qc_observation(Metro_preprocess):
if sStart_time == "":
return
# Check if the observation are not before the start of the roadcast if specified.
# Check if the observation are not before the start of the roadcast
# if specified.
fStart_time = metro_date.parse_date_string(sStart_time)
npOT = ro_controlled_data.get_matrix_col('Time')\
+nHourStart*3600
......@@ -418,16 +418,15 @@ class Metro_preprocess_qa_qc_observation(Metro_preprocess):
bNoObs = [0, 0, 0, 0]
# Check if there is any data for initialisation
fDeltaT = observation_data.get_attribute('DELTA_T')
# No intersection between the forecast and the obsevations
if fDeltaT <= 0:
bNoObs[0] = 1
# Less than 3 hours of observation
if nNbr30Seconds-fDeltaT*3600/30. < metro_constant.nThreeHours*3600/30:
# Less than 3 hours of observation (3*3600/30 = 360)
if nNbr30Seconds < 360:
bNoObs[1] = 1
# No valid observation
if len(npAT) == 0:
bNoObs[2] = 1
# One valid observation
if len(npAT) == 1:
bNoObs[3] = 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment