Por, Emiel H.,
Haffert, Sebastiaan Y.,
Radhakrishnan, Vikram M.,
Doelman, David S.,
van Kooten, Maaike,
and Bos, Steven P.
Proc. SPIE 10703
(2018)
HCIPy is a package written in Python for simulating the interplay between wavefront control and coronagraphic systems. By defining an element which merges values/coefficients with its sampling grid/modal basis into a single object called Field, this minimizes errors in writing the code and makes it clearer to read. HCIPy provides a monochromatic Wavefront and defines a Propagator that acts as the transformation between two wavefronts. In this way a Propagator acts as any physical part of the optical system, be it a piece of free space, a thin complex apodizer or a microlens array. HCIPy contains Fraunhofer and Fresnel propagators through free space. It includes an implementation of a thin complex apodizer, which can modify the phase and/or amplitude of a wavefront, and forms the basis for more complicated optical elements. Included in HCIPy are wavefront errors (modal, power spectra), complex apertures (VLT, Keck or Subaru pupil), coronagraphs (Lyot, vortex or apodizing phase plate coronagraph), deformable mirrors, wavefront sensors (Shack-Hartmann, Pyramid, Zernike or phase-diversity wavefront sensor) and multi-layer atmospheric models including scintillation). HCIPy aims to provide an easy-to-use, modular framework for wavefront control and coronagraphy on current and future telescopes, enabling rapid prototyping of the full high-contrast imaging system. Adaptive optics and coronagraphic systems can be easily extended to include more realistic physics. The package includes a complete documentation of all classes and functions, and is available as open-source software.