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_msc_sim
Commits
2eb4e6b5
Commit
2eb4e6b5
authored
Oct 28, 2024
by
Wei Chengliang
Browse files
update codestyle-PEP8
parent
1a887d44
Pipeline
#7144
passed with stage
in 0 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
tests/test_crosstalk.py
View file @
2eb4e6b5
...
...
@@ -51,7 +51,7 @@ def add_crosstalk(GSimg):
# 1*16 -> 2*8
newimg
=
chip_utils
.
formatRevert
(
newimg
)
return
newimg
return
newimg
# test FUNCTION --- END #
...
...
@@ -64,7 +64,7 @@ class detModule_coverage(unittest.TestCase):
def
test_add_crosstalk
(
self
):
nsecy
=
2
nsecx
=
8
ny
,
nx
=
1024
,
1024
ny
,
nx
=
1024
,
1024
dy
=
int
(
ny
/
nsecy
)
dx
=
int
(
nx
/
nsecx
)
mapclip
=
np
.
zeros
([
dy
,
int
(
nsecx
*
nsecy
*
dx
)])
...
...
@@ -74,18 +74,18 @@ class detModule_coverage(unittest.TestCase):
nsecy
=
1
nsecx
=
16
ny
,
nx
=
mapclip
.
array
.
shape
ny
,
nx
=
mapclip
.
array
.
shape
dy
=
int
(
ny
/
nsecy
)
dx
=
int
(
nx
/
nsecx
)
for
i
in
range
(
int
(
nsecy
*
nsecx
)):
gal
=
galsim
.
Gaussian
(
sigma
=
0.2
,
flux
=
500000
).
drawImage
(
nx
=
32
,
ny
=
32
).
array
py
=
np
.
random
.
randint
(
450
)
+
10
mapclip
.
array
[
py
:
py
+
32
,
int
(
i
*
dx
)
+
10
:
int
(
i
*
dx
)
+
42
]
+=
gal
tmap
=
chip_utils
.
formatRevert
(
mapclip
,
nsecy
=
1
,
nsecx
=
16
)
# 1*16 -> 2*8
temp
=
add_crosstalk
(
tmap
)
fig
=
plt
.
figure
(
figsize
=
(
20
,
60
))
fig
=
plt
.
figure
(
figsize
=
(
20
,
60
))
ax
=
plt
.
subplot
(
311
)
plt
.
imshow
(
np
.
log10
(
mapclip
.
array
+
1
),
origin
=
'lower'
,
cmap
=
'gray'
)
ax
=
plt
.
subplot
(
312
)
...
...
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