32 #include <fors_data.h>
34 #include <fors_instrument.h>
35 #include <fors_std_cat.h>
37 #include <test_simulate.h>
53 cpl_frameset_delete(cat_frames); \
54 cpl_frame_delete(raw_frame); \
55 cpl_frame_delete(phot_table); \
56 fors_std_star_list_delete(&cat, fors_std_star_delete); \
57 fors_setting_delete(&setting); \
58 cpl_propertylist_delete(raw_header); raw_header = NULL; \
67 cpl_frameset *cat_frames = NULL;
68 cpl_frame *phot_table = NULL;
69 const char *filename =
"std_cat.fits";
70 fors_std_star_list *cat = NULL;
72 cpl_propertylist *raw_header = NULL;
73 double color_term, dcolor_term;
74 double ext_coeff, dext_coeff;
75 double expected_zeropoint, dexpected_zeropoint;
80 STANDARD_IMG, CPL_FRAME_GROUP_RAW);
83 PHOT_TABLE, CPL_FRAME_GROUP_CALIB);
85 cat_frames = cpl_frameset_new();
86 cpl_frameset_insert(cat_frames,
88 FLX_STD_IMG, CPL_FRAME_GROUP_CALIB));
92 fors_phot_table_load(phot_table, setting,
93 &color_term, &dcolor_term,
94 &ext_coeff, &dext_coeff,
95 &expected_zeropoint, &dexpected_zeropoint);
98 band = fors_instrument_filterband_get_by_setting(setting);
99 cat = fors_std_cat_load( cat_frames,
104 raw_header = cpl_propertylist_load(cpl_frame_get_filename(raw_frame), 0);
105 fors_std_star_list_apply_wcs(cat, raw_header);
109 fors_std_star_print_list(CPL_MSG_DEBUG, cat);
110 fors_std_star_print_list(CPL_MSG_INFO, cat);
127 double dcolor = dcmag;
128 double cov_catm_col = dcolor;
130 double shift_arcsecs;
132 for (shift_arcsecs = 0.1; shift_arcsecs <= 100; shift_arcsecs *= 2) {
134 fors_std_star *s = fors_std_star_new(ra, dec, mag, dmag,
139 fors_std_star *t = fors_std_star_new(ra + shift_arcsecs/3600,
140 dec + shift_arcsecs/3600,
151 test_rel( fors_std_star_dist_arcsec(s, t), sqrt(2)*shift_arcsecs, 0.01 );
153 fors_std_star_delete(&s);
154 fors_std_star_delete(&t);
static void test_new(void)
Test loading catalogue.
fors_setting * fors_setting_new(const cpl_frame *raw)
Create setting from FITS header.
int main(void)
Test of QC module.
cpl_frame * create_std_cat(const char *filename, const char *tag, cpl_frame_group group)
Create standard star catalogue.
cpl_frame * create_phot_table(const char *filename, const char *tag, cpl_frame_group group)
Create photometry table.
cpl_frame * create_standard(const char *filename, const char *tag, cpl_frame_group group)
Create standard star image.