API
Public Step API
jwst.ami.ami_analyze_step Module
Classes
|
Performs analysis of an AMI mode exposure by applying the LG algorithm. |
Complete Developer API
(Some API here may also be used in AMI Normalize.)
jwst.ami.ami_analyze Module
Functions
|
Apply the image plane algorithm (LG-PLUS) to an AMI exposure. |
jwst.ami.analyticnrm2 Module
Functions
|
Compute 2d Jinc for given coordinates. |
|
Calculate cosine terms of analytic model. |
|
Calculate sine terms of analytic model. |
|
Calculate the sine and cosine fringes. |
|
Calculate the wavefront for a single hole. |
|
Calculate the Image center location in oversampled pixels. |
|
Calculate the complex amplitudes for all holes. |
|
Create a model using the specified wavelength. |
|
Calculate the Amplitude Spread Function for a circular aperture. |
|
Amplitude Spread Function (AKA image plane complex amplitude) for a fringe. |
|
Amplitude Spread Function (AKA image plane complex amplitude) for a hexagonal aperture. |
|
Calculate the PSF for the requested aperture shape. |
jwst.ami.bp_fix Module
Pipeline implementation of Jens Kammerer’s bp_fix code based on Ireland 2013 algorithm.
Functions
|
Extend filter support slightly past half power points. |
|
Calculate psf at low, center, and high wavelengths of filter. |
|
Take Fourier transform of image. |
|
Calculate the PSF. |
|
Identify bad pixels by subtracting median-filtered data and searching for outliers. |
|
Compute and apply the bad pixel corrections based on Section 2.5 of Ireland 2013. |
|
Apply the Fourier bad pixel correction to pixels flagged DO_NOT_USE or JUMP_DET. |
jwst.ami.find_affine2d_parameters Module
Functions
|
Create a list of affine objects with various rotations. |
|
Create an affine2d object using the known rotation and scale. |
jwst.ami.hextransformee Module
Functions
|
Fourier transform a half-hexagon. |
|
Calculate the complex array analytical transform of a (distorted if necessary) hexagon. |
jwst.ami.instrument_data Module
Classes
|
Module for defining NIRISS data format, wavelength info, and mask geometry. |
jwst.ami.leastsqnrm Module
Functions
|
Replace singularities in analytical hexagon Fourier transform. |
|
Perform least squares matrix operations to solve A x = b weighting by Poisson variance. |
|
Use least squares matrix operations to solve A x = b. |
|
Multiply the envelope by each fringe 'image'. |
|
From the solution to the fit, calculate the fringe amplitude and phase. |
|
Populate the antisymmetric fringe phase array:. |
|
Populate the symmetric fringe amplitude array. |
|
Populate the triple-product amplitude array (NOT closure amplitudes). |
|
Calculate closure phases for each set of 3 holes. |
|
Calculate closure amplitudes. |
|
Calculate phases for each set of 4 holes. |
Classes
|
Perform a general least-squares fit of a linear model using numpy matrix inversion. |
jwst.ami.lg_model Module
Functions
|
Calculate goodness of fit between the data and the fit. |
|
Calculate correlation between data and model. |
Classes
|
A class for conveniently dealing with an NRM object. |
jwst.ami.mask_definition_ami Module
Classes
|
Defines the geometry of the NRM mask. |
jwst.ami.matrix_dft Module
Matrix-based discrete Fourier transforms for computing PSFs.
MatrixDFT: Matrix-based discrete Fourier transforms for computing PSFs. Internally this will call one of several subfunctions depending on the specified centering type. These have to do with where the (0, 0) element of the Fourier transform is located, i.e., where the PSF center ends up:
‘FFTSTYLE’ centered on one pixel
‘SYMMETRIC’ centered on crosshairs between middle pixel
‘ADJUSTABLE’, always centered in output array depending on whether it is even or odd
‘ADJUSTABLE’ is the default. This module was originally called “Slow Fourier Transform”, and this terminology still appears in some places in the code. Note that this is ‘slow’ only in the sense that if you perform the exact same calculation as an FFT, the FFT algorithm is much faster. However this algorithm gives you much more flexibility in choosing array sizes and sampling, and often lets you replace “fast calculations on very large arrays” with “relatively slow calculations on much smaller ones”.
Notes
Code originally by A. Sivaramakrishnan, M. Perrin, and J. Long, in accordance with Soummer et al. 2007. [1]
References
Soummer et al. 2007, Opt. Express 15, 15935-15951 (2007) https://doi.org/10.1364/OE.15.015935
Examples
result = matrix_dft.matrix_dft(pupilArray, focalplane_size, focalplane_npix)
Functions
|
Perform a matrix discrete Fourier transform with selectable output sampling and centering. |
|
Perform an inverse matrix discrete Fourier transform. |
jwst.ami.nrm_core Module
Classes
|
Fit fringes to get interferometric observables for the data. |
jwst.ami.oifits Module
Classes
|
Store AMI data in the format required to write out to OIFITS files. |
|
Produce a final calibrated AmiOIModel. |
jwst.ami.utils Module
Functions
|
Calculate a 'disk'. |
|
Avoid rotation of exact multiples of 15 degrees to avoid NaNs in hextransformee(). |
|
Calculate center of image, accounting for odd/even pixel size. |
|
Calculate distance from the brightest pixel in img to the nearest edge of img. |
Calculate the centroid of the image. |
|
Calculate extremum of the quadratic. |
|
|
Calculate the fit function extreme for a given input vector. |
|
Find slopes of an array. |
|
Write the 'NRM matrix'. |
|
Extract pistons out of fringes. |
|
Perform simple flux-conserving binning using specified binning kernel. |
|
Rebin, applying Klaus P's fastrebin from web. |
|
Calculate cross correlation of two identically-shaped real arrays. |
|
Calculate cross correlation of two identically-shaped real or complex arrays. |
|
Apply a CCW rotation to the given vectors. |
|
Load filter throughput data into synphot spectrum object. |
Produce a synphot spectrum object with constant (unity) flux. |
|
|
Get the observed spectrum through a filter. |
|
Convert input bandpass array into format expected by code. |
|
Determine what to do with the input bandpass. |
|
Get pixel scale info from data model. |
Classes
|
Implement the Bracewell Fourier 2D affine transformation theorem. |