CR2RE Pipeline Reference Manual 1.6.8
hdrl_strehl.h
1/*
2 * This file is part of the HDRL
3 * Copyright (C) 2014 European Southern Observatory
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#ifndef HDRL_STREHL_H
21#define HDRL_STREHL_H
22
23/*-----------------------------------------------------------------------------
24 Includes
25 -----------------------------------------------------------------------------*/
26#include "hdrl_types.h"
27#include "hdrl_image.h"
28#include <cpl.h>
29
30CPL_BEGIN_DECLS
31
32/*-----------------------------------------------------------------------------
33 Define
34 -----------------------------------------------------------------------------*/
35
36/*-----------------------------------------------------------------------------
37 Functions prototypes
38 -----------------------------------------------------------------------------*/
39
40typedef struct {
41 /* computed strehl value and its propagated error */
42 hdrl_value strehl_value;
43 /* computed x and y position of the star peak */
44 double star_x, star_y;
45 /* star peak and its propagated error */
46 hdrl_value star_peak;
47 /* star flux and its propagated error */
48 hdrl_value star_flux;
49 /* star background and its propagated error */
50 hdrl_value star_background;
51 /* star background error estimated from image
52 * on normal data sqrt(pi / 2) larger that star_background error as it is
53 * estimated via a median */
54 double computed_background_error;
55 /* number of pixels used for background estimation */
56 size_t nbackground_pixels;
57} hdrl_strehl_result;
58
59hdrl_parameter * hdrl_strehl_parameter_create(double wavelength,
60 double m1_radius, double m2_radius,
61 double pixel_scale_x, double pixel_scale_y, double flux_radius,
62 double bkg_radius_low, double bkg_radius_high);
63
64cpl_parameterlist * hdrl_strehl_parameter_create_parlist(
65 const char * base_context,
66 const char * prefix,
67 hdrl_parameter * par);
68
70 const cpl_parameterlist * parlist,
71 const char * prefix);
72
73hdrl_strehl_result
74hdrl_strehl_compute(const hdrl_image * himg, hdrl_parameter* params);
75
76#if defined HDRL_USE_EXPERIMENTAL || defined HDRL_USE_PRIVATE
77
78cpl_boolean hdrl_strehl_parameter_check(const hdrl_parameter *);
79
80double hdrl_strehl_parameter_get_wavelength(const hdrl_parameter * p);
81double hdrl_strehl_parameter_get_m1(const hdrl_parameter * p);
82double hdrl_strehl_parameter_get_m2(const hdrl_parameter * p);
83double hdrl_strehl_parameter_get_pixel_scale_x(const hdrl_parameter * p);
84double hdrl_strehl_parameter_get_pixel_scale_y(const hdrl_parameter * p);
85double hdrl_strehl_parameter_get_flux_radius(const hdrl_parameter * p);
86double hdrl_strehl_parameter_get_bkg_radius_low(const hdrl_parameter * p);
87double hdrl_strehl_parameter_get_bkg_radius_high(const hdrl_parameter * p);
88
89#endif
90
91CPL_END_DECLS
92
93#endif
double hdrl_strehl_parameter_get_m1(const hdrl_parameter *p)
Access the primary mirror radius in the Strehl parameter.
Definition: hdrl_strehl.c:247
cpl_parameterlist * hdrl_strehl_parameter_create_parlist(const char *base_context, const char *prefix, hdrl_parameter *par)
Create parameter list for the Strehl computation.
Definition: hdrl_strehl.c:360
hdrl_strehl_result hdrl_strehl_compute(const hdrl_image *himg, hdrl_parameter *params)
This function computes the Strehl ratio.
Definition: hdrl_strehl.c:1326
double hdrl_strehl_parameter_get_flux_radius(const hdrl_parameter *p)
Access the total flux radius in the Strehl parameter.
Definition: hdrl_strehl.c:303
double hdrl_strehl_parameter_get_wavelength(const hdrl_parameter *p)
Access the wavelength in the Strehl parameter.
Definition: hdrl_strehl.c:233
double hdrl_strehl_parameter_get_m2(const hdrl_parameter *p)
Access the obstruction radius in the Strehl parameter.
Definition: hdrl_strehl.c:261
double hdrl_strehl_parameter_get_bkg_radius_high(const hdrl_parameter *p)
Access the background region external radius in the Strehl parameter.
Definition: hdrl_strehl.c:331
hdrl_parameter * hdrl_strehl_parameter_create(double wavelength, double m1_radius, double m2_radius, double pixel_scale_x, double pixel_scale_y, double flux_radius, double bkg_radius_low, double bkg_radius_high)
Creates Strehl Parameters object.
Definition: hdrl_strehl.c:188
double hdrl_strehl_parameter_get_pixel_scale_x(const hdrl_parameter *p)
Access the image X pixel scale in the Strehl parameter.
Definition: hdrl_strehl.c:275
double hdrl_strehl_parameter_get_bkg_radius_low(const hdrl_parameter *p)
Access the background region internal radius in the Strehl parameter.
Definition: hdrl_strehl.c:317
hdrl_parameter * hdrl_strehl_parameter_parse_parlist(const cpl_parameterlist *parlist, const char *prefix)
Parse parameter list to create input parameters for the Strehl.
Definition: hdrl_strehl.c:448
cpl_boolean hdrl_strehl_parameter_check(const hdrl_parameter *self)
Check that the parameter is a Strehl parameter.
Definition: hdrl_strehl.c:221
double hdrl_strehl_parameter_get_pixel_scale_y(const hdrl_parameter *p)
Access the image Y pixel scale in the Strehl parameter.
Definition: hdrl_strehl.c:289