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
82283607
Commit
82283607
authored
Apr 14, 2024
by
Yan Zhaojun
Browse files
test
parent
a8c5018a
Pipeline
#4063
failed with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
csst_mci_sim/csst_mci_sim.py
View file @
82283607
...
@@ -2250,8 +2250,14 @@ class MCIsimulator():
...
@@ -2250,8 +2250,14 @@ class MCIsimulator():
stamp_img
=
galsim
.
Image
(
conv
,
copy
=
True
)
stamp_img
=
galsim
.
Image
(
conv
,
copy
=
True
)
stamp_img
.
setOrigin
(
0
,
0
)
stamp_img
.
setOrigin
(
0
,
0
)
stamp_img
.
scale
=
0.025
stamp_img
.
scale
=
0.025
self
.
log
.
info
(
'load star catlog 999999999'
)
self
.
log
.
info
(
'begining galsim.PhotonArray.makeFromImage'
)
self
.
log
.
info
(
'stamp_img.array.max()= %i'
%
(
stamp_img
.
array
.
max
()))
print
(
'stamp_img.array.max(): '
,
stamp_img
.
array
.
max
()
)
#################################################
#################################################
photons
=
galsim
.
PhotonArray
.
makeFromImage
(
stamp_img
,
max_flux
=
min
(
1.0
,
stamp_img
.
array
.
max
()
/
10000.0
))
photons
=
galsim
.
PhotonArray
.
makeFromImage
(
stamp_img
,
max_flux
=
min
(
1.0
,
stamp_img
.
array
.
max
()
/
10000.0
))
...
@@ -2259,7 +2265,7 @@ class MCIsimulator():
...
@@ -2259,7 +2265,7 @@ class MCIsimulator():
cx0
,
cy0
=
centroid
(
stamp_img
.
array
)
cx0
,
cy0
=
centroid
(
stamp_img
.
array
)
self
.
log
.
info
(
'
load star catlog 99999999999998
'
)
self
.
log
.
info
(
'
galsim.PhotonArray.makeFromImage
'
)
if
self
.
appFatt
:
if
self
.
appFatt
:
...
...
tests/test_mci_sim.py
View file @
82283607
...
@@ -15,6 +15,9 @@ from csst_mci_sim import csst_mci_sim
...
@@ -15,6 +15,9 @@ from csst_mci_sim import csst_mci_sim
import
sys
import
sys
import
faulthandler
class
TestDemoFunction
(
unittest
.
TestCase
):
class
TestDemoFunction
(
unittest
.
TestCase
):
def
test_mci_sim_1
(
self
):
def
test_mci_sim_1
(
self
):
...
@@ -32,6 +35,8 @@ class TestDemoFunction(unittest.TestCase):
...
@@ -32,6 +35,8 @@ class TestDemoFunction(unittest.TestCase):
The demo function returns the length of the input argument list.
The demo function returns the length of the input argument list.
This case aims to test whether the demo function returns `1` if input is `None`.
This case aims to test whether the demo function returns `1` if input is `None`.
"""
"""
faulthandler
.
enable
()
# demo function test
# demo function test
dir_path
=
os
.
path
.
join
(
os
.
environ
[
'UNIT_TEST_DATA_ROOT'
],
'mci_sim/'
)
dir_path
=
os
.
path
.
join
(
os
.
environ
[
'UNIT_TEST_DATA_ROOT'
],
'mci_sim/'
)
print
(
dir_path
)
print
(
dir_path
)
...
...
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