Commit 814433f5 authored by rfetick's avatar rfetick
Browse files

add example script

parent e42f8160
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 12 17:59:23 2021
Show the center convention for Psfao
It is at size/2 for even sized arrays.
@author: rfetick
"""
from maoppy.instrument import zimpol
from maoppy.psfmodel import Psfao
import numpy as np
import matplotlib.pyplot as plt
#%% PARAMETERS
npix = 16
samp = 2.0 # you can choose oversampled or undersampled.
#%% BUILD PSF (without turbulence)
psfmodel = Psfao((npix,npix), system=zimpol, samp=samp)
r0 = 1e5
C = 0
A = 0
alpha = 1
elon = 1
theta = 0
beta = 1.5
param = [r0,C,A,alpha,elon,theta,beta]
psf = psfmodel(param)
#%% PLOT RESULT
c = np.where(psf==psf.max())
c = (c[0][0],c[1][0])
print("For size (%u,%u), the center is at (%u,%u)"%(npix,npix,c[0],c[1]))
plt.figure(1)
plt.clf()
plt.imshow(psf)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment