fors_zeropoint-test.c
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifdef HAVE_CONFIG_H
00029 #include <config.h>
00030 #endif
00031
00032 #include <fors_zeropoint_impl.h>
00033 #include <fors_dfs.h>
00034 #include <fors_utils.h>
00035
00036 #include <test_simulate.h>
00037 #include <test.h>
00038
00046 #undef cleanup
00047 #define cleanup \
00048 do { \
00049 cpl_frameset_delete(frames); \
00050 cpl_parameterlist_delete(parameters); \
00051 } while(0)
00052
00056 static void
00057 test_zeropoint(void)
00058 {
00059
00060 cpl_frameset *frames = cpl_frameset_new();
00061 cpl_parameterlist *parameters = cpl_parameterlist_new();
00062 cpl_parameter *p = NULL;
00063 double exptime = 1.0;
00064
00065
00066
00067 cpl_frameset_insert(frames, create_standard("zeropoint_standard_img.fits",
00068 STANDARD_IMG,
00069 CPL_FRAME_GROUP_RAW));
00070 cpl_frameset_insert(frames, create_bias("zeropoint_master_bias.fits",
00071 MASTER_BIAS,
00072 CPL_FRAME_GROUP_CALIB));
00073 cpl_frameset_insert(frames, create_sky_flat("zeropoint_master_sky_flat.fits",
00074 MASTER_SKY_FLAT_IMG,
00075 CPL_FRAME_GROUP_CALIB, exptime));
00076 cpl_frameset_insert(frames, create_std_cat("zeropoint_std_cat.fits",
00077 FLX_STD_IMG,
00078 CPL_FRAME_GROUP_CALIB));
00079 cpl_frameset_insert(frames, create_phot_table("zeropoint_phot_table.fits",
00080 PHOT_TABLE,
00081 CPL_FRAME_GROUP_CALIB));
00082
00083
00084 fors_zeropoint_define_parameters(parameters);
00085 p = cpl_parameter_new_enum("fors.fors_zeropoint.extract_method",
00086 CPL_TYPE_STRING,
00087 "Source extraction method",
00088 "fors.fors_zeropoint",
00089 "sex", 2,
00090 "sex", "test");
00091 cpl_parameterlist_append(parameters, p);
00092
00093 assure( !cpl_error_get_code(), return,
00094 "Create parameters failed");
00095
00096 fors_parameterlist_set_defaults(parameters);
00097
00098
00099 cpl_parameter_set_string(cpl_parameterlist_find(parameters,
00100 "fors.fors_zeropoint.extract_method"),
00101 "test");
00102
00103
00104
00105
00106 cpl_msg_severity before = cpl_msg_get_level();
00107 cpl_msg_set_level(CPL_MSG_ERROR);
00108
00109
00110 cleanup;
00111 return;
00112
00113 fors_zeropoint(frames, parameters);
00114
00115 cpl_msg_set_level(before);
00116
00117
00118
00119
00120 const char *const product_tags[] = {SOURCES_STD,
00121 ALIGNED_PHOT,
00122 STANDARD_REDUCED_IMG,
00123 PHOT_BACKGROUND_STD_IMG};
00124 const char *const qc[] =
00125 {"QC ZPOINT", "QC ZPOINTRMS", "QC ZPOINT NSTARS",
00126 "QC EXTCOEFF"};
00127 const char *main_product = ALIGNED_PHOT;
00128
00129 test_recipe_output(frames,
00130 product_tags, sizeof product_tags / sizeof *product_tags,
00131 main_product,
00132 qc, sizeof qc / sizeof *qc);
00133
00134 cleanup;
00135 return;
00136 }
00137
00138
00142 int main(void)
00143 {
00144 TEST_INIT;
00145
00146
00147 test_zeropoint();
00148
00149 TEST_END;
00150 }
00151