Commit 06298943 authored by Yan Zhaojun's avatar Yan Zhaojun
Browse files

debug

parent 9351e427
Pipeline #6966 failed with stage
in 0 seconds
...@@ -27,14 +27,7 @@ from scipy.interpolate import interp1d ...@@ -27,14 +27,7 @@ from scipy.interpolate import interp1d
import astropy.coordinates as coord import astropy.coordinates as coord
import ctypes import ctypes
import sys import sys
<<<<<<< HEAD
sys.path.append('./csst_ifs_sim') sys.path.append('./csst_ifs_sim')
=======
from .ifs_so import cdm03bidir
##sys.path.append('./csst_ifs_sim')
>>>>>>> 3c92e871e126af516215590e5354597cadc796d9
conf.auto_max_age = None conf.auto_max_age = None
""" """
...@@ -241,15 +234,11 @@ class CDM03bidir(): ...@@ -241,15 +234,11 @@ class CDM03bidir():
################################################################################# #################################################################################
###modify ###modify
#sys.path.append('../so') #sys.path.append('../so')
<<<<<<< HEAD
try: try:
from ifs_so import cdm03bidir from ifs_so import cdm03bidir
except: except:
from .ifs_so import cdm03bidir from .ifs_so import cdm03bidir
=======
>>>>>>> 3c92e871e126af516215590e5354597cadc796d9
# from ifs_so.cdm03.cpython-38-x86_64-linux-gnu import cdm03bidir # from ifs_so.cdm03.cpython-38-x86_64-linux-gnu import cdm03bidir
# import cdm03bidir # import cdm03bidir
CTIed = cdm03bidir.cdm03(np.asfortranarray(data), CTIed = cdm03bidir.cdm03(np.asfortranarray(data),
...@@ -1947,7 +1936,7 @@ class IFSsimulator(): ...@@ -1947,7 +1936,7 @@ class IFSsimulator():
############################################################################### ###############################################################################
############################################################################### ###############################################################################
def configure(self, sourcein, dir_path, result_path, simnumber, debug, applyhole): def configure(self, simnumber):
""" """
...@@ -1972,25 +1961,16 @@ class IFSsimulator(): ...@@ -1972,25 +1961,16 @@ class IFSsimulator():
self._createEmpty() self._createEmpty()
self.information['dir_path']=dir_path
self.information['result_path']=result_path
self.information['debug'] = debug
self.source=sourcein
self.simnumber=simnumber
############################################################ ############################################################
now = datetime.utcnow() now = datetime.utcnow()
result_day = now.strftime("%Y-%m-%d") result_day = now.strftime("%Y-%m-%d")
# self.information['holemask']
if self.source == 'LAMP': if self.source == 'LAMP':
if applyhole == 'yes': if self.information['holemask'] == 'yes':
ss = '_with_hole_' ss = '_with_hole_'
else: else:
ss = '_no_hole_' ss = '_no_hole_'
...@@ -1998,23 +1978,18 @@ class IFSsimulator(): ...@@ -1998,23 +1978,18 @@ 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']
# 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
home_path = os.environ['HOME']
if home_path == '/home/yan':
self.result_path= self.information['result_path']+'/'+self.source+ss+result_day self.result_path = '../IFS_simData/'+self.source+ss+result_day
print(self.information['result_path']) else:
self.result_path = '/data/ifspip/CCD_ima/'+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)
...@@ -5491,8 +5466,7 @@ class IFSsimulator(): ...@@ -5491,8 +5466,7 @@ class IFSsimulator():
self.source = sourcein self.source = sourcein
self.simnumber = simnumber self.simnumber = simnumber
self.configure(simnumber) # print the configfile name and path;
#self.configure(simnumber,dir_path,result_path) # print the configfile name and path;
self.debug = self.information['debug'] self.debug = self.information['debug']
...@@ -5762,7 +5736,7 @@ class IFSsimulator(): ...@@ -5762,7 +5736,7 @@ class IFSsimulator():
############################################################################ ############################################################################
def runIFSsim(sourcein, configfile, dir_path, result_path, iLoop, debug, applyhole): def runIFSsim(sourcein, configfile, dir_path, iLoop, debug, applyhole='no'):
""" """
...@@ -5787,20 +5761,15 @@ def runIFSsim(sourcein, configfile, dir_path, result_path, iLoop, debug, applyho ...@@ -5787,20 +5761,15 @@ def runIFSsim(sourcein, configfile, dir_path, result_path, iLoop, debug, applyho
simulate = dict() simulate = dict()
simulate[iLoop] = IFSsimulator(configfile) simulate[iLoop] = IFSsimulator(configfile)
simulate[iLoop].configure(sourcein, dir_path, result_path, iLoop, debug, applyhole) # load the configfile;
if applyhole == 'yes' and sourcein == 'LAMP': if applyhole == 'yes' and sourcein == 'LAMP':
simulate[iLoop].information['holemask'] = 'yes' simulate[iLoop].information['holemask'] = 'yes'
else: else:
simulate[iLoop].information['holemask'] = 'no' simulate[iLoop].information['holemask'] = 'no'
### dir_path = os.path.join(os.environ['UNIT_TEST_DATA_ROOT'], 'ifs_sim/') ### dir_path = os.path.join(os.environ['UNIT_TEST_DATA_ROOT'], 'ifs_sim/')
# simulate[iLoop].information['dir_path'] = dir_path simulate[iLoop].information['dir_path'] = dir_path
# simulate[iLoop].information['debug'] = debug
# simulate[iLoop].information['result_path'] = result_path simulate[iLoop].information['debug'] = debug
simulate[iLoop].simulate(sourcein, iLoop) simulate[iLoop].simulate(sourcein, iLoop)
......
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