66#define MODULE_ID "XSH_ATROUS"
80 puts(
"Unitary test of xsh_atrous");
81 puts(
"Usage: test_xsh_atrous [options] DATA_FILE");
84 puts(
" --help : What you see" ) ;
85 puts(
" --nscales= : Number os scales");
86 puts(
"\nInput Files" ) ;
87 puts(
"DATA_FILE :ASCII x,y file y column is use for decomposition");
98 while (( opt = getopt_long (argc, argv,
104 *nscales = atoi(optarg);
114int main(
int argc,
char **argv)
119 const char *file_name = NULL;
121 cpl_vector *data_vect = NULL;
127 cpl_matrix *result = NULL;
133 cpl_msg_set_level(CPL_MSG_DEBUG);
139 if ( (argc - optind) > 0 ) {
140 file_name = argv[optind];
148 xsh_msg(
"File : %s ", file_name);
150 xsh_msg(
"NSCALES : %d ", nscales);
153 file = fopen( file_name,
"r");
156 while (
size <
max && fgets( line, 200, file)){
160 if ( line[0] !=
'#'){
163 sscanf(line,
"%19s %19s", col1, col2);
164 xpos[
size] = atof(col1);
165 ypos[
size] = atof(col2);
174 check( data_vect = cpl_vector_wrap(
size, ypos));
178 sprintf( res_name,
"%s_ATROUS.dat", file_name);
180 file = fopen( res_name,
"w+");
181 fprintf( file,
"#x y");
182 for(k=0; k< nscales+1; k++){
183 fprintf( file,
" n%d", k);
185 fprintf( file,
"\n");
187 for( i=0; i<
size; i++){
188 fprintf( file,
"%f %f", xpos[i], ypos[i]);
189 for(k=0; k< nscales+1; k++){
192 val = cpl_matrix_get( result, k, i);
193 fprintf( file,
" %f", val);
195 fprintf( file,
"\n");
202 if (cpl_error_get_code() != CPL_ERROR_NONE) {
int main()
Unit test of xsh_bspline_interpol.
static void HandleOptions(int argc, char **argv, int *nscales)
static struct option long_options[]
#define xsh_error_dump(level)
#define xsh_msg(...)
Print a message on info level.
void xsh_unwrap_vector(cpl_vector **v)
Unwrap a vector and set the pointer to NULL.
int xsh_debug_level_set(int level)
set debug level
void xsh_free_matrix(cpl_matrix **m)
Deallocate a matrix and set the pointer to NULL.
#define TESTS_INIT(DRL_ID)
cpl_matrix * xsh_atrous(cpl_vector *spec, int nscales)
Do a wavelet decomposition using atrous from IDL.