+ added export_param function to export parameters to "palma definition files" (param...
[qpalma.git] / python / computeSpliceWeights.py
index 8ed8183..7f9f048 100644 (file)
@@ -26,24 +26,24 @@ def calculateWeights(plf, scores):
    for k in range(len(scores)):
       value = scores[k]
       Lower = len([elem for elem in plf.limits if elem <= value])
-      # because we count from 0 in python
-      Lower -= 1
-      Upper = Lower+1 ; # x-werte bleiben fest
 
-      print value,Lower,Upper
 
       if Lower == 0:
          currentWeight[0] += 1
       elif Lower == len(plf.limits):
          currentWeight[-1] += 1
       else:
+         # because we count from 0 in python
+         Lower -= 1
+         Upper = Lower+1 ; # x-werte bleiben fest
+         #print value,Lower,Upper
          weightup  = 1.0*(value - plf.limits[Lower]) / (plf.limits[Upper] - plf.limits[Lower])
          weightlow = 1.0*(plf.limits[Upper] - value) / (plf.limits[Upper] - plf.limits[Lower])
          currentWeight[Upper] = currentWeight[Upper] + weightup
          currentWeight[Lower] = currentWeight[Lower] + weightlow
 
-         print plf.limits[Lower],plf.limits[Upper]
-         print weightup,weightlow,currentWeight[Upper],currentWeight[Lower]
+         #print plf.limits[Lower],plf.limits[Upper]
+         #print weightup,weightlow,currentWeight[Upper],currentWeight[Lower]
 
    return currentWeight