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
d0cc77f9
Commit
d0cc77f9
authored
1 year ago
by
Romain Fetick
Browse files
Options
Downloads
Patches
Plain Diff
add jitter into ParametricPSFfromPSD
parent
78daf898
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
+27
-1
27 additions, 1 deletion
maoppy/psfmodel.py
with
27 additions
and
1 deletion
maoppy/psfmodel.py
+
27
−
1
View file @
d0cc77f9
...
@@ -202,6 +202,8 @@ class ParametricPSFfromPSD(ParametricPSF):
...
@@ -202,6 +202,8 @@ class ParametricPSFfromPSD(ParametricPSF):
self
.
_fxy
=
None
self
.
_fxy
=
None
self
.
_f2
=
None
self
.
_f2
=
None
self
.
_otfDiffraction
=
None
self
.
_otfDiffraction
=
None
self
.
_jitter_mas
=
0
self
.
_otfJitter
=
1
self
.
fixed_k
=
fixed_k
self
.
fixed_k
=
fixed_k
self
.
system
=
system
self
.
system
=
system
...
@@ -210,6 +212,12 @@ class ParametricPSFfromPSD(ParametricPSF):
...
@@ -210,6 +212,12 @@ class ParametricPSFfromPSD(ParametricPSF):
self
.
_nparam
=
nparam
self
.
_nparam
=
nparam
self
.
bounds
=
((
-
np
.
inf
,)
*
nparam
,
(
np
.
inf
,)
*
nparam
)
self
.
bounds
=
((
-
np
.
inf
,)
*
nparam
,
(
np
.
inf
,)
*
nparam
)
def
__str__
(
self
):
s
=
super
().
__str__
+
'
\n
'
s
+=
"
jitter : %.2f mas
"
%
self
.
jitter_mas
return
s
@property
@property
def
npix
(
self
):
def
npix
(
self
):
...
@@ -281,6 +289,24 @@ class ParametricPSFfromPSD(ParametricPSF):
...
@@ -281,6 +289,24 @@ class ParametricPSFfromPSD(ParametricPSF):
return
fftshift
(
self
.
_otfDiffraction
)
return
fftshift
(
self
.
_otfDiffraction
)
@property
def
jitter_mas
(
self
):
return
self
.
_jitter_mas
@jitter_mas.setter
def
jitter_mas
(
self
,
val
):
self
.
_jitter_mas
=
val
xx
,
yy
=
np
.
mgrid
[
0
:
self
.
npix
[
0
],
0
:
self
.
npix
[
1
]]
dfx
=
1
/
(
self
.
npix
[
0
]
*
self
.
system
.
resolution_mas
)
dfy
=
1
/
(
self
.
npix
[
1
]
*
self
.
system
.
resolution_mas
)
xx
=
(
xx
-
self
.
npix
[
0
]
//
2
)
*
dfx
yy
=
(
yy
-
self
.
npix
[
1
]
//
2
)
*
dfy
# sigma = 1/val, but the writing below allows for val = 0
g
=
np
.
exp
(
-
0.5
*
((
xx
*
val
)
**
2
+
(
yy
*
val
)
**
2
))
self
.
_otfJitter
=
fftshift
(
g
)
def
strehlOTF
(
self
,
parampsd
):
def
strehlOTF
(
self
,
parampsd
):
"""
Compute the Strehl ratio based on the sum of the OTF
"""
"""
Compute the Strehl ratio based on the sum of the OTF
"""
return
np
.
real
(
np
.
sum
(
self
.
_otf
(
parampsd
))
/
np
.
sum
(
self
.
_otfDiffraction
))
return
np
.
real
(
np
.
sum
(
self
.
_otf
(
parampsd
))
/
np
.
sum
(
self
.
_otfDiffraction
))
...
@@ -368,7 +394,7 @@ class ParametricPSFfromPSD(ParametricPSF):
...
@@ -368,7 +394,7 @@ class ParametricPSFfromPSD(ParametricPSF):
else
:
else
:
otfTurb
=
self
.
_otfTurbulent
(
parampsd
,
grad
=
False
,
**
kwargs
)
otfTurb
=
self
.
_otfTurbulent
(
parampsd
,
grad
=
False
,
**
kwargs
)
otf
=
otfTurb
*
self
.
_otfDiffraction
*
otfShift
otf
=
otfTurb
*
self
.
_otfDiffraction
*
otfShift
*
self
.
_otfJitter
if
grad
:
if
grad
:
return
otf
,
gg
return
otf
,
gg
...
...
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