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

test

parent 0f353503
Pipeline #4034 failed with stage
in 0 seconds
...@@ -319,13 +319,14 @@ def CCDnonLinearityModel(data, beta=6e-7): ...@@ -319,13 +319,14 @@ def CCDnonLinearityModel(data, beta=6e-7):
class StrayLight(object): 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.jtime = jtime
self.sat = sat self.sat = sat
self.equator = coord.SkyCoord(radec[0]*u.degree, radec[1]*u.degree,frame='icrs') self.equator = coord.SkyCoord(radec[0]*u.degree, radec[1]*u.degree,frame='icrs')
self.ecliptic = self.equator.transform_to('barycentrictrueecliptic') self.ecliptic = self.equator.transform_to('barycentrictrueecliptic')
self.pointing = transRaDec2D(radec[0], radec[1]) 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), self.slcdll.Calculate.argtypes = [ctypes.c_double, ctypes.POINTER(ctypes.c_double),
ctypes.POINTER(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): ...@@ -518,7 +519,9 @@ def deg2HMS(ra0, dec0):
'''convert deg to ra's HMS and dec's DMS''' '''convert deg to ra's HMS and dec's DMS'''
c = SkyCoord(ra=ra0*u.degree, dec=dec0*u.degree) c = SkyCoord(ra=ra0*u.degree, dec=dec0*u.degree)
ss=c.to_string('hmsdms') ss=c.to_string('hmsdms')
print(ss)
## print(ss)
for k in range(5,len(ss)-1): for k in range(5,len(ss)-1):
if ss[k]=='s': if ss[k]=='s':
...@@ -998,7 +1001,8 @@ def cal_Filter_PSF(wfetimes): ...@@ -998,7 +1001,8 @@ def cal_Filter_PSF(wfetimes):
for filterk in filterP.keys(): for filterk in filterP.keys():
filtername=filterk filtername=filterk
print(filtername)
## print(filtername)
filterwaveC=filterP[filterk]['Clambda'] filterwaveC=filterP[filterk]['Clambda']
filterFwhm=filterP[filterk]['FWHM'] filterFwhm=filterP[filterk]['FWHM']
...@@ -1423,7 +1427,7 @@ class MCIsimulator(): ...@@ -1423,7 +1427,7 @@ class MCIsimulator():
self.source=sourcein self.source=sourcein
print('print information:', self.information) ##print('print information:', self.information)
########################################################################### ###########################################################################
...@@ -1433,8 +1437,7 @@ class MCIsimulator(): ...@@ -1433,8 +1437,7 @@ class MCIsimulator():
result_day=now.strftime("%Y-%m-%d") result_day=now.strftime("%Y-%m-%d")
#self.result_path='../MCI_simData_'+result_day #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/': if self.information['dir_path'] =='/nfsdata/share/simulation-unittest/mci_sim/':
self.result_path = self.information['dir_path'] +'mci_sim_result/'+result_day self.result_path = self.information['dir_path'] +'mci_sim_result/'+result_day
...@@ -1468,7 +1471,7 @@ class MCIsimulator(): ...@@ -1468,7 +1471,7 @@ class MCIsimulator():
self.log = lg.setUpLogger(self.result_path+'/log_Data/MCIsim_'+self.source+'_'+data_time+'_Num_'+str(simnumber)+'.log') 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------------') self.log.info('-------STARTING A NEW SIMULATION------------')
...@@ -1485,7 +1488,7 @@ class MCIsimulator(): ...@@ -1485,7 +1488,7 @@ class MCIsimulator():
self.information['I_filters']=["z", "y", "F815N", "CBI", "F925N", "F960M", "F968N", "F845M" ,"F850LP" ,"F814W"] self.information['I_filters']=["z", "y", "F815N", "CBI", "F925N", "F960M", "F968N", "F845M" ,"F850LP" ,"F814W"]
#### load telescope efficiency data #### 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() 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(): ...@@ -1919,7 +1922,7 @@ class MCIsimulator():
wave0, zodi0 = self.zodiacal(ra, dec, self.TianCe_day) # erg/s/cm^2/A/arcsec^2 wave0, zodi0 = self.zodiacal(ra, dec, self.TianCe_day) # erg/s/cm^2/A/arcsec^2
# EarthShine from straylight # 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])) radec=np.array([(ra*u.degree).value, (dec*u.degree).value]))
earth_e = sl.caculateEarthShineFilter(filter='r') earth_e = sl.caculateEarthShineFilter(filter='r')
...@@ -5068,7 +5071,7 @@ class MCIsimulator(): ...@@ -5068,7 +5071,7 @@ class MCIsimulator():
############################################################################################## ##############################################################################################
sourcelist=['EXDF','STAR','PIPR','TRNS','COMB','CALI','DARK','BIAS','FLAT'] sourcelist=['EXDF','STAR','PIPR','TRNS','COMB','CALI','DARK','BIAS','FLAT']
if self.source not in sourcelist: if self.source not in sourcelist:
print('Sourcein is wront') print('Sourcein is wrong')
sys.exit(1) sys.exit(1)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment