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
LAM-GRD-public
maoppy
Commits
e42f8160
Commit
e42f8160
authored
Jul 09, 2021
by
rfetick
Browse files
update psfaogalpak example
parent
fe6d77e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
maoppy/example/psfaogalpak.py
View file @
e42f8160
...
...
@@ -2,9 +2,7 @@
"""
Created on Fri Jul 9 10:16:23 2021
Create a wrapper around Psfao for GalPak
TODO: manage odd pixels
Create a wrapper around Psfao for GalPak software
@author: rfetick
"""
...
...
@@ -19,7 +17,26 @@ class PointSpreadFunction:
class
PsfaoGalpak
(
Psfao
,
PointSpreadFunction
):
"""
Implementation of Psfao for GalPak software.
"""
def
__init__
(
self
,
param
,
wvl_um
,
system
=
None
,
Lext
=
10.
,
fixed_k
=
None
):
"""
Constructor.
Parameters
----------
param : list, tuple, np.array (of 7 elements)
Vector of parameters as defined in Psfao.
[r0,C,A,alpha,ratio,theta,beta].
wvl_um : float
The wavlength [um] corresponding to the given parameter.
A theoretical evolution of the parameters is used by default,
otherwise consider changing the parameters for each wavelength.
system : maoppy.instrument.Instrument
The AO system related to the PSF computation.
"""
npix
=
(
10
,
10
)
# will be modified in 'as_image'
samp
=
2.0
# will be modified in 'as_image'
super
().
__init__
(
npix
,
system
=
system
,
Lext
=
Lext
,
samp
=
samp
,
fixed_k
=
fixed_k
)
...
...
@@ -51,8 +68,9 @@ class PsfaoGalpak(Psfao, PointSpreadFunction):
return
self
.
__call__
(
p
,
dx
=
dx
,
dy
=
dy
)
###################################################
################### TEST SCRIPT ###################
###################################################
if
__name__
==
"__main__"
:
...
...
@@ -90,7 +108,7 @@ if __name__ == "__main__":
print
(
"PSF energy = %.4f"
%
psf
.
sum
())
# E=1 up to intfy, so E<1 on the FoV
### PLOT
### PLOT
PSF
import
matplotlib.pyplot
as
plt
from
matplotlib.colors
import
LogNorm
plt
.
figure
(
1
)
...
...
@@ -102,6 +120,7 @@ if __name__ == "__main__":
plt
.
ylabel
(
"Y [pix]"
)
plt
.
show
()
### PLOT PSD
# from maoppy.utils import circavg
# psd,_ = pg.psd(p0)
...
...
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