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
Liu Dezi
csst_msc_sim
Commits
64a44b34
Commit
64a44b34
authored
Nov 26, 2022
by
Zhang Xin
Browse files
disperse speed improve
parent
baa82f5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
ObservationSim/MockObject/SpecDisperser/disperse_c/disperse.pyx
View file @
64a44b34
...
...
@@ -53,7 +53,6 @@ def disperse_grism_object(np.ndarray[FTYPE_t, ndim=2] flam,
nk
=
len
(
idxl
)
nl
=
len
(
full
)
yfrac_off
=
1
-
yfrac
if
(
flat
is
not
None
):
nlamb
=
len
(
wlambda
)
...
...
@@ -92,7 +91,7 @@ def disperse_grism_object(np.ndarray[FTYPE_t, ndim=2] flam,
k2
=
idxl
[
k
]
+
(
j
-
1
)
*
shg
[
1
]
+
i
if
(
k2
>=
0
)
&
(
k2
<
nl
):
flat_ids
=
k2
*
nlamb
+
k
full
[
k2
]
+=
fl_ij
*
yfrac
_off
[
k
]
*
flat_eff_all
[
flat_ids
]
full
[
k2
]
+=
fl_ij
*
(
1
-
yfrac
[
k
]
)
*
flat_eff_all
[
flat_ids
]
else
:
for
i
in
range
(
0
-
x0
[
1
],
x0
[
1
]):
...
...
@@ -110,11 +109,11 @@ def disperse_grism_object(np.ndarray[FTYPE_t, ndim=2] flam,
for
k
in
range
(
nk
):
k1
=
idxl
[
k
]
+
j
*
shg
[
1
]
+
i
if
(
k1
>=
0
)
&
(
k1
<
nl
):
full
[
k1
]
+=
fl_ij
*
yfrac
[
k
]
*
ysens
[
k
]
full
[
k1
]
+=
ysens
[
k
]
*
fl_ij
*
yfrac
[
k
]
k2
=
idxl
[
k
]
+
(
j
-
1
)
*
shg
[
1
]
+
i
if
(
k2
>=
0
)
&
(
k2
<
nl
):
full
[
k2
]
+=
fl_ij
*
yfrac
_off
[
k
]
*
ysens
[
k
]
full
[
k2
]
+=
ysens
[
k
]
*
fl_ij
*
(
1
-
yfrac
[
k
]
)
return
True
...
...
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