Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
maoppy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LAM-GRD-public
maoppy
Commits
0b52ded5
Commit
0b52ded5
authored
3 years ago
by
rfetick
Browse files
Options
Downloads
Patches
Plain Diff
update PsfaoAliasing grad computation
parent
cb65b157
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
maoppy/psfmodel.py
+8
-20
8 additions, 20 deletions
maoppy/psfmodel.py
with
8 additions
and
20 deletions
maoppy/psfmodel.py
+
8
−
20
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment