Commit 2b7c8ba3 authored by Yan Zhaojun's avatar Yan Zhaojun
Browse files

debug

parent 61484640
Pipeline #4414 passed with stage
in 0 seconds
...@@ -3447,43 +3447,43 @@ class MCIsimulator(): ...@@ -3447,43 +3447,43 @@ class MCIsimulator():
data[i,-j-1,] -= overload data[i,-j-1,] -= overload
sum += overload sum += overload
else: # else:
#loop over each column, as bleeding is modelled column-wise # #loop over each column, as bleeding is modelled column-wise
for i, column in enumerate(data.T): # for i, column in enumerate(data.T):
sum = 0. # sum = 0.
for j, value in enumerate(column): # for j, value in enumerate(column):
#first round - from bottom to top (need to half the bleeding) # #first round - from bottom to top (need to half the bleeding)
overload = value - self.information['fullwellcapacity'] # overload = value - self.information['fullwellcapacity']
if overload > 0.: # if overload > 0.:
overload /= 2. # overload /= 2.
#self.image[j, i] -= overload # #self.image[j, i] -= overload
data[j, i] -= overload # data[j, i] -= overload
sum += overload # sum += overload
elif sum > 0.: # elif sum > 0.:
if -overload > sum: # if -overload > sum:
overload = -sum # overload = -sum
#self.image[j, i] -= overload # #self.image[j, i] -= overload
data[j, i] -= overload # data[j, i] -= overload
sum += overload # sum += overload
################################ # ################################
for i, column in enumerate(data.T): # for i, column in enumerate(data.T):
sum = 0. # sum = 0.
for j, value in enumerate(column[::-1]): # for j, value in enumerate(column[::-1]):
#second round - from top to bottom (bleeding was half'd already, so now full) # #second round - from top to bottom (bleeding was half'd already, so now full)
overload = value - self.information['fullwellcapacity'] # overload = value - self.information['fullwellcapacity']
if overload > 0.: # if overload > 0.:
#self.image[-j-1, i] -= overload # #self.image[-j-1, i] -= overload
data[-j-1, i] -= overload # data[-j-1, i] -= overload
sum += overload # sum += overload
elif sum > 0.: # elif sum > 0.:
if -overload > sum: # if -overload > sum:
overload = -sum # overload = -sum
#self.image[-j-1, i] -= overload # #self.image[-j-1, i] -= overload
data[-j-1, i] -= overload # data[-j-1, i] -= overload
sum += overload # sum += overload
######print('Applying column bleeding finished.......') ######print('Applying column bleeding finished.......')
return data return data
...@@ -5216,11 +5216,11 @@ class MCIsimulator(): ...@@ -5216,11 +5216,11 @@ class MCIsimulator():
print('applyPRNUeffect') print('applyPRNUeffect')
#################################################################### ####################################################################
# if self.source in sourcelist: if self.source in sourcelist:
# if self.cosmicRays: if self.cosmicRays:
# self.addCosmicRays() self.addCosmicRays()
# print('addCosmicRays finisth') print('addCosmicRays finisth')
################################################## ##################################################
if self.skyback: if self.skyback:
......
Supports Markdown
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