Commit 9351e427 authored by Yan Zhaojun's avatar Yan Zhaojun
Browse files

debug

parents aa40fa36 3c92e871
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
# csst_ifs_common
# csst_ifs_sim



@@ -15,7 +15,7 @@ Already a pro? Just edit this README.md and make it your own. Want to make it ea

```
cd existing_repo
git remote add origin https://csst-tb.bao.ac.cn/code/csst-l1/ifs/csst_ifs_common.git
git remote add origin https://csst-tb.bao.ac.cn/code/csst-sims/csst_ifs_sim.git
git branch -M main
git push -uf origin main
```
+48 −18
Original line number Diff line number Diff line
@@ -27,8 +27,14 @@ 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

"""
@@ -235,11 +241,15 @@ 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),
@@ -1937,7 +1947,7 @@ class IFSsimulator():

###############################################################################
###############################################################################
    def configure(self, simnumber):
    def configure(self, sourcein,  dir_path, result_path, simnumber, debug, applyhole):
        """


@@ -1962,16 +1972,25 @@ 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 self.information['holemask'] == 'yes':
            if applyhole == 'yes':
                ss = '_with_hole_'
            else:
                ss = '_no_hole_'
@@ -1979,18 +1998,23 @@ 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:
        # 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']
        #     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 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
                
        self.result_path= self.information['result_path']+'/'+self.source+ss+result_day 
        print(self.information['result_path'])

        if os.path.isdir(self.result_path) == False:
            os.mkdir(self.result_path)
@@ -5467,7 +5491,8 @@ class IFSsimulator():
        self.source = sourcein

        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']

@@ -5737,7 +5762,7 @@ class IFSsimulator():
############################################################################


def runIFSsim(sourcein, configfile, dir_path, iLoop, debug, applyhole='no'):
def runIFSsim(sourcein, configfile, dir_path, result_path, iLoop, debug, applyhole):
    """


@@ -5762,15 +5787,20 @@ def runIFSsim(sourcein, configfile, dir_path, iLoop, debug, applyhole='no'):
    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['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)

+1.86 MiB

File added.

No diff preview for this file type.

+0 −1
Original line number Diff line number Diff line
@@ -8,7 +8,6 @@ CCDygap = 8.116

sky_fitsin  =IFS_inputdata/FengshuaiData/NGC6397_S6102.fits

result_path =ifs_sim_result

debug =yes

+4 −4
Original line number Diff line number Diff line
numpy==1.23.3
numpy==1.23.5
scipy==1.9.2
setuptools==65.5.1
pandas==1.2.3
setuptools==65.6.3
pandas==1.5.3
julian==0.14
astropy==5.1
tqdm==4.59.0
tqdm==4.64.1
galsim==2.4.9
Loading