Loading csst_mci_sim/csst_mci_sim.py +14 −11 Original line number Diff line number Diff line Loading @@ -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), Loading Loading @@ -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': Loading Loading @@ -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'] Loading Loading @@ -1423,7 +1427,7 @@ class MCIsimulator(): self.source=sourcein print('print information:', self.information) ##print('print information:', self.information) ########################################################################### Loading @@ -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 Loading Loading @@ -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------------') Loading @@ -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() Loading Loading @@ -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') Loading Loading @@ -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) Loading Loading
csst_mci_sim/csst_mci_sim.py +14 −11 Original line number Diff line number Diff line Loading @@ -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), Loading Loading @@ -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': Loading Loading @@ -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'] Loading Loading @@ -1423,7 +1427,7 @@ class MCIsimulator(): self.source=sourcein print('print information:', self.information) ##print('print information:', self.information) ########################################################################### Loading @@ -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 Loading Loading @@ -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------------') Loading @@ -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() Loading Loading @@ -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') Loading Loading @@ -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) Loading