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

test

parent 0f353503
Loading
Loading
Loading
Loading
Loading
+14 −11
Original line number Diff line number Diff line
@@ -319,13 +319,14 @@ def CCDnonLinearityModel(data, beta=6e-7):

class StrayLight(object):

    def __init__(self, jtime = 2460843., sat = np.array([0,0,0]), radec = np.array([0,0])):
    def __init__(self, path, jtime = 2460843., sat = np.array([0,0,0]), radec = np.array([0,0])):
        self.path = path
        self.jtime = jtime
        self.sat = sat
        self.equator = coord.SkyCoord(radec[0]*u.degree, radec[1]*u.degree,frame='icrs')
        self.ecliptic = self.equator.transform_to('barycentrictrueecliptic')
        self.pointing = transRaDec2D(radec[0], radec[1])
        self.slcdll = ctypes.CDLL(self.information['dir_path']+'MCI_inputData/refs/libstraylight.so') #dylib
        self.slcdll = ctypes.CDLL(self.path+'MCI_inputData/refs/libstraylight.so') #dylib

        self.slcdll.Calculate.argtypes = [ctypes.c_double, ctypes.POINTER(ctypes.c_double),
                                         ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double),
@@ -518,7 +519,9 @@ def deg2HMS(ra0, dec0):
    '''convert deg to ra's HMS and  dec's DMS'''
    c = SkyCoord(ra=ra0*u.degree, dec=dec0*u.degree)
    ss=c.to_string('hmsdms')
    print(ss)
    
    ## print(ss)
    
    for k in range(5,len(ss)-1):

        if ss[k]=='s':
@@ -998,7 +1001,8 @@ def cal_Filter_PSF(wfetimes):
    
    for filterk in filterP.keys():
        filtername=filterk
        print(filtername)
        
        ## print(filtername)
        
        filterwaveC=filterP[filterk]['Clambda']
        filterFwhm=filterP[filterk]['FWHM']
@@ -1423,7 +1427,7 @@ class MCIsimulator():
        
        self.source=sourcein
        
        print('print information:', self.information)
        ##print('print information:', self.information)
        

        ###########################################################################
@@ -1434,7 +1438,6 @@ class MCIsimulator():
        #self.result_path='../MCI_simData_'+result_day        
        
    
        print("information.dir_path:",self.information['dir_path'])
           
        if self.information['dir_path'] =='/nfsdata/share/simulation-unittest/mci_sim/':
            self.result_path = self.information['dir_path'] +'mci_sim_result/'+result_day
@@ -1468,7 +1471,7 @@ class MCIsimulator():

        self.log = lg.setUpLogger(self.result_path+'/log_Data/MCIsim_'+self.source+'_'+data_time+'_Num_'+str(simnumber)+'.log')
        
        #print('logger.handlers=', self.log.handlers)
     
        
        self.log.info('-------STARTING A NEW SIMULATION------------')
        
@@ -1485,7 +1488,7 @@ class MCIsimulator():
        self.information['I_filters']=["z",      "y",    "F815N", "CBI",  "F925N", "F960M",  "F968N",  "F845M" ,"F850LP" ,"F814W"]
        
        #### load telescope efficiency data
        print(self.information['dir_path'])
       
        
        self.tel_eff=np.load(self.information['dir_path']+'MCI_inputData/tel_eff/tel_eff.npy',allow_pickle=True).item()
        
@@ -1919,7 +1922,7 @@ class MCIsimulator():
        wave0, zodi0 = self.zodiacal(ra, dec, self.TianCe_day)     # erg/s/cm^2/A/arcsec^2
        
        # EarthShine from straylight
        sl = StrayLight(jtime=time_jd, sat=np.array([x_sat, y_sat, z_sat]),
        sl = StrayLight(self.information['dir_path'],jtime=time_jd, sat=np.array([x_sat, y_sat, z_sat]),
                        radec=np.array([(ra*u.degree).value, (dec*u.degree).value]))

        earth_e = sl.caculateEarthShineFilter(filter='r')
@@ -5068,7 +5071,7 @@ class MCIsimulator():
        ##############################################################################################
        sourcelist=['EXDF','STAR','PIPR','TRNS','COMB','CALI','DARK','BIAS','FLAT']
        if self.source not in sourcelist:
            print('Sourcein is wront')
            print('Sourcein is wrong')
            sys.exit(1)