Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LAM-GRD-public
maoppy
Commits
0b52ded5
Commit
0b52ded5
authored
Feb 24, 2022
by
rfetick
Browse files
update PsfaoAliasing grad computation
parent
cb65b157
Changes
1
Hide whitespace changes
Inline
Side-by-side
maoppy/psfmodel.py
View file @
0b52ded5
...
...
@@ -745,39 +745,27 @@ class Psfao(ParametricPSFfromPSD):
class
PsfaoAliasing
(
Psfao
):
"""Ignore background and use aliasing instead"""
def
psd
(
self
,
parampsd
,
*
args
,
grad
=
False
,
fovnorm
=
False
,
**
kwargs
):
def
psd
(
self
,
parampsd
,
*
args
,
grad
=
False
,
**
kwargs
):
# parampsd can be called with a dictionary
if
isinstance
(
parampsd
,
dict
):
parampsd
=
self
.
dict2list
(
parampsd
)
r0
=
parampsd
[
0
]
bck
=
self
.
system
.
aliasing
*
0.0229
*
6
/
5
*
r0
**
(
-
5
/
3
)
*
self
.
cutoffAOfreq
**
(
-
11
/
3
)
dbck_dr0
=
-
5
/
3
*
bck
/
r0
parampsd
[
1
]
=
bck
out
=
super
().
psd
(
parampsd
,
*
args
,
grad
=
grad
,
**
kwargs
)
if
grad
:
# I need to update the gradient and its integral!
psd
,
integral
,
gg
,
_
=
out
gg
[
0
,...]
+=
self
.
_maskin
*
dbck_dr0
psd
,
integral
,
gg
,
integral_g
=
out
dbck_dr0
=
-
5
/
3
*
bck
/
r0
newbckmsk
=
dbck_dr0
*
self
.
_maskin
gg
[
0
,...]
+=
newbckmsk
integral_g
[
0
]
+=
np
.
sum
(
newbckmsk
)
*
self
.
pix2freq
**
2
gg
[
1
,...]
=
0
integral_g
=
np
.
zeros
(
len
(
parampsd
))
pix
=
self
.
pix2freq
if
fovnorm
:
for
i
in
range
(
len
(
parampsd
)):
integral_g
[
i
]
=
np
.
sum
(
gg
[
i
,...])
*
pix
**
2
# numerical sum
else
:
nx0
,
ny0
=
self
.
_nullFreqIndex
fmax
=
np
.
min
([
nx0
,
ny0
])
*
pix
integral_out
=
0.0229
*
6
*
np
.
pi
/
5
*
(
r0
*
fmax
)
**
(
-
5.
/
3.
)
# analytical sum outside
for
i
in
range
(
len
(
parampsd
)):
integral_g
[
i
]
=
np
.
sum
(
gg
[
i
,...]
*
(
self
.
_f2
<
(
fmax
**
2
)))
*
pix
**
2
# numerical sum
integral_g
[
0
]
+=
integral_out
*
(
-
5.
/
3
)
/
r0
psd
,
integral
,
gg
,
integral_g
integral_g
[
1
]
=
0
return
psd
,
integral
,
gg
,
integral_g
return
out
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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