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

add script to profile Psfao computation time

parent abafe6c2
No related branches found
No related tags found
No related merge requests found
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 31 17:16:53 2021
Run profiler on this script to find computation bottleneck
@author: rfetick
"""
import matplotlib.pyplot as plt
import numpy as np
from maoppy.psfmodel import Psfao
from maoppy.instrument import muse_nfm
Npix = 128 # pixel size of PSF
wvl = 600*1e-9 # wavelength [m]
niter = 20 # number of PSF to generate
#%% Initialize PSF model
samp = muse_nfm.samp(wvl) # sampling (2.0 for Shannon-Nyquist)
Pmodel = Psfao((Npix,Npix),system=muse_nfm,samp=samp)
#%% Choose parameters and compute PSF
r0 = 0.15 # Fried parameter [m]
bck = 1e-5 # Phase PSD background [rad² m²]
amp = 5.0 # Phase PSD Moffat amplitude [rad²]
alpha = 0.1 # Phase PSD Moffat alpha [1/m]
ratio = 1.2
theta = np.pi/4
beta = 1.6 # Phase PSD Moffat beta power law
param = [r0,bck,amp,alpha,ratio,theta,beta]
for i in range(niter):
psf = Pmodel(param,dx=0,dy=0)
\ No newline at end of file
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