Commit b732d525 authored by Miguel Tremblay's avatar Miguel Tremblay
Browse files

Correct a bug in the precipitation amount. The amount have been shifted to...

Correct a bug in the precipitation amount.   The amount have been shifted to the left in the arrays, ie they fall 30 secondes sooner.
parent 073a181e
......@@ -121,6 +121,7 @@ class Metro_preprocess_interpol_forecast(Metro_preprocess):
# Used in fsint2.
npFT = \
wf_original_data.get_matrix_col('FORECAST_TIME')
nHourStart = int(metro_date.get_hour(npFT[0]))
nbrHours = metro_date.get_elapsed_time(npFT[-1], \
npFT[0]) + 1
......@@ -229,14 +230,21 @@ class Metro_preprocess_interpol_forecast(Metro_preprocess):
fMax = npQP.max()
npQP = numpy.where(npQP < 0, fMax, npQP)
# Compute the amount fell at each time step
npQP = npQP - metro_util.shift_right(npQP, 0)
npSN = npSN - metro_util.shift_right(npSN, 0)
npRA = npRA - metro_util.shift_right(npRA, 0)
# Interpolate these values at each time step
npQP = metro_util.interpolate(self.npTime, npQP)
npSN = metro_util.interpolate(self.npTime, npSN)
npRA = metro_util.interpolate(self.npTime, npRA)
# Shift all the values to have them started at the right time
npQP = metro_util.shift_left(npQP, 0)
npSN = metro_util.shift_left(npSN, 0)
npRA = metro_util.shift_left(npRA, 0)
npQP = npQP *10e-4 # Set it in meter
npQP = npQP / 3600.0 # Convert by second
npQP = numpy.where(npQP < 0, 0, npQP)
......@@ -461,4 +469,4 @@ class Metro_preprocess_interpol_forecast(Metro_preprocess):
npFA = numpy.array(lFA)
npFA = metro_util.interpolate(self.npTime, npFA)
wf_interpolated_data.append_matrix_col('FA', npFA)
\ No newline at end of file
wf_interpolated_data.append_matrix_col('FA', npFA)
......@@ -258,7 +258,7 @@ def shift_left(npInput, fValueAdded=0):
numpy.concatenate
Description: This method shift the value of the array at left, i.e.
npInput[n] becomes npInput[n] for all n in [1..len(npInput)-1]. The
npInput[n] becomes npInput[n-1] for all n in [1..len(npInput)-1]. The
value fValueAdded is added at the end,
i.e. npInput[len(npInput)-1]=fValueAdded
......
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