Skip to content
GitLab
Explore
Projects
Groups
Snippets
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
11 months ago
by
Yan Zhaojun
Browse files
Options
Download
Email Patches
Plain Diff
debug
parent
61484640
develop
master
No related merge requests found
Pipeline
#4414
passed with stage
in 0 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
csst_mci_sim/csst_mci_sim.py
+39
-39
csst_mci_sim/csst_mci_sim.py
with
39 additions
and
39 deletions
+39
-39
csst_mci_sim/csst_mci_sim.py
+
39
-
39
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
:
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets