Commit 6de1d3f2 authored by Yan Zhaojun's avatar Yan Zhaojun
Browse files

test

parent 2e92f122
Pipeline #4613 failed with stage
in 0 seconds
...@@ -1976,18 +1976,20 @@ class IFSsimulator(): ...@@ -1976,18 +1976,20 @@ class IFSsimulator():
else: else:
ss = '_' ss = '_'
if self.information['dir_path'] == '/nfsdata/share/simulation-unittest/ifs_sim/': # if self.information['dir_path'] == '/nfsdata/share/simulation-unittest/ifs_sim/':
self.result_path = self.information['dir_path'] + \ # self.result_path = self.information['dir_path'] + \
self.information['result_path']+'/'+self.source+ss+result_day # self.information['result_path']+'/'+self.source+ss+result_day
else: # else:
home_path = os.environ['HOME'] # home_path = os.environ['HOME']
if home_path == '/home/yan': # if home_path == '/home/yan':
self.result_path = '../IFS_simData/'+self.source+ss+result_day # self.result_path = '../IFS_simData/'+self.source+ss+result_day
else: # else:
self.result_path = '/data/ifspip/CCD_ima/'+self.source+ss+result_day # self.result_path = '/data/ifspip/CCD_ima/'+self.source+ss+result_day
self.result_path= self.information['result_path']+self.source+ss+result_day
if os.path.isdir(self.result_path) == False: if os.path.isdir(self.result_path) == False:
os.mkdir(self.result_path) os.mkdir(self.result_path)
...@@ -5722,7 +5724,7 @@ class IFSsimulator(): ...@@ -5722,7 +5724,7 @@ class IFSsimulator():
############################################################################ ############################################################################
def runIFSsim(sourcein, configfile, dir_path, iLoop, debug, applyhole='no'): def runIFSsim(sourcein, configfile, dir_path, result_path,iLoop, debug, applyhole='no'):
""" """
...@@ -5756,9 +5758,25 @@ def runIFSsim(sourcein, configfile, dir_path, iLoop, debug, applyhole='no'): ...@@ -5756,9 +5758,25 @@ def runIFSsim(sourcein, configfile, dir_path, iLoop, debug, applyhole='no'):
simulate[iLoop].information['dir_path'] = dir_path simulate[iLoop].information['dir_path'] = dir_path
simulate[iLoop].information['debug'] = debug simulate[iLoop].information['debug'] = debug
simulate[iLoop].information['result_path'] = result_path
simulate[iLoop].simulate(sourcein, iLoop) simulate[iLoop].simulate(sourcein, iLoop)
return 1 return 1
############################## end ########################################## ############################## end ##########################################
if self.information['dir_path'] == '/nfsdata/share/simulation-unittest/ifs_sim/':
self.result_path = self.information['dir_path'] + \
self.information['result_path']+'/'+self.source+ss+result_day
else:
home_path = os.environ['HOME']
if home_path == '/home/yan':
self.result_path = '../IFS_simData/'+self.source+ss+result_day
else:
self.result_path = '/data/ifspip/CCD_ima/'+self.source+ss+result_day
\ No newline at end of file
...@@ -8,7 +8,6 @@ CCDygap = 8.116 ...@@ -8,7 +8,6 @@ CCDygap = 8.116
sky_fitsin =IFS_inputdata/FengshuaiData/NGC6397_S6102.fits sky_fitsin =IFS_inputdata/FengshuaiData/NGC6397_S6102.fits
result_path =ifs_sim_result
debug =yes debug =yes
......
...@@ -42,8 +42,12 @@ class TestDemoFunction(unittest.TestCase): ...@@ -42,8 +42,12 @@ class TestDemoFunction(unittest.TestCase):
sourcein = 'SCI' sourcein = 'SCI'
print(configfile) print(configfile)
debug=True debug=True
csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, 1, debug,'no')
result_path=dir_path+'ifs_sim_result'
csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, result_path, 1, debug,'no')
self.assertEqual( self.assertEqual(
1 , 1, 1 , 1,
"case 1: SCI sim passes.", "case 1: SCI sim passes.",
...@@ -77,7 +81,9 @@ class TestDemoFunction(unittest.TestCase): ...@@ -77,7 +81,9 @@ class TestDemoFunction(unittest.TestCase):
print(configfile) print(configfile)
debug=True debug=True
csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, 1, debug,'no') result_path=dir_path+'ifs_sim_result'
csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, result_path, 1, debug,'no')
self.assertEqual( self.assertEqual(
1 , 1, 1 , 1,
...@@ -112,7 +118,9 @@ class TestDemoFunction(unittest.TestCase): ...@@ -112,7 +118,9 @@ class TestDemoFunction(unittest.TestCase):
print(configfile) print(configfile)
debug=True debug=True
csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, 1, debug,'no') result_path=dir_path+'ifs_sim_result'
csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, result_path, 1, debug,'no')
self.assertEqual( self.assertEqual(
1 , 1, 1 , 1,
...@@ -147,7 +155,9 @@ class TestDemoFunction(unittest.TestCase): ...@@ -147,7 +155,9 @@ class TestDemoFunction(unittest.TestCase):
print(configfile) print(configfile)
debug=True debug=True
csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, 1, debug,'no') result_path=dir_path+'ifs_sim_result'
csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, result_path, 1, debug,'no')
self.assertEqual( self.assertEqual(
1 , 1, 1 , 1,
"case 4: sim passes.", "case 4: sim passes.",
...@@ -181,7 +191,9 @@ class TestDemoFunction(unittest.TestCase): ...@@ -181,7 +191,9 @@ class TestDemoFunction(unittest.TestCase):
print(configfile) print(configfile)
debug=True debug=True
csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, 1, debug,'yes') result_path=dir_path+'ifs_sim_result'
csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, result_path, 1, debug,'yes')
self.assertEqual( self.assertEqual(
1 , 1, 1 , 1,
"case 5: sim passes.", "case 5: sim passes.",
...@@ -215,7 +227,9 @@ class TestDemoFunction(unittest.TestCase): ...@@ -215,7 +227,9 @@ class TestDemoFunction(unittest.TestCase):
print(configfile) print(configfile)
debug=True debug=True
csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, 1, debug,'no') result_path=dir_path+'ifs_sim_result'
csst_ifs_sim.runIFSsim(sourcein, configfile, dir_path, result_path, 1, debug,'no')
self.assertEqual( self.assertEqual(
1 , 1, 1 , 1,
"case 6: sim passes.", "case 6: sim passes.",
......
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