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
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097 #ifndef TESTS_H
00098 #define TESTS_H
00099
00100 #include <cpl.h>
00101 #include <xsh_drl.h>
00102 #include <stdbool.h>
00103 #include <xsh_data_order.h>
00104 #include <config.h>
00105
00106 #define TESTS_INIT(DRL_ID) do { \
00107 cpl_init(CPL_INIT_DEFAULT); \
00108 xsh_init(); \
00109 cpl_msg_set_domain("Test-" DRL_ID); \
00110 } while(false)
00111
00112 #define TEST_END()\
00113 xsh_free_temporary_files(); \
00114 cpl_end()
00115
00116 #define TESTS_XSH_INSTRUMENT_CREATE(instr, mode, arm, lamp, recipe)\
00117 instr = xsh_instrument_new() ;\
00118 xsh_instrument_set_mode( instr, mode) ;\
00119 xsh_instrument_set_arm( instr, arm) ;\
00120 xsh_instrument_set_lamp( instr, lamp) ;\
00121 xsh_instrument_set_recipe_id( instr, recipe) ;\
00122 xsh_msg( " recipe_id: %s", instr->recipe_id )
00123
00124 #define TESTS_XSH_FRAME_CREATE( frame, tag, name)\
00125 frame = cpl_frame_new();\
00126 cpl_frame_set_filename( frame, name);\
00127 cpl_frame_set_level( frame, CPL_FRAME_LEVEL_TEMPORARY);\
00128 cpl_frame_set_group( frame, CPL_FRAME_GROUP_RAW);\
00129 cpl_frame_set_tag( frame, tag)
00130
00131
00132 #define TESTS_DATA(file) XSH_TEST_DATA_PATH "/" file
00133
00134
00135
00136 #define XSH_DRL_FUNC_RMS 0.01
00137 #define XSH_FLOAT_PRECISION 0.000001
00138
00139 void
00140 tests_set_defaults(cpl_parameterlist *parlist);
00141
00142 cpl_image* xsh_test_create_bias_image(const char* name, int nx, int ny,
00143 xsh_instrument* instrument);
00144
00145 cpl_propertylist * mkHeader( XSH_INSTRCONFIG *iconfig,
00146 int nx, int ny, double exptime ) ;
00147 void setHeader( cpl_propertylist *header,
00148 XSH_INSTRCONFIG *iconfig,
00149 int nx, int ny, double exptime ) ;
00150 cpl_frame* xsh_test_create_frame( const char* name,int nx, int ny,
00151 const char* tag, cpl_frame_group group, xsh_instrument* instrument);
00152 void add_to_order_list( xsh_order_list * list, int order,
00153 int absorder,
00154 cpl_polynomial *poly, int xdelta,
00155 int starty, int endy ) ;
00156 xsh_order_list * create_order_list( int norder, xsh_instrument* instrument ) ;
00157
00158 cpl_image * create_order_image( xsh_order_list* list,
00159 int nx, int ny ) ;
00160
00161 cpl_frame * create_rectify_nod_list( int dual, const char * fname,
00162 xsh_instrument * instr ) ;
00163
00164 cpl_frameset* sof_to_frameset( const char* sof_name);
00165
00166 xsh_instrument * create_instrument( const char *filename);
00167
00168 #endif