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():
...
@@ -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
:
...
...
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