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_msc_sim
Commits
4ad7acd0
Commit
4ad7acd0
authored
Nov 26, 2024
by
Wei Chengliang
Browse files
update codestyle-PEP8
parent
de26bef0
Pipeline
#7369
passed with stage
in 0 seconds
Changes
2
Pipelines
2
Show whitespace changes
Inline
Side-by-side
observation_sim/psf/PSFInterp.py
View file @
4ad7acd0
...
...
@@ -360,7 +360,7 @@ class PSFInterp(PSFModel):
hoc
=
self
.
hoc
[
twave
],
hoclist
=
self
.
hoclist
[
twave
],
PSFCentroidWgt
=
True
)
if
extrapolate
is
True
:
ccdList
=
[
6
,
7
,
8
,
9
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
22
,
23
,
24
,
25
]
ccdList
=
[
6
,
7
,
8
,
9
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
22
,
23
,
24
,
25
]
rr_trim_list
=
[
72
,
64
,
96
,
88
,
64
,
72
,
72
,
76
,
72
,
72
,
76
,
72
,
72
,
64
,
88
,
96
,
64
,
72
]
imPSF
=
psf_extrapolate
(
imPSF
,
rr_trim
=
rr_trim_list
[
ccdList
.
index
(
chip
.
chipID
)],
ngg
=
ngg
)
...
...
observation_sim/psf/_util.py
View file @
4ad7acd0
import
numpy
as
np
from
scipy.interpolate
import
interp1d
def
binningPSF
(
img
,
ngg
):
imgX
=
img
.
reshape
(
ngg
,
img
.
shape
[
0
]
//
ngg
,
ngg
,
img
.
shape
[
1
]
//
ngg
).
mean
(
-
1
).
mean
(
1
)
return
imgX
...
...
@@ -31,8 +32,8 @@ def psf_extrapolate(psf, rr_trim=64, ngg=256):
# extrapolate PSF
if
True
:
xim
=
np
.
arange
(
256
)
-
128
xim
,
yim
=
np
.
meshgrid
(
xim
,
xim
)
rim
=
np
.
sqrt
(
xim
**
2
+
yim
**
2
)
xim
,
yim
=
np
.
meshgrid
(
xim
,
xim
)
rim
=
np
.
sqrt
(
xim
**
2
+
yim
**
2
)
# rr_trim = 96
psf_temp
=
psf
...
...
@@ -47,16 +48,16 @@ def psf_extrapolate(psf, rr_trim=64, ngg=256):
# ngg = 1024
xim
=
np
.
arange
(
ngg
)
-
int
(
ngg
/
2
)
xim
,
yim
=
np
.
meshgrid
(
xim
,
xim
)
rim
=
np
.
sqrt
(
xim
**
2
+
yim
**
2
)
rim
[
int
(
ngg
/
2
),
int
(
ngg
/
2
)]
=
np
.
finfo
(
float
).
eps
# 1e-7
xim
,
yim
=
np
.
meshgrid
(
xim
,
xim
)
rim
=
np
.
sqrt
(
xim
**
2
+
yim
**
2
)
rim
[
int
(
ngg
/
2
),
int
(
ngg
/
2
)]
=
np
.
finfo
(
float
).
eps
# 1e-7
rim_log
=
np
.
log
(
rim
)
y_new
=
f_interp
(
rim_log
)
arr
=
np
.
zeros
([
ngg
,
ngg
])
arr
[
int
(
ngg
/
2
-
128
):
int
(
ngg
/
2
+
128
),
int
(
ngg
/
2
-
128
):
int
(
ngg
/
2
+
128
)]
=
np
.
log
(
psf_temp
+
np
.
finfo
(
float
).
eps
)
arr
[
rim
>
rr_trim
]
=
0
arr
[
arr
==
0
]
=
y_new
[
arr
==
0
]
arr
[
arr
==
0
]
=
y_new
[
arr
==
0
]
psf
=
np
.
exp
(
arr
)
psf
[
rim
>
int
(
ngg
/
2
)]
=
0
imPSF
=
psf
# binningPSF(psf, int(ngg/2))
...
...
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