Skip to content
Snippets Groups Projects
Commit e42f8160 authored by rfetick's avatar rfetick
Browse files

update psfaogalpak example

parent fe6d77e5
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment