Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-sims
csst_mci_sim
Commits
2b7c8ba3
Commit
2b7c8ba3
authored
May 09, 2024
by
Yan Zhaojun
Browse files
debug
parent
61484640
Pipeline
#4414
passed with stage
in 0 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
csst_mci_sim/csst_mci_sim.py
View file @
2b7c8ba3
...
...
@@ -3447,43 +3447,43 @@ class MCIsimulator():
data
[
i
,
-
j
-
1
,]
-=
overload
sum
+=
overload
else
:
#
else:
#loop over each column, as bleeding is modelled column-wise
for
i
,
column
in
enumerate
(
data
.
T
):
sum
=
0.
for
j
,
value
in
enumerate
(
column
):
#first round - from bottom to top (need to half the bleeding)
overload
=
value
-
self
.
information
[
'fullwellcapacity'
]
if
overload
>
0.
:
overload
/=
2.
#self.image[j, i] -= overload
data
[
j
,
i
]
-=
overload
sum
+=
overload
elif
sum
>
0.
:
if
-
overload
>
sum
:
overload
=
-
sum
#self.image[j, i] -= overload
data
[
j
,
i
]
-=
overload
sum
+=
overload
################################
for
i
,
column
in
enumerate
(
data
.
T
):
sum
=
0.
for
j
,
value
in
enumerate
(
column
[::
-
1
]):
#second round - from top to bottom (bleeding was half'd already, so now full)
overload
=
value
-
self
.
information
[
'fullwellcapacity'
]
if
overload
>
0.
:
#self.image[-j-1, i] -= overload
data
[
-
j
-
1
,
i
]
-=
overload
#
#loop over each column, as bleeding is modelled column-wise
#
for i, column in enumerate(data.T):
#
sum = 0.
#
for j, value in enumerate(column):
#
#first round - from bottom to top (need to half the bleeding)
#
overload = value - self.information['fullwellcapacity']
#
if overload > 0.:
#
overload /= 2.
#
#self.image[j, i] -= overload
#
data[j, i] -= overload
#
sum += overload
#
elif sum > 0.:
#
if -overload > sum:
#
overload = -sum
#
#self.image[j, i] -= overload
#
data[j, i] -= overload
#
sum += overload
#
################################
#
for i, column in enumerate(data.T):
#
sum = 0.
#
for j, value in enumerate(column[::-1]):
#
#second round - from top to bottom (bleeding was half'd already, so now full)
#
overload = value - self.information['fullwellcapacity']
#
if overload > 0.:
#
#self.image[-j-1, i] -= overload
#
data[-j-1, i] -= overload
sum
+=
overload
elif
sum
>
0.
:
if
-
overload
>
sum
:
overload
=
-
sum
#self.image[-j-1, i] -= overload
data
[
-
j
-
1
,
i
]
-=
overload
sum
+=
overload
#
sum += overload
#
elif sum > 0.:
#
if -overload > sum:
#
overload = -sum
#
#self.image[-j-1, i] -= overload
#
data[-j-1, i] -= overload
#
sum += overload
######print('Applying column bleeding finished.......')
return
data
...
...
@@ -5216,11 +5216,11 @@ class MCIsimulator():
print
(
'applyPRNUeffect'
)
####################################################################
#
if self.source in sourcelist:
#
if self.cosmicRays:
if
self
.
source
in
sourcelist
:
if
self
.
cosmicRays
:
#
self.addCosmicRays()
#
print('addCosmicRays finisth')
self
.
addCosmicRays
()
print
(
'addCosmicRays finisth'
)
##################################################
if
self
.
skyback
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment