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_cpic_sim
Commits
e4bcf2d1
Commit
e4bcf2d1
authored
Apr 16, 2024
by
Chen Yili
Browse files
Upload New File
parent
9d85a905
Changes
1
Show whitespace changes
Inline
Side-by-side
tests/test_main.py
0 → 100644
View file @
e4bcf2d1
import
unittest
from
CpicImgSim
import
observation_simulation
,
quick_run
class
TestMain
(
unittest
.
TestCase
):
def
test_main
(
self
):
target_example
=
{
'name'
:
'test'
,
'cstar'
:
{
'magnitude'
:
0
,
'ra'
:
'120d'
,
'dec'
:
'40d'
,
'distance'
:
10
,
'sptype'
:
'F0III'
,
},
# 'stars': [
# {
# 'magnitude': 15,
# 'ra': '120d0m5s',
# 'dec': '40d00m3s',
# 'sptype': 'G0III',
# 'isblackbody': True
# },
# ],
# 'planets': [
# {
# 'radius': 20,
# 'pangle': 60,
# 'separation': 0.7,
# 'phase_angle': 90,
# }
# ]
}
quick_run
(
''
,
10
,
'f661'
,
1
,
1
,
30
)
quick_run
(
'*2.4/10(3,5)/15(-4,2)'
,
21
,
'f661'
,
1
,
1
,
30
)
# normal target
observation_simulation
(
target
=
target_example
,
skybg
=
21
,
expt
=
1
,
nframe
=
1
,
band
=
'f661'
,
emgain
=
30
,
obsid
=
51012345678
,
)
# bias-gain
observation_simulation
(
target
=
{},
skybg
=
None
,
expt
=
1
,
nframe
=
1
,
band
=
'f661'
,
emgain
=
30
,
obsid
=
50112345678
,
)
if
__name__
==
'__main__'
:
unittest
.
main
()
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