Loading csst_ifs_sim/csst_ifs_sim.py +19 −50 Original line number Original line Diff line number Diff line Loading @@ -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 """ """ Loading Loading @@ -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), 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._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_' Loading @@ -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) Loading Loading @@ -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'] 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 = 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) Loading Loading
csst_ifs_sim/csst_ifs_sim.py +19 −50 Original line number Original line Diff line number Diff line Loading @@ -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 """ """ Loading Loading @@ -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), 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._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_' Loading @@ -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) Loading Loading @@ -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'] 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 = 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) Loading