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
Liu Dezi
csst_msc_sim
Commits
ab15c00f
Commit
ab15c00f
authored
Apr 20, 2024
by
Zhang Xin
Browse files
modify unitest root
parent
86563808
Changes
3
Hide whitespace changes
Inline
Side-by-side
tests/test_SpecDisperse.py
View file @
ab15c00f
...
...
@@ -145,16 +145,22 @@ class TestSpecDisperse(unittest.TestCase):
def
__init__
(
self
,
methodName
=
'runTest'
):
super
(
TestSpecDisperse
,
self
).
__init__
(
methodName
)
self
.
filePath
(
'csst_
fz_gc0
'
)
self
.
filePath
(
'csst_
msc_sim/test_sls_and_straylight
'
)
# self.conff = conff
# self.throughputf = throughputf
def
filePath
(
self
,
file_name
):
fn
=
os
.
path
.
join
(
os
.
getenv
(
'UNIT_TEST_DATA_ROOT'
),
file_name
)
self
.
conff
=
os
.
path
.
join
(
fn
,
'CSST_GI2.conf'
)
self
.
throughputf
=
os
.
path
.
join
(
fn
,
'GI.Throughput.1st.fits'
)
self
.
testDir
=
fn
self
.
outDataFn
=
os
.
path
.
join
(
fn
,
'output'
)
if
os
.
path
.
isdir
(
self
.
outDataFn
):
pass
else
:
os
.
mkdir
(
self
.
outDataFn
)
def
test_rotate901
(
self
):
m
=
np
.
array
([[
1
,
2
,
3
,
4
,
5
],[
6
,
7
,
8
,
9
,
10
],[
11
,
12
,
13
,
14
,
15
],[
16
,
17
,
18
,
19
,
20
],[
21
,
22
,
23
,
24
,
25
]])
...
...
@@ -484,7 +490,7 @@ class TestSpecDisperse(unittest.TestCase):
print
(
'Spec double disperse test'
)
from
astropy.io
import
fits
fits
.
writeto
(
'test
.fits'
,
chip
.
img
.
array
,
overwrite
=
True
)
fits
.
writeto
(
os
.
path
.
join
(
self
.
outDataFn
,
'test_sls_doubleDisp
.fits'
)
,
chip
.
img
.
array
,
overwrite
=
True
)
# plt.figure()
# plt.imshow(chip.img.array)
...
...
tests/test_Straylight.py
View file @
ab15c00f
...
...
@@ -74,7 +74,7 @@ class TestStraylight(unittest.TestCase):
# print(file_name)
# fn = os.path.join(os.getenv('UNIT_TEST_DATA_ROOT'), file_name)
# self.pointingData = np.loadtxt(os.path.join(fn, 'Straylight_test.dat'), dtype=np.double)
self
.
filePath
(
'csst_
fz_gc0
'
)
self
.
filePath
(
'csst_
msc_sim/test_sls_and_straylight
'
)
self
.
filter
=
filter
self
.
grating
=
grating
...
...
tests/
de
t_effect_unit
_test
.py
→
tests/
tes
t_effect_unit.py
View file @
ab15c00f
...
...
@@ -17,7 +17,7 @@ class DetTest(unittest.TestCase):
def
__init__
(
self
,
methodName
=
'runTest'
):
super
(
DetTest
,
self
).
__init__
(
methodName
)
self
.
filePath
(
'csst_
fz_gc0
'
)
self
.
filePath
(
'csst_
msc_sim/test_sls_and_straylight
'
)
def
filePath
(
self
,
file_name
):
self
.
datafn
=
os
.
path
.
join
(
os
.
getenv
(
'UNIT_TEST_DATA_ROOT'
),
file_name
)
...
...
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