In [1]:
# Import the usual libraries
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
#import matplotlib.patches as mpatches

# Enable inline plotting
%matplotlib inline

#from IPython.display import display, Latex, clear_output

In [2]:
import pynrc
from pynrc import nrc_utils
from pynrc.nrc_utils import webbpsf, poppy
from pynrc.testing import perform_benchmarks


[     pynrc:INFO]   jwst_backgrounds is not installed and will not be used for bg estimates.

In [3]:
nrc = pynrc.NIRCam()


[     pynrc:INFO] Initializing SCA 481/A1
[     pynrc:INFO] Updating PSF coeff with fov_pix=33 and oversample=4

In [4]:
# from pynrc.nrc_utils import read_filter, gen_psf_coeff, gen_image_coeff, gen_webbpsf_psf
# from pynrc.nrc_utils import gen_webbpsf_siwfe, field_coeff_resid, field_coeff_func
# from pynrc.nrc_utils import Tel2Sci_info, NIRCam_V2V3_limits, radial_std
# from pynrc.nrc_utils import jl_poly_fit, jl_poly

In [5]:
# # Interpolation and extrapolation
# from scipy.interpolate import griddata, RegularGridInterpolator
# from scipy.ndimage import rotate

In [6]:
# pySIAF stuff for plotting
import pysiaf
from pysiaf.siaf import Siaf
from pysiaf.siaf import plot_main_apertures

siaf = Siaf('NIRCam')
siaf.generate_toc()

In [7]:
from astropy.table import Table

Benchmarks


In [8]:
kwargs = {
    'fov_pix': 33,
    'oversample': 4,
    'pupil': None,
    'filter': 'F430M',
}

# kwargs = {
#     'fov_pix': 320,
#     'oversample': 2,
#     'pupil': 'CIRCLYOT',
#     'filter': 'F444W',
# }

In [9]:
tdict = perform_benchmarks(do_webbpsf_only=True, **kwargs)


Took 2.16 seconds to init WebbPSF
Took 3.42 seconds to generate WebbPSF PSF

In [5]:
tdict = perform_benchmarks(do_webbpsf=False, **kwargs)


Took 2.20 seconds to generate pyNRC coefficients
Took 3.81 seconds to generate WFE Drift coefficients
Took 5.98 seconds to generate WFE Field coefficients
Took 0.05 seconds to generate pynrc PSF

In [6]:
tdict = perform_benchmarks(do_webbpsf=False, **kwargs)


Took 2.15 seconds to generate pyNRC coefficients
Took 3.65 seconds to generate WFE Drift coefficients
Took 5.97 seconds to generate WFE Field coefficients
Took 0.05 seconds to generate pynrc PSF

In [ ]: