Commit 5bb06e78 authored by Yan Zhaojun's avatar Yan Zhaojun
Browse files

debug

parent 78e1c06c
...@@ -153,30 +153,32 @@ class StrayLight(object): ...@@ -153,30 +153,32 @@ class StrayLight(object):
self.slcdll.Init(str.encode(self.deFn), str.encode( self.slcdll.Init(str.encode(self.deFn), str.encode(
self.PSTFn), str.encode(self.RFn), str.encode(self.ZolFn)) self.PSTFn), str.encode(self.RFn), str.encode(self.ZolFn))
def caculateStarLightFilter(self, filter='i'): # def caculateStarLightFilter(self, filter='i'):
filterIndex = {'nuv': 0, 'u': 1, 'g': 2, # filterIndex = {'nuv': 0, 'u': 1, 'g': 2,
'r': 3, 'i': 4, 'z': 5, 'y': 6} # 'r': 3, 'i': 4, 'z': 5, 'y': 6}
sat = (ctypes.c_double*3)() # sat = (ctypes.c_double*3)()
sat[:] = self.sat # sat[:] = self.sat
ob = (ctypes.c_double*3)() # ob = (ctypes.c_double*3)()
ob[:] = self.pointing # ob[:] = self.pointing
py1 = (ctypes.c_double*3)() # py1 = (ctypes.c_double*3)()
py2 = (ctypes.c_double*3)() # py2 = (ctypes.c_double*3)()
self.slcdll.ComposeY(ob, py1, py2) # self.slcdll.ComposeY(ob, py1, py2)
star_e1 = (ctypes.c_double*7)() # star_e1 = (ctypes.c_double*7)()
self.slcdll.PointSource(self.jtime, sat, ob, py1, # self.slcdll.PointSource(self.jtime, sat, ob, py1,
star_e1, str.encode(self.brightStarTabFn)) # star_e1, str.encode(self.brightStarTabFn))
star_e2 = (ctypes.c_double*7)() # star_e2 = (ctypes.c_double*7)()
self.slcdll.PointSource(self.jtime, sat, ob, py2, # self.slcdll.PointSource(self.jtime, sat, ob, py2,
star_e2, str.encode(self.brightStarTabFn)) # star_e2, str.encode(self.brightStarTabFn))
band_star_e1 = star_e1[:][filterIndex[filter]] # band_star_e1 = star_e1[:][filterIndex[filter]]
band_star_e2 = star_e2[:][filterIndex[filter]] # band_star_e2 = star_e2[:][filterIndex[filter]]
return max(band_star_e1, band_star_e2) # return max(band_star_e1, band_star_e2)
###############################################################################
def caculateEarthShineFilter(self, filter='i'): def caculateEarthShineFilter(self, filter='i'):
......
...@@ -178,30 +178,30 @@ class StrayLight(object): ...@@ -178,30 +178,30 @@ class StrayLight(object):
return max(band_star_e1, band_star_e2) return max(band_star_e1, band_star_e2)
def caculateEarthShineFilter(self, filter='i'): # def caculateEarthShineFilter(self, filter='i'):
filterIndex = {'nuv': 0, 'u': 1, 'g': 2, # filterIndex = {'nuv': 0, 'u': 1, 'g': 2,
'r': 3, 'i': 4, 'z': 5, 'y': 6} # 'r': 3, 'i': 4, 'z': 5, 'y': 6}
sat = (ctypes.c_double*3)() # sat = (ctypes.c_double*3)()
sat[:] = self.sat # sat[:] = self.sat
ob = (ctypes.c_double*3)() # ob = (ctypes.c_double*3)()
ob[:] = self.pointing # ob[:] = self.pointing
py1 = (ctypes.c_double*3)() # py1 = (ctypes.c_double*3)()
py2 = (ctypes.c_double*3)() # py2 = (ctypes.c_double*3)()
self.slcdll.ComposeY(ob, py1, py2) # self.slcdll.ComposeY(ob, py1, py2)
earth_e1 = (ctypes.c_double*7)() # earth_e1 = (ctypes.c_double*7)()
self.slcdll.EarthShine(self.jtime, sat, ob, py1, # self.slcdll.EarthShine(self.jtime, sat, ob, py1,
earth_e1) # e[7]代表7个波段的照度 # earth_e1) # e[7]代表7个波段的照度
earth_e2 = (ctypes.c_double*7)() # earth_e2 = (ctypes.c_double*7)()
self.slcdll.EarthShine(self.jtime, sat, ob, py2, earth_e2) # self.slcdll.EarthShine(self.jtime, sat, ob, py2, earth_e2)
band_earth_e1 = earth_e1[:][filterIndex[filter]] # band_earth_e1 = earth_e1[:][filterIndex[filter]]
band_earth_e2 = earth_e2[:][filterIndex[filter]] # band_earth_e2 = earth_e2[:][filterIndex[filter]]
return max(band_earth_e1, band_earth_e2) # return max(band_earth_e1, band_earth_e2)
############################################################################### ###############################################################################
......
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