|
Spacecraft Control Framework 1.0
Spacecraft Control Library
|
Optics, image processing, and star identification. More...
Files | |
| file | sc_optics.h |
| Optical functions and types. | |
| file | sc_star_catalog.h |
| Star catalog class definitions. | |
| file | sc_star_image.h |
| Star image processing functions. | |
Classes | |
| struct | camera_data_s |
| struct | psf_data_s |
| Structure for storing point spread function data. More... | |
| struct | gaussian_psf_s |
| Structure for implementing a Gaussian psf. More... | |
| struct | airy_psf_s |
| Structure for implementing an Airy psf. More... | |
| struct | airydefocused_psf_s |
| Structure for implementing a defocused Airy psf. More... | |
| class | ImagePSF |
| Helper class for matching PSFs to images. More... | |
| class | star |
| Star object. More... | |
| class | star_catalog |
| Star catalog. More... | |
| struct | star_triad |
| Star triad structure. More... | |
| class | near_matrix |
| Near matrix class. More... | |
| class | star_meas |
| Identifies stars from a star catalog assuming a pinhole camera model. More... | |
Typedefs | |
| typedef struct camera_data_s | camera_data_t |
| typedef struct psf_data_s | psf_data_t |
| Structure for storing point spread function data. | |
| typedef gaussian_psf_s | gaussian_psf_t |
| Structure for implementing a Gaussian psf. | |
| typedef airy_psf_s | airy_psf_t |
| Structure for implementing an Airy psf. | |
| typedef airydefocused_psf_s | airydefocused_psf_t |
| Structure for implementing a defocused Airy psf. | |
| typedef struct star_triad | StarTriad |
| Star triad structure. More... | |
Functions | |
| double | effective_focal_length (ml_matrix distance, ml_matrix focal_length) |
| Computes effective focal length. More... | |
| double | diffraction_limit (double lambda, double aperture) |
| Diffraction resolution limit. More... | |
| ml_matrix | angle_of_view (double focal_length, ml_matrix d) |
| Angle of view from focal length with a 2D input. More... | |
| double | angle_of_view (double focal_length, double d) |
| Angle of view from focal length with a 1D input. More... | |
| ml_matrix | angle_of_view (ml_matrix focal_length, double d) |
| Angle of view from a matrix of focal lengths with a 1D input. More... | |
| double | focal_length_from_angle_of_view (double alpha, double d) |
| Focal length from angle of view. More... | |
| ml_matrix | separation_angles (ml_matrix u) |
| Separation angles and pairs. | |
| ml_matrix | pix_to_u (ml_matrix p, double f) |
| Converts a pixel map to a unit vector assuming a pinhole camera model. More... | |
| ml_matrix | u_to_pix (const ml_matrix &r, double f, double row=0, double col=0) |
| Converts a unit vector to a pixel map assuming a pinhole camera model. More... | |
| double | laser_beam_radius (double d, double lambda, double z) |
| Laser beam radius. More... | |
| double | laser_power (double d, double lambda, double z, double power) |
| Laser power. More... | |
| camera_data_t | camera_calibration (const ml_matrix &pD, const ml_matrix &pW) |
| Camera calibration. More... | |
| ml_matrix | calibration_cube (double w, double r, int n) |
| Camera cube. More... | |
| ml_matrix | camera_calibration_model (camera_data_t d, const ml_matrix &pW, double f) |
| Camera model. More... | |
| ml_matrix | imager_psf (ml_matrix PSF(const ml_matrix &x, const ml_matrix &y, void *context), psf_data_t *d) |
| Imager with point spread functions. More... | |
| void | imager_psf_uint16 (ml_matrix PSF(const ml_matrix &x, const ml_matrix &y, void *context), psf_data_t *d, uint16_t *frame) |
| Imager with point spread function return a uint16_t array. More... | |
| int | any_less_than (const ml_matrix &x, double d) |
| Find if any value of x is less than d. More... | |
| ml_matrix | rhs_gaussian_psf (const ml_matrix &x, const ml_matrix &y, void *context) |
| Gaussian point spread function. More... | |
| ml_matrix | rhs_airy_psf (const ml_matrix &x, const ml_matrix &y, void *context) |
| Airy point spread function. More... | |
| ml_matrix | rhs_airy_defocused_psf (const ml_matrix &x, const ml_matrix &y, void *context) |
| Defocused Airy point spread function. More... | |
| ml_matrix | rand_pn (double f, int n, int m) |
| Poisson random matrix. More... | |
| ml_matrix | fit_PSF_to_data (const ml_matrix &r0, const ml_matrix &intensity, const ml_matrix &pixels, int nUse, int mUse) |
| Fit PSF to coarse centroid data using numerical optimization. More... | |
| double | cost_psf (const ml_matrix &x, void *context) |
| PSF cost function. | |
Optics, image processing, and star identification.
Structure for storing camera data.
| typedef struct star_triad StarTriad |
Star triad structure.
Stores the integer ID of the three stars in the triad.
| double effective_focal_length | ( | ml_matrix | distance, |
| ml_matrix | focal_length | ||
| ) |
Computes effective focal length.
Computes effective focal length.
| distance | Array of distances between lenses |
| focal_length | Array of lens focal lengths |
| double diffraction_limit | ( | double | lambda, |
| double | aperture | ||
| ) |
Diffraction resolution limit.
Diffraction resolution limit.
| lambda | Wavelength |
| aperture | Width of aperture |
| ml_matrix angle_of_view | ( | double | focal_length, |
| ml_matrix | d | ||
| ) |
Angle of view from focal length with a 2D input.
Angle of view from focal length with a 2D input.
| focal_length | Focal length |
| d | Width of imaging chip |
| double angle_of_view | ( | double | focal_length, |
| double | d | ||
| ) |
Angle of view from focal length with a 1D input.
Angle of view from focal length with a 1D input.
The width and focal length must have the same units.
| focal_length | Focal length |
| d | Width of imaging chip |
| ml_matrix angle_of_view | ( | ml_matrix | focal_length, |
| double | d | ||
| ) |
Angle of view from a matrix of focal lengths with a 1D input.
Angle of view from a matrix of focal lengths with a 1D input.
| focal_length | Focal length |
| d | Width of imaging chip |
| double focal_length_from_angle_of_view | ( | double | alpha, |
| double | d | ||
| ) |
Focal length from angle of view.
Focal length from angle of view.
| alpha | Angle of view |
| ml_matrix pix_to_u | ( | ml_matrix | p, |
| double | f | ||
| ) |
Converts a pixel map to a unit vector assuming a pinhole camera model.
Converts a pixel map to a unit vector assuming a pinhole camera model.
| p | Pixel coordinates |
| f | Focal length in pixel units |
Referenced by star_meas::Pyramid().
| ml_matrix u_to_pix | ( | const ml_matrix & | r, |
| double | f, | ||
| double | row, | ||
| double | col | ||
| ) |
Converts a unit vector to a pixel map assuming a pinhole camera model.
Converts a unit vector to a pixel map assuming a pinhole camera model.
Includes an offset. If row and col are zero then 0,0 is the center of the imager.
| r | Position vector |
| f | Focal length in pixels |
Referenced by PinholeCamera::Update().
| double laser_beam_radius | ( | double | d, |
| double | lambda, | ||
| double | z | ||
| ) |
Laser beam radius.
Laser beam radius.
| d | Aperture (m) |
| lambda | Wavelength (m) |
| range | (m) |
References PI.
Referenced by laser_power().
| double laser_power | ( | double | d, |
| double | lambda, | ||
| double | z, | ||
| double | power | ||
| ) |
Laser power.
Laser power.
| d | Aperture (m) |
| lambda | Wavelength (m) |
| range | (m) |
| power | (m) |
References laser_beam_radius().
| camera_data_t camera_calibration | ( | const ml_matrix & | pD, |
| const ml_matrix & | pW | ||
| ) |
Camera calibration.
| d | Measured coordinates (m) |
| pW | World points (m) |
References camera_data_s::alpha, camera_data_s::f, camera_data_s::k1, camera_data_s::k2, camera_data_s::o, orthogonalize(), pinv(), camera_data_s::R, camera_data_s::s, and camera_data_s::T.
| ml_matrix calibration_cube | ( | double | w, |
| double | r, | ||
| int | n | ||
| ) |
Camera cube.
Camera cube.
| w | Width of square (m) |
| r | Cube width (m) |
| n | Number of squares |
| ml_matrix camera_calibration_model | ( | camera_data_t | d, |
| const ml_matrix & | pW, | ||
| double | f | ||
| ) |
Camera model.
Camera model.
| d | Camera data structure |
| pW | World points (m) |
References camera_data_s::o, camera_data_s::R, camera_data_s::s, and camera_data_s::T.
| ml_matrix imager_psf | ( | ml_matrix | PSFconst ml_matrix &x, const ml_matrix &y, void *context, |
| psf_data_t * | d | ||
| ) |
Imager with point spread functions.
Imager with point spread functions.
The functions are integrated using two_dimensional_integration().
| PSF | Point spread function |
| d | Data to be passed to PSF |
References any_less_than(), psf_data_s::m, psf_data_s::n, psf_data_s::r, two_dimensional_integration(), psf_data_s::x_pixel, and psf_data_s::y_pixel.
Referenced by cost_psf().
| void imager_psf_uint16 | ( | ml_matrix | PSFconst ml_matrix &x, const ml_matrix &y, void *context, |
| psf_data_t * | d, | ||
| uint16_t * | frame | ||
| ) |
Imager with point spread function return a uint16_t array.
Imager with point spread function return a uint16_t array.
The functions are integrated using two_dimensional_integration().
| PSF | Point spread function |
| d | Data to be passed to PSF |
| frame | Frame uint16_t[n*m] |
References any_less_than(), psf_data_s::m, psf_data_s::n, psf_data_s::r, two_dimensional_integration(), psf_data_s::x_pixel, and psf_data_s::y_pixel.
| int any_less_than | ( | const ml_matrix & | x, |
| double | d | ||
| ) |
Find if any value of x is less than d.
Find if any value of x is less than d.
| x | matrix to be tested |
| d | value to test again |
Referenced by imager_psf(), and imager_psf_uint16().
| ml_matrix rhs_gaussian_psf | ( | const ml_matrix & | x, |
| const ml_matrix & | y, | ||
| void * | context | ||
| ) |
Gaussian point spread function.
This is in a format to be integrated by two_dimensional_integration. The context pointer should be data of type gaussian_psf_t to be passed to the PSF.
| x | x pixel coordinates |
| y | y pixel coordinates |
| context | Data including rPSF, iPSF, and sigma |
References psf_data_s::i, psf_data_s::r, and gaussian_psf_s::sigma.
Referenced by cost_psf().
| ml_matrix rhs_airy_psf | ( | const ml_matrix & | x, |
| const ml_matrix & | y, | ||
| void * | context | ||
| ) |
Airy point spread function.
Airy point spread function.
This function uses the Bessel function of the first kind, j1.
| x | (n,m) X coordinates (um) |
| y | (n,m) Y coordinates (um) |
| context | PSF data of type airy_psf_t |
References airy_psf_s::aperture, airy_psf_s::f_length, psf_data_s::i, PI, psf_data_s::r, and airy_psf_s::wavelength.
| ml_matrix rhs_airy_defocused_psf | ( | const ml_matrix & | x, |
| const ml_matrix & | y, | ||
| void * | context | ||
| ) |
Defocused Airy point spread function.
Defocused Airy point spread function.
A spherical wavefront W yields an aberration-free image in the Gaussian image plane at a distance R. A defocused image is formed when observed in a plane at a distance z.
The defocused irradiance is:
I(r,z) = (2R/z)^2 | int_0^1 {exp(i B_d rho^2) J0( pi*(R/z)rho*r ) rho drho} |^2
where z is the distance to the defocused image plane and R is the distance to the Gaussian image plane. rho is r/a, 0 <= rho <= 1, and a is the (half) aperture. B_d is the peak defocus phase aberration:
B_d(z) = pi a^2/(lambda*R) * (R/z - 1)
where lambda is the wavelength.
The defocused Airy function requires numerical integration. A trapezoid method is used for speed.
| x | X coordinates (n,m) |
| y | Y coordinates (n,m) |
| context | Data required by PSF |
References airy_psf_s::aperture, airydefocused_psf_s::defocus, airy_psf_s::f_length, psf_data_s::i, PI, psf_data_s::r, trapezoidal_integration(), and airy_psf_s::wavelength.
| ml_matrix rand_pn | ( | double | lambda, |
| int | n, | ||
| int | m | ||
| ) |
Poisson random matrix.
| lambda | Parameter |
| n | Rows |
| m | Columns |
Referenced by imager_model::update().
| ml_matrix fit_PSF_to_data | ( | const ml_matrix & | r0, |
| const ml_matrix & | intensity, | ||
| const ml_matrix & | pixels, | ||
| int | nUse, | ||
| int | mUse | ||
| ) |
Fit PSF to coarse centroid data using numerical optimization.
Fit PSF to coarse centroid data using numerical optimization.
Refine the pixel fit numerically using search via downhill_simplex().
| r0 | Estimated centroids from COM method (2,n) |
| intensity | Measured intensity (1,n) |
| pixels | Pixel data (:,:) |
References cost_psf(), downhill_simplex(), psf_data_s::i, psf_data_s::m, psf_data_s::n, ImagePSF::psf_data, psf_data_s::r, gaussian_psf_s::sigma, psf_data_s::x_pixel, and psf_data_s::y_pixel.