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_img_science_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_img_science(void)
00058 {
00059
00060 cpl_frameset *frames = cpl_frameset_new();
00061 cpl_parameterlist *parameters = cpl_parameterlist_new();
00062 double exptime = 1.0;
00063
00064
00065
00066 cpl_frameset_insert(frames, create_standard("img_science_standard_img.fits",
00067 SCIENCE_IMG,
00068 CPL_FRAME_GROUP_RAW));
00069 cpl_frameset_insert(frames, create_bias("img_science_master_bias.fits",
00070 MASTER_BIAS,
00071 CPL_FRAME_GROUP_CALIB));
00072 cpl_frameset_insert(frames, create_sky_flat("img_science_master_sky_flat.fits",
00073 MASTER_SKY_FLAT_IMG,
00074 CPL_FRAME_GROUP_CALIB, exptime));
00075 cpl_frameset_insert(frames, create_std_cat("img_science_std_cat.fits",
00076 FLX_STD_IMG,
00077 CPL_FRAME_GROUP_CALIB));
00078 cpl_frameset_insert(frames, create_phot_table("img_science_phot_table.fits",
00079 PHOT_TABLE,
00080 CPL_FRAME_GROUP_CALIB));
00081
00082
00083 fors_img_science_define_parameters(parameters);
00084 assure( !cpl_error_get_code(), return,
00085 "Create parameters failed");
00086
00087 fors_parameterlist_set_defaults(parameters);
00088
00089
00090 cpl_parameter_set_string(cpl_parameterlist_find(parameters,
00091 "fors.fors_img_science.extract_method"),
00092 "test");
00093
00094 fors_img_science(frames, parameters);
00095
00096
00097 const char *const product_tags[] = {SOURCES_SCI,
00098 SCIENCE_REDUCED_IMG,
00099 PHOTOMETRY_TABLE,
00100 PHOT_BACKGROUND_SCI_IMG};
00101 const char *main_product = SCIENCE_REDUCED_IMG;
00102
00103 const char *const qc[] =
00104 {"QC SKYAVG", "QC SKYMED", "QC SKYRMS",
00105 "QC IMGQU", "QC IMGQUERR", "QC STELLAVG",
00106 "QC IMGQUELL", "QC IMGQUELLERR"};
00107 test_recipe_output(frames,
00108 product_tags, sizeof product_tags / sizeof *product_tags,
00109 main_product,
00110 qc, sizeof qc / sizeof *qc);
00111
00112 cleanup;
00113 return;
00114 }
00115
00116
00120 int main(void)
00121 {
00122 TEST_INIT;
00123
00124
00125 test_img_science();
00126
00127 TEST_END;
00128 }
00129