Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-sims
csst_mci_sim
Commits
5bb06e78
Commit
5bb06e78
authored
Apr 17, 2024
by
Yan Zhaojun
Browse files
debug
parent
78e1c06c
Changes
2
Hide whitespace changes
Inline
Side-by-side
csst_mci_sim/earthshine.py
View file @
5bb06e78
...
...
@@ -153,30 +153,32 @@ class StrayLight(object):
self
.
slcdll
.
Init
(
str
.
encode
(
self
.
deFn
),
str
.
encode
(
self
.
PSTFn
),
str
.
encode
(
self
.
RFn
),
str
.
encode
(
self
.
ZolFn
))
def
caculateStarLightFilter
(
self
,
filter
=
'i'
):
filterIndex
=
{
'nuv'
:
0
,
'u'
:
1
,
'g'
:
2
,
'r'
:
3
,
'i'
:
4
,
'z'
:
5
,
'y'
:
6
}
sat
=
(
ctypes
.
c_double
*
3
)()
sat
[:]
=
self
.
sat
ob
=
(
ctypes
.
c_double
*
3
)()
ob
[:]
=
self
.
pointing
py1
=
(
ctypes
.
c_double
*
3
)()
py2
=
(
ctypes
.
c_double
*
3
)()
self
.
slcdll
.
ComposeY
(
ob
,
py1
,
py2
)
star_e1
=
(
ctypes
.
c_double
*
7
)()
self
.
slcdll
.
PointSource
(
self
.
jtime
,
sat
,
ob
,
py1
,
star_e1
,
str
.
encode
(
self
.
brightStarTabFn
))
star_e2
=
(
ctypes
.
c_double
*
7
)()
self
.
slcdll
.
PointSource
(
self
.
jtime
,
sat
,
ob
,
py2
,
star_e2
,
str
.
encode
(
self
.
brightStarTabFn
))
band_star_e1
=
star_e1
[:][
filterIndex
[
filter
]]
band_star_e2
=
star_e2
[:][
filterIndex
[
filter
]]
return
max
(
band_star_e1
,
band_star_e2
)
# def caculateStarLightFilter(self, filter='i'):
# filterIndex = {'nuv': 0, 'u': 1, 'g': 2,
# 'r': 3, 'i': 4, 'z': 5, 'y': 6}
# sat = (ctypes.c_double*3)()
# sat[:] = self.sat
# ob = (ctypes.c_double*3)()
# ob[:] = self.pointing
# py1 = (ctypes.c_double*3)()
# py2 = (ctypes.c_double*3)()
# self.slcdll.ComposeY(ob, py1, py2)
# star_e1 = (ctypes.c_double*7)()
# self.slcdll.PointSource(self.jtime, sat, ob, py1,
# star_e1, str.encode(self.brightStarTabFn))
# star_e2 = (ctypes.c_double*7)()
# self.slcdll.PointSource(self.jtime, sat, ob, py2,
# star_e2, str.encode(self.brightStarTabFn))
# band_star_e1 = star_e1[:][filterIndex[filter]]
# band_star_e2 = star_e2[:][filterIndex[filter]]
# return max(band_star_e1, band_star_e2)
###############################################################################
def
caculateEarthShineFilter
(
self
,
filter
=
'i'
):
...
...
csst_mci_sim/straylight.py
View file @
5bb06e78
...
...
@@ -178,30 +178,30 @@ class StrayLight(object):
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
,
'r'
:
3
,
'i'
:
4
,
'z'
:
5
,
'y'
:
6
}
sat
=
(
ctypes
.
c_double
*
3
)()
sat
[:]
=
self
.
sat
ob
=
(
ctypes
.
c_double
*
3
)()
ob
[:]
=
self
.
pointing
#
filterIndex = {'nuv': 0, 'u': 1, 'g': 2,
#
'r': 3, 'i': 4, 'z': 5, 'y': 6}
#
sat = (ctypes.c_double*3)()
#
sat[:] = self.sat
#
ob = (ctypes.c_double*3)()
#
ob[:] = self.pointing
py1
=
(
ctypes
.
c_double
*
3
)()
py2
=
(
ctypes
.
c_double
*
3
)()
self
.
slcdll
.
ComposeY
(
ob
,
py1
,
py2
)
#
py1 = (ctypes.c_double*3)()
#
py2 = (ctypes.c_double*3)()
#
self.slcdll.ComposeY(ob, py1, py2)
earth_e1
=
(
ctypes
.
c_double
*
7
)()
self
.
slcdll
.
EarthShine
(
self
.
jtime
,
sat
,
ob
,
py1
,
earth_e1
)
# e[7]代表7个波段的照度
#
earth_e1 = (ctypes.c_double*7)()
#
self.slcdll.EarthShine(self.jtime, sat, ob, py1,
#
earth_e1) # e[7]代表7个波段的照度
earth_e2
=
(
ctypes
.
c_double
*
7
)()
self
.
slcdll
.
EarthShine
(
self
.
jtime
,
sat
,
ob
,
py2
,
earth_e2
)
#
earth_e2 = (ctypes.c_double*7)()
#
self.slcdll.EarthShine(self.jtime, sat, ob, py2, earth_e2)
band_earth_e1
=
earth_e1
[:][
filterIndex
[
filter
]]
band_earth_e2
=
earth_e2
[:][
filterIndex
[
filter
]]
#
band_earth_e1 = earth_e1[:][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)
###############################################################################
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment