CR2RE Pipeline Reference Manual 1.6.7
cr2res_photom.c
1/*
2 * This file is part of the CR2RES Pipeline
3 * Copyright (C) 2002,2003 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 02111-1307 USA
18 */
19
20#ifdef HAVE_CONFIG_H
21#include <config.h>
22#endif
23
24/*-----------------------------------------------------------------------------
25 Includes
26 -----------------------------------------------------------------------------*/
27
28#include <string.h>
29#include <math.h>
30#include <cpl.h>
31
32#include "cr2res_photom.h"
33#include "cr2res_dfs.h"
34#include "cr2res_pfits.h"
35#include "cr2res_utils.h"
36#include "cr2res_extract.h"
37
38/*-----------------------------------------------------------------------------
39 Functions Prototypes
40 -----------------------------------------------------------------------------*/
41
42static double cr2res_photom_throughput_avg(
43 const cpl_vector * vec,
44 const cpl_vector * wl,
45 const char * setting) ;
46
47static cpl_vector * cr2res_photom_conversion(
48 const cpl_bivector * star,
49 const cpl_bivector * photflux,
50 double exptime) ;
51
52static cpl_vector * cr2res_photom_throughput(
53 const cpl_vector * conversion,
54 const cpl_vector * wl,
55 double gain) ;
56
57static cpl_vector * cr2res_photom_sensitivity(
58 const cpl_vector * conversion,
59 const cpl_vector * sigma,
60 double exptime) ;
61
62static int cr2res_photom_star_find(
63 const cpl_vector * v_ra,
64 const cpl_vector * v_dec,
65 double ra,
66 double dec,
67 double maxdist,
68 double * pdist) ;
69
70static double cr2res_photom_great_circle_dist(
71 double ra1,
72 double dec1,
73 double ra2,
74 double dec2) ;
75
76/*----------------------------------------------------------------------------*/
80/*----------------------------------------------------------------------------*/
81
84/*----------------------------------------------------------------------------*/
101/*----------------------------------------------------------------------------*/
103 const cpl_table * extr,
104 const char * std_star_file,
105 const char * setting,
106 double ra,
107 double dec,
108 double gain,
109 double exptime,
110 int display,
111 int display_order,
112 int display_trace,
113 cpl_table ** throughput,
114 cpl_propertylist ** ext_plist)
115{
116 cpl_table * std_star_tab ;
117 cpl_bivector * std_star_biv ;
118 cpl_table * throughput_loc ;
119 cpl_array * col_names ;
120 char * cwname ;
121 char * csname ;
122 char * ccname ;
123 char * ctname ;
124 cpl_bivector * spec_biv ;
125 cpl_bivector * spec_err_biv ;
126 cpl_vector * conversion_vec ;
127 cpl_vector * throughput_vec ;
128 cpl_vector * sensitivity_vec ;
129 double throughput_avg_val, throughput_center ;
130 int throughput_avg_nb ;
131 cpl_propertylist * plist ;
132 const double * pdata ;
133 cpl_size j, ncols ;
134 int order, trace_nb ;
135
136 /* Test entries */
137 if (extr==NULL || std_star_file==NULL || setting == NULL ||
138 throughput==NULL || ext_plist == NULL) return -1 ;
139
140 /* Initialise */
141 throughput_avg_val = 0.0 ;
142 throughput_avg_nb = 0 ;
143
144 /* Load the std stars table */
145 if ((std_star_tab = cpl_table_load(std_star_file, 1, 0)) == NULL) {
146 cpl_msg_error(__func__, "Cannot load the std star table") ;
147 return -1 ;
148 }
149
150 /* Search for the proper star */
151 if ((std_star_biv = cr2res_photom_conv_get_star(std_star_tab, ra, dec)) ==
152 NULL) {
153 cpl_msg_error(__func__, "Cannot find the star flux") ;
154 cpl_table_delete(std_star_tab) ;
155 return -1 ;
156 }
157 cpl_table_delete(std_star_tab) ;
158
159 /* Create the output table */
160 throughput_loc = cpl_table_new(cpl_table_get_nrow(extr)) ;
161
162 /* Loop on the extracted spectra */
163 col_names = cpl_table_get_column_names(extr);
164 ncols = cpl_table_get_ncol(extr) ;
165 for (j=0 ; j<ncols ; j++) {
166 const char *col_name;
167 char *col_type;
168 col_name = cpl_array_get_string(col_names, j);
169 col_type = cr2res_dfs_SPEC_colname_parse(col_name, &order, &trace_nb) ;
170 if (col_type != NULL && !strcmp(col_type, CR2RES_COL_SPEC_SUFFIX)) {
171 /* Get this extracted spectrum */
172 if (cr2res_extract_EXTRACT1D_get_spectrum(extr, order, trace_nb,
173 &spec_biv, &spec_err_biv)) {
174 cpl_msg_error(__func__, "Cannot get the extracted spectrum") ;
175 cpl_free(col_type) ;
176 continue ;
177 }
178 cpl_msg_info(__func__,
179 "Conversion/Sensitivity/Throughput for order/trace: %d/%d",
180 order, trace_nb) ;
181
182 /* Conversion */
183 if ((conversion_vec = cr2res_photom_conversion(spec_biv,
184 std_star_biv, exptime))==NULL) {
185 cpl_msg_warning(__func__,
186 "Cannot compute the conversion factor");
187 cpl_error_reset() ;
188 cpl_bivector_delete(spec_biv) ;
189 cpl_bivector_delete(spec_err_biv) ;
190 cpl_free(col_type) ;
191 continue ;
192 }
193
194 /* Throughput */
195 if ((throughput_vec = cr2res_photom_throughput(conversion_vec,
196 cpl_bivector_get_x_const(spec_biv), gain))==NULL) {
197 cpl_msg_warning(__func__, "Cannot compute the throughput");
198 cpl_error_reset() ;
199 cpl_bivector_delete(spec_biv) ;
200 cpl_bivector_delete(spec_err_biv) ;
201 cpl_vector_delete(conversion_vec) ;
202 if (col_type != NULL) cpl_free(col_type) ;
203 continue ;
204 }
205
206 /* Sensitivity */
207 if ((sensitivity_vec = cr2res_photom_sensitivity(conversion_vec,
208 cpl_bivector_get_y_const(spec_err_biv),
209 exptime))==NULL) {
210 cpl_msg_warning(__func__, "Cannot compute the sensitivity");
211 cpl_error_reset() ;
212 cpl_bivector_delete(spec_biv) ;
213 cpl_bivector_delete(spec_err_biv) ;
214 cpl_vector_delete(conversion_vec) ;
215 cpl_vector_delete(throughput_vec) ;
216 if (col_type != NULL) cpl_free(col_type) ;
217 continue ;
218 }
219
220 /* Add to the table */
221 /* Create/Fill WAVELENGTH column */
222 cwname = cr2res_dfs_WAVELENGTH_colname(order, trace_nb) ;
223 cpl_table_new_column(throughput_loc, cwname, CPL_TYPE_DOUBLE);
224 pdata = cpl_bivector_get_x_data_const(spec_biv) ;
225 cpl_table_copy_data_double(throughput_loc, cwname, pdata) ;
226
227 /* Create/Fill CONVERSION column */
228 ccname = cr2res_dfs_CONVERSION_colname(order, trace_nb) ;
229 cpl_table_new_column(throughput_loc, ccname, CPL_TYPE_DOUBLE);
230 pdata = cpl_vector_get_data_const(conversion_vec) ;
231 cpl_table_copy_data_double(throughput_loc, ccname, pdata) ;
232
233 /* Create/Fill SENSITIVITY column */
234 csname = cr2res_dfs_SENSITIVITY_colname(order, trace_nb) ;
235 cpl_table_new_column(throughput_loc, csname, CPL_TYPE_DOUBLE);
236 pdata = cpl_vector_get_data_const(sensitivity_vec) ;
237 cpl_table_copy_data_double(throughput_loc, csname, pdata) ;
238
239 /* Create/Fill THROUGHPUT column */
240 ctname = cr2res_dfs_THROUGHPUT_colname(order, trace_nb) ;
241 cpl_table_new_column(throughput_loc, ctname, CPL_TYPE_DOUBLE);
242 pdata = cpl_vector_get_data_const(throughput_vec) ;
243 cpl_table_copy_data_double(throughput_loc, ctname, pdata) ;
244
245 /* Compute QCs */
246 throughput_center = cr2res_photom_throughput_avg(throughput_vec,
247 cpl_bivector_get_x_const(spec_biv), setting) ;
248 if (fabs(throughput_center+1.0) > 1e-3) {
249 throughput_avg_nb ++ ;
250 throughput_avg_val += throughput_center ;
251 }
252
253 cpl_vector_delete(conversion_vec) ;
254 cpl_vector_delete(sensitivity_vec) ;
255 cpl_vector_delete(throughput_vec) ;
256 cpl_bivector_delete(spec_biv) ;
257 cpl_bivector_delete(spec_err_biv) ;
258
259 /* Plot on request */
260 if (display && display_trace==trace_nb && display_order==order) {
261 cpl_plot_column(
262"set grid;set xlabel 'Wavelength (nm)';set ylabel 'Conversion (ADU/sec/Jy)';",
263 "t 'Conversion factor' w lines", "",
264 throughput_loc, cwname, ccname) ;
265 cpl_plot_column(
266"set grid;set xlabel 'Wavelength (nm)';set ylabel 'Sensitivity (Jy/10sig/hour)';",
267 "t 'Sensitivity' w lines", "",
268 throughput_loc, cwname, csname) ;
269 cpl_plot_column(
270"set grid;set xlabel 'Wavelength (nm)';set ylabel 'Throughput (e-/photons)';",
271 "t 'Throughput' w lines", "",
272 throughput_loc, cwname, ctname) ;
273 }
274 cpl_free(cwname) ;
275 cpl_free(ccname) ;
276 cpl_free(csname) ;
277 cpl_free(ctname) ;
278 }
279 if (col_type != NULL) cpl_free(col_type) ;
280 }
281 cpl_array_delete(col_names) ;
282 cpl_bivector_delete(std_star_biv) ;
283
284 plist = cpl_propertylist_new() ;
285 if (throughput_avg_nb > 0) {
286 cpl_propertylist_append_double(plist, CR2RES_HEADER_QC_THROUGHPUT,
287 throughput_avg_val / throughput_avg_nb) ;
288 }
289 *throughput = throughput_loc ;
290 *ext_plist = plist ;
291 return 0 ;
292}
293
294/*----------------------------------------------------------------------------*/
302/*----------------------------------------------------------------------------*/
304 const cpl_table * tab,
305 double ra,
306 double dec)
307{
308 cpl_vector * ras ;
309 cpl_vector * decs ;
310 double maxdist, dist ;
311 int ind ;
312 cpl_array * wave ;
313 cpl_array * flux ;
314 cpl_vector * wave_vec ;
315 cpl_vector * flux_vec ;
316 cpl_bivector * flux_biv ;
317
318 /* Test entries */
319 if (tab == NULL) return NULL ;
320
321 /* Initialise CR2RES_PHOTOM_STARSDIST_ARCSEC arcsec in degrees*/
322 maxdist = CR2RES_PHOTOM_STARSDIST_ARCSEC / 3600.0 ;
323
324 /* Get the RAs and DECs */
325 ras = cpl_vector_wrap(cpl_table_get_nrow(tab),
326 cpl_table_get_data_double((cpl_table*)tab, CR2RES_COL_RA)) ;
327 decs = cpl_vector_wrap(cpl_table_get_nrow(tab),
328 cpl_table_get_data_double((cpl_table*)tab, CR2RES_COL_DEC)) ;
329
330 /* Find the star */
331 cpl_msg_info(__func__, "Search a star around RA=%g, DEC=%g in the catalog",
332 ra, dec) ;
333 if ((ind = cr2res_photom_star_find(ras, decs, ra, dec, maxdist,
334 NULL)) < 0) {
335 cpl_msg_error(__func__, "No star found") ;
336 cpl_vector_unwrap(ras) ;
337 cpl_vector_unwrap(decs) ;
338 return NULL ;
339 }
340 dist = 3600 * cr2res_photom_great_circle_dist(cpl_vector_get(ras,
341 ind), cpl_vector_get(decs, ind), ra, dec) ;
342 cpl_msg_info(__func__, "Star found: %s at RA=%g, DEC=%g at %g arcsec",
343 cpl_table_get_string(tab, CR2RES_COL_STDNAME, ind),
344 cpl_vector_get(ras, ind), cpl_vector_get(decs, ind),
345 dist) ;
346 cpl_vector_unwrap(ras) ;
347 cpl_vector_unwrap(decs) ;
348
349 /* Load the star */
350 wave=cpl_array_duplicate(cpl_table_get_array(tab,CR2RES_COL_PHOTOFLUX,0));
351 flux=cpl_array_duplicate(cpl_table_get_array(tab,CR2RES_COL_PHOTOFLUX,ind));
352 wave_vec = cpl_vector_wrap(cpl_array_get_size(wave),
353 cpl_array_get_data_double(wave)) ;
354 flux_vec = cpl_vector_wrap(cpl_array_get_size(flux),
355 cpl_array_get_data_double(flux)) ;
356 cpl_array_unwrap(wave) ;
357 cpl_array_unwrap(flux) ;
358 flux_biv=cpl_bivector_wrap_vectors(wave_vec, flux_vec) ;
359 return flux_biv ;
360}
361
364/*----------------------------------------------------------------------------*/
371/*----------------------------------------------------------------------------*/
372static double cr2res_photom_throughput_avg(
373 const cpl_vector * vec,
374 const cpl_vector * wl,
375 const char * setting)
376{
377 const double * pvec ;
378 const double * pwl ;
379 double sum, wmin, wmax ;
380 cpl_size nelem, i ;
381 int nsum ;
382
383 /* Check entries */
384 if (vec == NULL || wl == NULL) return -1.0 ;
385 nelem = cpl_vector_get_size(vec) ;
386 if (cpl_vector_get_size(wl) != nelem) return -1.0 ;
387
388 /* Initialize */
389 wmin = wmax = -1.0 ;
390
391 /* Check the setting */
392 if (!strcmp(setting, "Y1028")) {
393 wmin = 1045.70 ;
394 wmax = 1047.00 ;
395 } else if (!strcmp(setting, "J1228")) {
396 wmin = 1245.50 ;
397 wmax = 1246.40 ;
398 } else if (!strcmp(setting, "H1567")) {
399 wmin = 1695.20 ;
400 wmax = 1696.20 ;
401 } else if (!strcmp(setting, "K2148")) {
402 wmin = 2312.60 ;
403 wmax = 2313.30 ;
404 } else if (!strcmp(setting, "L3377")) {
405 wmin = 3828.70 ;
406 wmax = 3829.30 ;
407 } else if (!strcmp(setting, "M4266")) {
408 wmin = 3953.00 ;
409 wmax = 3953.90 ;
410 }
411 if (wmin < 0.0 || wmax < 0.0) return -1.0 ;
412
413 cpl_msg_info(__func__, "Compute the QC.THROUGHPUT between %g and %g nm",
414 wmin, wmax) ;
415
416 pvec = cpl_vector_get_data_const(vec) ;
417 pwl = cpl_vector_get_data_const(wl) ;
418 sum = 0.0 ;
419 nsum = 0 ;
420
421 for (i=0 ; i<nelem ; i++) {
422 if (pwl[i]>wmin && pwl[i]<wmax) {
423 sum += pvec[i] ;
424 nsum++ ;
425 }
426 }
427 if (nsum > 0) return sum/nsum ;
428 else return -1.0 ;
429}
430
431/*----------------------------------------------------------------------------*/
449/*----------------------------------------------------------------------------*/
450static cpl_vector * cr2res_photom_conversion(
451 const cpl_bivector * star,
452 const cpl_bivector * photflux,
453 double exptime)
454{
455 cpl_vector * conversion ;
456 cpl_bivector * model ;
457 double * pmodel ;
458 int i ;
459
460 /* Check entries */
461 if (star == NULL) return NULL ;
462 if (photflux == NULL) return NULL ;
463 if (fabs(exptime) < 1e-3) return NULL ;
464
465 /* Resample the model */
466 model = cpl_bivector_duplicate(star) ;
467 if (cpl_bivector_interpolate_linear(model, photflux) != CPL_ERROR_NONE) {
468 cpl_msg_error(__func__, "Cannot interpolate the signal") ;
469 cpl_bivector_delete(model) ;
470 return NULL ;
471 }
472
473 /* Set to 1 the values that are 0 */
474 pmodel = cpl_vector_get_data(cpl_bivector_get_y(model)) ;
475 for (i=0 ; i<cpl_bivector_get_size(model) ; i++) {
476 if (fabs(pmodel[i]) == 0.0) pmodel[i] = 1.0 ;
477 }
478
479 /* Create the conversion */
480 conversion = cpl_vector_duplicate(cpl_bivector_get_y_const(star)) ;
481 cpl_vector_divide_scalar(conversion, exptime) ;
482
483 if (cpl_vector_divide(conversion,
484 cpl_bivector_get_y(model)) != CPL_ERROR_NONE) {
485 cpl_msg_error(__func__, "Cannot divide the star by the model") ;
486 cpl_bivector_delete(model) ;
487 return NULL ;
488 }
489 cpl_bivector_delete(model) ;
490 return conversion ;
491}
492
493/*----------------------------------------------------------------------------*/
512/*----------------------------------------------------------------------------*/
513static cpl_vector * cr2res_photom_throughput(
514 const cpl_vector * conversion,
515 const cpl_vector * wl,
516 double gain)
517{
518 double h, S ;
519 cpl_vector * throughput ;
520 cpl_vector * wave_m ;
521 cpl_vector * dwave_m ;
522 double * pdwave_m ;
523 int i ;
524
525 /* Check entries */
526 if (conversion == NULL) return NULL ;
527 if (wl == NULL) return NULL ;
528
529 /* Initialise */
530 h = 6.626e-34 ;
531 S = 16 * 3.141592653589793238462 ;
532
533 /* Wavelength in meters */
534 wave_m = cpl_vector_duplicate(wl) ;
535 cpl_vector_multiply_scalar(wave_m, 1e-9) ;
536
537 /* Wavelength per pixels */
538 dwave_m = cpl_vector_duplicate(wave_m) ;
539 pdwave_m = cpl_vector_get_data(dwave_m) ;
540 for (i=cpl_vector_get_size(dwave_m)-1 ; i>0 ; i--)
541 pdwave_m[i] -= pdwave_m[i-1] ;
542 pdwave_m[0] = pdwave_m[1] ;
543
544 /* Compute the throughput */
545 throughput = cpl_vector_duplicate(conversion) ;
546 cpl_vector_multiply_scalar(throughput, gain) ;
547 cpl_vector_multiply_scalar(throughput, h) ;
548 cpl_vector_multiply(throughput, wave_m) ;
549 cpl_vector_divide_scalar(throughput, 1e-32) ;
550 cpl_vector_divide_scalar(throughput, S) ;
551 cpl_vector_divide(throughput, dwave_m) ;
552 cpl_vector_divide_scalar(throughput, 1e6) ;
553
554 cpl_vector_delete(dwave_m) ;
555 cpl_vector_delete(wave_m) ;
556 return throughput ;
557}
558
559/*----------------------------------------------------------------------------*/
576/*----------------------------------------------------------------------------*/
577static cpl_vector * cr2res_photom_sensitivity(
578 const cpl_vector * conversion,
579 const cpl_vector * sigma,
580 double exptime)
581{
582 cpl_vector * sensitivity ;
583 double factor ;
584 const double * pconversion ;
585 double * psensitivity ;
586 int i ;
587
588 /* Check entries */
589 if (conversion == NULL) return NULL ;
590 if (sigma == NULL) return NULL ;
591 if (exptime < 0) return NULL ;
592
593 /* Get access to data */
594 pconversion = cpl_vector_get_data_const(conversion) ;
595 sensitivity = cpl_vector_duplicate(sigma) ;
596 psensitivity = cpl_vector_get_data(sensitivity) ;
597
598 /* Compute sensitivity */
599 for (i=0 ; i<cpl_vector_get_size(conversion) ; i++) {
600 if (fabs(pconversion[i])<1e-5) psensitivity[i] = 0.0 ;
601 else psensitivity[i] /= pconversion[i] ;
602 }
603 for (i=0 ; i<11 ; i++) psensitivity[i] = 0 ;
604
605 /* Compute the factor */
606 factor = sqrt(exptime/3600) * 10 ;
607
608 /* Multiply by the factor */
609 if (cpl_vector_multiply_scalar(sensitivity, factor) != CPL_ERROR_NONE) {
610 cpl_msg_error(__func__, "Cannot multiply by the factor") ;
611 cpl_vector_delete(sensitivity) ;
612 return NULL ;
613 }
614 return sensitivity ;
615}
616
617/*----------------------------------------------------------------------------*/
632/*----------------------------------------------------------------------------*/
633static int cr2res_photom_star_find(
634 const cpl_vector * v_ra,
635 const cpl_vector * v_dec,
636 double ra,
637 double dec,
638 double maxdist,
639 double * pdist)
640{
641 int nra, ndec, minind ;
642 double dmin;
643 const double * pv_ra ;
644 const double * pv_dec ;
645 int i ;
646
647 /* Test inputs */
648 if (v_ra == NULL || v_dec == NULL) return -1 ;
649
650 /* Initialise */
651 dmin = 0 ;
652 minind = -1 ;
653 nra = cpl_vector_get_size(v_ra) ;
654 ndec = cpl_vector_get_size(v_dec) ;
655 pv_ra = cpl_vector_get_data_const(v_ra) ;
656 pv_dec = cpl_vector_get_data_const(v_dec) ;
657
658 /* Test inputs */
659 if (nra != ndec) return -1 ;
660 if (maxdist < 0) return -1 ;
661
662 /* Find the index of the star closest to the given coordinate */
663 for (i=0 ; i < nra ; i++) {
664 double gdist;
665 /* Get the distance */
666 gdist = cr2res_photom_great_circle_dist(pv_ra[i], pv_dec[i], ra, dec);
667 if (i == 0 || gdist < dmin) {
668 minind = i;
669 dmin = gdist;
670 }
671 }
672 if (pdist != NULL) *pdist = dmin;
673
674 /* Check that it is close enough */
675 if (dmin > maxdist) return -1 ;
676 return minind ;
677}
678
679/*----------------------------------------------------------------------------*/
689/*----------------------------------------------------------------------------*/
690static double cr2res_photom_great_circle_dist(
691 double ra1,
692 double dec1,
693 double ra2,
694 double dec2)
695{
696 /* Convert all input from degrees to radian - and back for the result */
697 const double dra = sin( atan(1.0)/45.0 * (ra2 - ra1 )/2.0 );
698 const double ddec = sin( atan(1.0)/45.0 * (dec2 - dec1)/2.0 );
699
700 dec1 *= atan(1.0)/45.0;
701 dec2 *= atan(1.0)/45.0;
702
703 return 2.0 * asin(sqrt( ddec*ddec + cos(dec1)*cos(dec2)*dra*dra))
704 * 45.0/atan(1.0);
705}
char * cr2res_dfs_CONVERSION_colname(int order_idx, int trace)
Get the CONVERSION column name for a given order/trace.
Definition: cr2res_dfs.c:324
char * cr2res_dfs_SENSITIVITY_colname(int order_idx, int trace)
Get the SENSITIVITY column name for a given order/trace.
Definition: cr2res_dfs.c:342
char * cr2res_dfs_WAVELENGTH_colname(int order_idx, int trace)
Get the WAVELENGTH column name for a given order/trace.
Definition: cr2res_dfs.c:396
char * cr2res_dfs_SPEC_colname_parse(const char *colname, int *order_idx, int *trace)
Parse a column name ORDER_TRACE_TYPE format.
Definition: cr2res_dfs.c:505
char * cr2res_dfs_THROUGHPUT_colname(int order_idx, int trace)
Get the THROUGHPUT column name for a given order/trace.
Definition: cr2res_dfs.c:360
int cr2res_extract_EXTRACT1D_get_spectrum(const cpl_table *tab, int order, int trace_nb, cpl_bivector **spec, cpl_bivector **spec_err)
Get a Spectrum and its error from the EXTRACT_1D table.
cpl_bivector * cr2res_photom_conv_get_star(const cpl_table *tab, double ra, double dec)
Get the wished std star photospheric flux.
int cr2res_photom_engine(const cpl_table *extr, const char *std_star_file, const char *setting, double ra, double dec, double gain, double exptime, int display, int display_order, int display_trace, cpl_table **throughput, cpl_propertylist **ext_plist)
Compute the conversion/throughput/sensitivity high level.