Loading csst_ifs_sim/csst_ifs_sim.py +19 −50 Original line number Diff line number Diff line Loading @@ -27,14 +27,7 @@ from scipy.interpolate import interp1d import astropy.coordinates as coord import ctypes import sys <<<<<<< HEAD sys.path.append('./csst_ifs_sim') ======= from .ifs_so import cdm03bidir ##sys.path.append('./csst_ifs_sim') >>>>>>> 3c92e871e126af516215590e5354597cadc796d9 conf.auto_max_age = None """ Loading Loading @@ -241,15 +234,11 @@ class CDM03bidir(): ################################################################################# ###modify #sys.path.append('../so') <<<<<<< HEAD try: from ifs_so import cdm03bidir except: from .ifs_so import cdm03bidir ======= >>>>>>> 3c92e871e126af516215590e5354597cadc796d9 # from ifs_so.cdm03.cpython-38-x86_64-linux-gnu import cdm03bidir # import cdm03bidir CTIed = cdm03bidir.cdm03(np.asfortranarray(data), Loading Loading @@ -1947,7 +1936,7 @@ class IFSsimulator(): ############################################################################### ############################################################################### def configure(self, sourcein, dir_path, result_path, simnumber, debug, applyhole): def configure(self, simnumber): """ Loading @@ -1972,25 +1961,16 @@ class IFSsimulator(): 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() result_day = now.strftime("%Y-%m-%d") # self.information['holemask'] if self.source == 'LAMP': if applyhole == 'yes': if self.information['holemask'] == 'yes': ss = '_with_hole_' else: ss = '_no_hole_' Loading @@ -1998,23 +1978,18 @@ class IFSsimulator(): else: ss = '_' # 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 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= self.information['result_path']+'/'+self.source+ss+result_day print(self.information['result_path']) self.result_path = '../IFS_simData/'+self.source+ss+result_day else: self.result_path = '/data/ifspip/CCD_ima/'+self.source+ss+result_day if os.path.isdir(self.result_path) == False: os.mkdir(self.result_path) Loading Loading @@ -5491,8 +5466,7 @@ class IFSsimulator(): self.source = sourcein self.simnumber = simnumber #self.configure(simnumber,dir_path,result_path) # print the configfile name and path; self.configure(simnumber) # print the configfile name and path; self.debug = self.information['debug'] Loading Loading @@ -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'): """ Loading @@ -5787,20 +5761,15 @@ def runIFSsim(sourcein, configfile, dir_path, result_path, iLoop, debug, applyho simulate = dict() simulate[iLoop] = IFSsimulator(configfile) simulate[iLoop].configure(sourcein, dir_path, result_path, iLoop, debug, applyhole) # load the configfile; if applyhole == 'yes' and sourcein == 'LAMP': simulate[iLoop].information['holemask'] = 'yes' else: simulate[iLoop].information['holemask'] = 'no' ### dir_path = os.path.join(os.environ['UNIT_TEST_DATA_ROOT'], 'ifs_sim/') # simulate[iLoop].information['dir_path'] = dir_path # simulate[iLoop].information['debug'] = debug simulate[iLoop].information['dir_path'] = dir_path # simulate[iLoop].information['result_path'] = result_path simulate[iLoop].information['debug'] = debug simulate[iLoop].simulate(sourcein, iLoop) Loading Loading
csst_ifs_sim/csst_ifs_sim.py +19 −50 Original line number Diff line number Diff line Loading @@ -27,14 +27,7 @@ from scipy.interpolate import interp1d import astropy.coordinates as coord import ctypes import sys <<<<<<< HEAD sys.path.append('./csst_ifs_sim') ======= from .ifs_so import cdm03bidir ##sys.path.append('./csst_ifs_sim') >>>>>>> 3c92e871e126af516215590e5354597cadc796d9 conf.auto_max_age = None """ Loading Loading @@ -241,15 +234,11 @@ class CDM03bidir(): ################################################################################# ###modify #sys.path.append('../so') <<<<<<< HEAD try: from ifs_so import cdm03bidir except: from .ifs_so import cdm03bidir ======= >>>>>>> 3c92e871e126af516215590e5354597cadc796d9 # from ifs_so.cdm03.cpython-38-x86_64-linux-gnu import cdm03bidir # import cdm03bidir CTIed = cdm03bidir.cdm03(np.asfortranarray(data), Loading Loading @@ -1947,7 +1936,7 @@ class IFSsimulator(): ############################################################################### ############################################################################### def configure(self, sourcein, dir_path, result_path, simnumber, debug, applyhole): def configure(self, simnumber): """ Loading @@ -1972,25 +1961,16 @@ class IFSsimulator(): 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() result_day = now.strftime("%Y-%m-%d") # self.information['holemask'] if self.source == 'LAMP': if applyhole == 'yes': if self.information['holemask'] == 'yes': ss = '_with_hole_' else: ss = '_no_hole_' Loading @@ -1998,23 +1978,18 @@ class IFSsimulator(): else: ss = '_' # 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 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= self.information['result_path']+'/'+self.source+ss+result_day print(self.information['result_path']) self.result_path = '../IFS_simData/'+self.source+ss+result_day else: self.result_path = '/data/ifspip/CCD_ima/'+self.source+ss+result_day if os.path.isdir(self.result_path) == False: os.mkdir(self.result_path) Loading Loading @@ -5491,8 +5466,7 @@ class IFSsimulator(): self.source = sourcein self.simnumber = simnumber #self.configure(simnumber,dir_path,result_path) # print the configfile name and path; self.configure(simnumber) # print the configfile name and path; self.debug = self.information['debug'] Loading Loading @@ -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'): """ Loading @@ -5787,20 +5761,15 @@ def runIFSsim(sourcein, configfile, dir_path, result_path, iLoop, debug, applyho simulate = dict() simulate[iLoop] = IFSsimulator(configfile) simulate[iLoop].configure(sourcein, dir_path, result_path, iLoop, debug, applyhole) # load the configfile; if applyhole == 'yes' and sourcein == 'LAMP': simulate[iLoop].information['holemask'] = 'yes' else: simulate[iLoop].information['holemask'] = 'no' ### dir_path = os.path.join(os.environ['UNIT_TEST_DATA_ROOT'], 'ifs_sim/') # simulate[iLoop].information['dir_path'] = dir_path # simulate[iLoop].information['debug'] = debug simulate[iLoop].information['dir_path'] = dir_path # simulate[iLoop].information['result_path'] = result_path simulate[iLoop].information['debug'] = debug simulate[iLoop].simulate(sourcein, iLoop) Loading