Commit 89a06bea authored by Yan Zhaojun's avatar Yan Zhaojun
Browse files

update

parent 4f399bbd
Pipeline #3929 passed with stage
in 0 seconds
......@@ -3296,6 +3296,8 @@ class IFSsimulator():
alfa=1
#############################3
for klam in range(6000):
ilam=klam*alfa
......@@ -4738,8 +4740,11 @@ def runIFSsim(sourcein, skyfitsin, configfile, iLoop, CSST_unittest, applyhole='
##############################################################################################
if __name__ == "__main__":
CSST_unittest=True
sourcein='SCI'
CSST_unittest=False
applyhole='no'
if CSST_unittest:
dir_path=os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim')
......@@ -4747,16 +4752,36 @@ if __name__ == "__main__":
dir_path='../'
configfile=dir_path+'IFS_data/IFS_sim_C90.config'
configfile0=dir_path+'IFS_data/IFS_sim_C90.config'
skyfitsin =dir_path+'IFS_inputdata/FengshuaiData/NGC6397_S6102.fits'
if len(sys.argv[:])<2:
configfile=configfile0
if len(sys.argv[:])>=2:
configfile=sys.argv[1]
if not os.path.exists(fonfigfile):
print('The given input fonfigfile path is wrong......')
sys.exit(1)
if len(sys.argv[:])>=3:
sourcein=sys.argv[2]
if sourcein not in ['BIAS', 'DARK','LAMP','FLAT' ,'SCI']:
print('The input sourcein parameter input is wrong......')
sys.exit(1)
if len(sys.argv[:])>=4:
applyhole=sys.argv[3]
if sourcein not in ['yes', 'no']:
print('The input applyhole parameter should be yes or no!')
sys.exit(1)
#############################################################
################## sky test ############################
sourcein='SCI'
applyhole='no'
exposureNum=1
runIFSsim(sourcein, skyfitsin, configfile, 1, CSST_unittest, applyhole)
......
......@@ -10,6 +10,7 @@ Modified-History:
"""
import unittest
import os
from csst_ifs_sim import csst_ifs_sim
......@@ -19,7 +20,7 @@ class TestDemoFunction(unittest.TestCase):
"""
Aim
---
Test ifs sim function.
Test ifs sim function: SCI case.
Criteria
--------
......@@ -37,9 +38,141 @@ class TestDemoFunction(unittest.TestCase):
self.assertTrue(
1 == 1,
"Single-argument case passes.",
"case 1: SCI sim passes.",
)
def test_ifs_sim_2(self):
"""
Aim
---
Test ifs sim function: BIAS case.
Criteria
--------
Pass if the demo function returns `1`.
Details
-------
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`.
"""
# demo function test
dir_path=os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim/IFS_inputData/configData')
csst_ifs_sim(dir_path,'BIAS')
self.assertTrue(
1 == 1,
"case 2 :BIAS sim passes.",
)
def test_ifs_sim_3(self):
"""
Aim
---
Test ifs sim function: DARK case.
Criteria
--------
Pass if the demo function returns `1`.
Details
-------
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`.
"""
# demo function test
dir_path=os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim/IFS_inputData/configData')
csst_ifs_sim(dir_path,'DARK')
self.assertTrue(
1 == 1,
"case 3 :DARK sim passes.",
)
def test_ifs_sim_4(self):
"""
Aim
---
Test ifs sim function: LAMP case.
Criteria
--------
Pass if the demo function returns `1`.
Details
-------
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`.
"""
# demo function test
dir_path=os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim/IFS_inputData/configData')
csst_ifs_sim(dir_path,'LAMP')
self.assertTrue(
1 == 1,
"case 4 :LAMP sim passes.",
)
def test_ifs_sim_5(self):
"""
Aim
---
Test ifs sim function: FLAT case.
Criteria
--------
Pass if the demo function returns `1`.
Details
-------
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`.
"""
# demo function test
dir_path=os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim/IFS_inputData/configData')
csst_ifs_sim(dir_path,'FLAT')
self.assertTrue(
1 == 1,
"case 5 :FLAT sim passes.",
)
def test_ifs_sim_6(self):
"""
Aim
---
Test ifs sim function: hole case.
Criteria
--------
Pass if the demo function returns `1`.
Details
-------
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`.
"""
# demo function test
dir_path=os.path.join(os.environ['UNIT_TEST_DATA_ROOT'],'ifs_sim/IFS_inputData/configData')
csst_ifs_sim(dir_path,'BIAS', 'yes')
self.assertTrue(
1 == 1,
"case 6 :Hole sim passes.",
)
# def test_demo_function_2(self):
# """
# Aim
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment