Julie Prestopnik wrote:
After looking into this further, it looks like the value of "nValueSup"
is twice what it should be for the following loop:
for i in range(int(round(nLenWSO-self.NTP)), nValueSup):
fFactor = fSlope*(i-nLenWSO+self.NTP)+fTdCorr
naWS[i-self.NTP2] = fFactor*naWS[i-self.NTP2]
"nValueSup" gets set with the following code:
nValueSup = nLenWSO-self.NTP + 4*3600/metro_constant.fTimeStep
In the case I'm working on "nLenWSO-self.NTP" is equal to 0 and
"4*3600/metro_constant.fTimeStep" is equal to 480 (but should be equal
to 240 because the length of naWS is 240).
So, it looks like part of or all of the nValueSup assignment statement
should be divided by two, but I don't really understand the science
behind this, so I'm not sure which part (or maybe I'm not correctly
interpreting the problem, and there is a different problem entirely).
Julie
_______________________________________________
METRo-developers mailing list
[email protected]
https://mail.gna.org/listinfo/metro-developers
Hi Julie,
You are absolutly right.
I have patched the code. Here are the differences in the files after
the commit:
> svn diff metro_preprocess_combine.py
Index: metro_preprocess_combine.py
===================================================================
--- metro_preprocess_combine.py (revision 107)
+++ metro_preprocess_combine.py (working copy)
@@ -263,9 +263,13 @@
for i in range(0, nLenWSO-self.NTP):
naWS[i-self.NTP2] = naWSO[i+self.NTP-1]
- # Relaxation des observations vers la prevision.
- # Constante de 4 heures / 4 hour relaxation constant
- nValueSup = nLenWSO-self.NTP + 4*3600/metro_constant.fTimeStep
+ # Relaxation of observation on the atmospheric forecast
+ # 4 hour relaxation constant
+ nTimeStepsInRelaxation = 4*3600/metro_constant.fTimeStep
+ # Check if there is long enough atmospheric forecast
+ if nLenWS < nTimeStepsInRelaxation:
+ nTimeStepsInRelaxation = nLenWS
+ nValueSup = nLenWSO-self.NTP + nTimeStepsInRelaxation
if self.NTP2 < 0:
nValueSup = int(round(nValueSup + self.NTP2))
else: # Cast anyway
I have committed the patch. You just have to get the revision 133 of
metro_preprocess_combine.py at:
http://svn.gna.org/viewcvs/*checkout*/metro/metro/trunk/src/frontend/executable_module/metro_preprocess_combine.py?rev=133
I have also added the bug (open and close in 5 minutes!) in the gna db:
https://gna.org/bugs/index.php?8853
Patch will be included in the next release of METRo, either 3.0.5 or 3.1.0.
Cheers,
Miguel
_______________________________________________
METRo-developers mailing list
[email protected]
https://mail.gna.org/listinfo/metro-developers