27#ifndef math_func_airyPattern_hpp
28#define math_func_airyPattern_hpp
30#include <gsl/gsl_integration.h>
31#include <gsl/gsl_errno.h>
33#include "../constants.hpp"
55template <
typename realT>
70template <
typename realT>
75 return ( 1. / pow( 1. - eps * eps, 2 ) ) *
89template <
typename realT>
100 realT r = sqrt( pow( x - x0, 2 ) + pow( y - y0, 2 ) ) * ps;
115template <
typename realT>
128 for(
size_t j = 0; j < ny; ++j )
130 for(
size_t i = 0; i < nx; ++i )
134 realT rad = sqrt( pow( i - x0, 2 ) + pow( j - y0, 2 ) ) * ps;
150template <
typename realT>
156 return ( 0.488 / ( fwhm * fwhm ) ) * pow( 1. + ( 11. / 6. ) * pow( x / fwhm, 2 ), -11. / 6. );
166template <
typename realT>
177 realT encp =
static_cast<realT
>( 1 ) - b0 - b1;
182template <
typename realT>
183realT apeInt( realT x,
void *params )
185 realT eps = *
static_cast<realT *
>( params );
198template <
typename realT>
207 func.function = apeInt<realT>;
216 gsl_set_error_handler_off();
217 gsl_integration_qng( &func, 0, x1, 1e-7, 1e-7, &jint, &abserr, &neval );
229 realT eps2 = pow( eps, 2 );
231 realT encp =
static_cast<realT
>( 1 ) - b0 - b1 + eps2 * (
static_cast<realT
>( 1 ) - b0e - b1e );
233 encp = encp - 4 * eps * jint;
234 encp = encp / (
static_cast<realT
>( 1 ) - eps2 );
Declares and defines Bessel functions of the first kind.
realT airyPattern(realT x)
The classical Airy pattern.
realT airyPatternEnclosed(realT x)
Calculate the fraction of enclosed power at a given radius for the unobscured Airy Pattern.
realT seeingHalo(realT x, realT fwhm)
Seeing Halo Profile.
void airyPattern2D(realT *arr, size_t nx, size_t ny, const realT A0, const realT A, const realT x0, const realT y0, realT ps)
Fill in an array with the 2D arbitrarily-centered classical Airy pattern.
T2 bessel_j(T1 v, T2 x)
Bessel Functions of the First Kind.
T jinc(const T &x)
The Jinc function.
constexpr T pi()
Get the value of pi.
Declares and defines the Jinc and Jinc2 functions.