UVES Pipeline Reference Manual  5.4.0
uves_dfs-test.c
1 /* *
2  * This file is part of the ESO UVES Pipeline *
3  * Copyright (C) 2004,2005 European Southern Observatory *
4  * *
5  * This library is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the Free Software *
17  * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA *
18  * */
19 
20 /*
21  * $Author: amodigli $
22  * $Date: 2009-06-05 05:49:02 $
23  * $Revision: 1.20 $
24  * $Name: not supported by cvs2svn $
25  * $Log: not supported by cvs2svn $
26  * Revision 1.19 2007/09/11 17:09:45 amodigli
27  * added parse_midas_poly
28  *
29  * Revision 1.18 2007/08/21 13:14:29 jmlarsen
30  * Update to changed functionality of uves_read_midas_array
31  *
32  * Revision 1.17 2007/08/13 12:15:43 amodigli
33  * support of CPL4
34  *
35  * Revision 1.16 2007/06/26 14:51:00 jmlarsen
36  * Fixed bug in load_linetable
37  *
38  * Revision 1.15 2007/06/22 14:50:11 jmlarsen
39  * Expanded, again, interface of uves_save_image()
40  *
41  * Revision 1.14 2007/06/22 09:33:21 jmlarsen
42  * Changed interface of uves_save_image
43  *
44  * Revision 1.13 2007/06/20 15:55:37 jmlarsen
45  * Parametrized assumption about MIDAS format
46  *
47  * Revision 1.12 2007/06/20 15:50:44 jmlarsen
48  * Expanded test
49  *
50  * Revision 1.11 2007/05/23 06:43:23 jmlarsen
51  * Removed unused variables
52  *
53  * Revision 1.10 2007/05/22 14:51:02 jmlarsen
54  * Removed unused variables
55  *
56  * Revision 1.9 2007/04/24 12:50:29 jmlarsen
57  * Replaced cpl_propertylist -> uves_propertylist which is much faster
58  *
59  * Revision 1.8 2007/04/24 08:07:11 jmlarsen
60  * Shortened line
61  *
62  * Revision 1.7 2007/04/24 08:04:29 jmlarsen
63  * Added performance test
64  *
65  * Revision 1.6 2007/04/10 12:51:43 jmlarsen
66  * Fixed wrong reference value
67  *
68  * Revision 1.5 2007/04/10 12:50:56 jmlarsen
69  * Added check of float values
70  *
71  * Revision 1.4 2007/04/10 11:35:06 jmlarsen
72  * Added error checking
73  *
74  * Revision 1.3 2007/04/03 11:02:30 jmlarsen
75  * Support reading float MIDAS arrays
76  *
77  * Revision 1.2 2007/03/15 15:04:14 jmlarsen
78  * Allow spaces in HISTORY keyword string values
79  *
80  * Revision 1.1 2007/03/15 12:27:18 jmlarsen
81  * Moved unit tests to ./uves/tests and ./flames/tests
82  *
83  * Revision 1.6 2007/02/27 14:04:14 jmlarsen
84  * Move unit test infrastructure to IRPLIB
85  *
86  * Revision 1.5 2007/01/31 15:11:09 jmlarsen
87  * Test of inf+nan when saving FITS files
88  *
89  * Revision 1.4 2007/01/29 12:17:54 jmlarsen
90  * Support setting verbosity from command line
91  *
92  * Revision 1.3 2006/11/28 08:26:23 jmlarsen
93  * Changed message
94  *
95  * Revision 1.2 2006/11/24 09:39:35 jmlarsen
96  * Factored out termination code
97  *
98  * Revision 1.1 2006/11/22 08:04:59 jmlarsen
99  * Added uves_dfs unit test module
100  *
101  * Revision 1.20 2006/11/16 09:49:25 jmlarsen
102  * Fixed doxygen bug
103  *
104  * Revision 1.19 2006/11/08 14:04:03 jmlarsen
105  * Doxybugfix
106  *
107  * Revision 1.18 2006/11/06 15:30:54 jmlarsen
108  * Added missing includes
109  *
110  * Revision 1.17 2006/11/03 15:02:06 jmlarsen
111  * Added test of uves_align
112  *
113  * Revision 1.16 2006/09/11 13:59:01 jmlarsen
114  * Renamed identifier reserved by POSIX
115  *
116  * Revision 1.15 2006/08/24 11:46:18 jmlarsen
117  * Fixed typo
118  *
119  * Revision 1.14 2006/08/24 07:18:17 amodigli
120  * fixed doxygen warnings
121  *
122  * Revision 1.13 2006/08/24 06:39:57 jmlarsen
123  * Reduced maximum line length
124  *
125  * Revision 1.12 2006/08/17 14:11:25 jmlarsen
126  * Use assure_mem macro to check for memory allocation failure
127  *
128  * Revision 1.11 2006/08/14 12:13:27 jmlarsen
129  * Reset irplib error handler
130  *
131  * Revision 1.10 2006/08/14 07:45:41 amodigli
132  * doxigen doc
133  *
134  * Revision 1.9 2006/03/03 13:54:11 jmlarsen
135  * Changed syntax of check macro
136  *
137  * Revision 1.8 2006/02/03 07:47:53 jmlarsen
138  * Moved recipe implementations to ./uves directory
139  *
140  * Revision 1.7 2006/01/31 08:26:56 jmlarsen
141  * Disabled recipe run tests
142  *
143  * Revision 1.6 2006/01/25 16:14:14 jmlarsen
144  * Changed interface of gauss.fitting routine
145  *
146  * Revision 1.5 2005/12/16 14:22:22 jmlarsen
147  * Removed midas test data; Added sof files
148  *
149  * Revision 1.4 2005/11/18 10:54:43 jmlarsen
150  * Minor changes
151  *
152  * Revision 1.3 2005/11/14 13:18:44 jmlarsen
153  * Minor update
154  *
155  * Revision 1.2 2005/11/11 13:18:54 jmlarsen
156  * Reorganized code, renamed source files
157  *
158  * Revision 1.1 2005/11/10 16:33:41 jmlarsen
159  * Added weighted extraction, test of gauss. fit
160  *
161  */
162 
163 /*-----------------------------------------------------------------------------
164  Includes
165  -----------------------------------------------------------------------------*/
166 
167 #ifdef HAVE_CONFIG_H
168 # include <config.h>
169 #endif
170 
171 #include <uves_dfs.h>
172 #include <uves_parameters.h>
173 #include <uves_utils_wrappers.h>
174 #include <uves_test_simulate.h>
175 #include <uves_pfits.h>
176 #include <uves_error.h>
177 
178 #include <cpl_test.h>
179 #include <cpl.h>
180 
181 #include <float.h>
182 /*-----------------------------------------------------------------------------
183  Defines
184  -----------------------------------------------------------------------------*/
185 
186 /*-----------------------------------------------------------------------------
187  Functions prototypes
188  -----------------------------------------------------------------------------*/
189 
190 
191 /*----------------------------------------------------------------------------*/
195 /*----------------------------------------------------------------------------*/
199 /*----------------------------------------------------------------------------*/
203 /*----------------------------------------------------------------------------*/
204 static void
206 {
208  polynomial *p = NULL;
209 
210  const char *data[] = {"",
211  "'COEFFI','I*4',1,7,'7I10'",
212  " 53889 2 3 2 1 4 5",
213  "",
214  "'COEFFR','R*4',1,5,'5E14.7'",
215  " 4.3300000E+02 4.0880000E+03 1.0000000E+00 2.1000000E+01 0.0000000E+00",
216  "",
217  "'COEFFD','R*8',1,30,'3E23.15'",
218  " -7.097005629698889E+01 4.050908371864904E-02 -2.886756545398909E-06",
219  " 5.504345508879626E-10 -5.583004967206025E-14 7.624532125635992E+01",
220  " -2.428213567964009E-03 1.819158447566360E-06 -5.090366383338846E-10",
221  " 5.198098506055602E-14 3.513177145982783E-01 5.570332137951829E-04",
222  " -3.876157463910250E-07 1.113253735718822E-10 -1.132455173423791E-14",
223  " 2.977232589499959E-02 -5.389240622889887E-05 3.777456726044612E-08",
224  " -1.083863050648735E-11 1.098450510939580E-15 -1.093309039442914E-03",
225  " 2.402609262989674E-06 -1.688416547941747E-09 4.839101712729582E-13",
226  " -4.884504488944702E-17 1.919853952642526E-05 -4.004133160220927E-08",
227  " 2.816206503824200E-11 -8.051313882805877E-15 8.090579180112579E-19",
228  " ",
229  "'TAB_IN_OUT_YSHIFT','R*8',1,1,'3E23.15'",
230  " 4.180818583555659E+01 ",
231  " "};
232  unsigned int i;
233 
234  /* Create typical FLAMES ordef table header */
235  for (i = 0; i < 8000; i++)
236  {
237  uves_propertylist_append_string(
238  header, "HISTORY",
239  " 35834 35835 35836 35837 35838 35839 35840");
240  }
241 
242  for (i = 0; i < sizeof(data)/sizeof(char *); i++)
243  {
244  uves_propertylist_append_string(
245  header, "HISTORY",
246  data[i]);
247  }
248 
249  check_nomsg( p = uves_polynomial_convert_from_plist_midas(header,
250  "COEFF",-1));
251 
252  assure( uves_polynomial_get_dimension(p) == 2, CPL_ERROR_ILLEGAL_OUTPUT,
253  "Dimension is %d, 2 expected", uves_polynomial_get_dimension(p));
254 
255  cleanup:
256  uves_free_propertylist(&header);
258 
259  return;
260 }
261 
262 /*----------------------------------------------------------------------------*/
266 /*----------------------------------------------------------------------------*/
267 static void
269 {
270  const char * const filename = "linetable.fits";
271  cpl_table *linetable_in = NULL;
272  polynomial *dispersion = NULL;
273  polynomial *absorder = NULL;
276 
277  cpl_frame *f = cpl_frame_new();
278  cpl_frameset *frames = cpl_frameset_new();
279  bool flames = false;
280  const char *const chip_id = "CCD42";
281  cpl_table *ordertable = NULL;
282  cpl_table *tracetable = NULL;
283  polynomial *order_locations = NULL;
284  int firstabs, lastabs;
285  enum uves_chip chip = UVES_CHIP_BLUE;
286  int minorder = 1;
287  int maxorder = 5;
288  int nx = 150;
289  /*int ny = 100;*/
290  int trace_id = 0;
291  int window = 1;
292 
293  /* output */
294  const char *linetable_filename;
295  cpl_table *linetable_out = NULL;
296  uves_propertylist *header_out = NULL;
297  polynomial *dispersion_out = NULL;
298  polynomial *absorder_out = NULL;
299 
300  /* build data */
301  check_nomsg( create_order_table(&ordertable, &order_locations, &tracetable,
302  minorder, maxorder, nx));
303  check_nomsg( create_line_table(&linetable_in, &dispersion, &absorder,
304  &firstabs, &lastabs,
305  minorder, maxorder, nx));
306  check_nomsg( uves_propertylist_append_string(header, UVES_CHIP_ID(chip), chip_id));
307  check_nomsg( uves_propertylist_append_string(header, UVES_DRS_ID, "CPL"));
308 
309  check_nomsg( uves_pfits_set_firstabsorder(eheader, firstabs) );
310  check_nomsg( uves_pfits_set_lastabsorder(eheader, lastabs) );
311 
312  check_nomsg( uves_pfits_set_traceid(eheader, trace_id) );
313  check_nomsg( uves_pfits_set_windownumber(eheader, window) );
314 
315  check_nomsg( uves_table_save(linetable_in, header, eheader, filename, CPL_IO_DEFAULT) );
316  check_nomsg( uves_save_polynomial(dispersion, filename, eheader) );
317  check_nomsg( uves_save_polynomial(absorder, filename, eheader) );
318 
319  cpl_test_eq(cpl_error_get_code(), CPL_ERROR_NONE);
320 
321  cpl_frame_set_filename(f, filename);
322  cpl_frame_set_tag(f, "LINE_TABLE_BLUE");
323  cpl_frameset_insert(frames, f);
324 
325  check_nomsg( uves_load_linetable(frames,
326  flames,
327  chip_id,
328  order_locations, minorder, maxorder,
329  &linetable_filename,
330  &linetable_out,
331  &header_out,
332  &dispersion_out,
333  &absorder_out,
334  chip, trace_id, window));
335 
336  cpl_test_eq(cpl_error_get_code(), CPL_ERROR_NONE);
337 
338  cpl_test( linetable_out != NULL );
339  cpl_test( header_out != NULL );
340  cpl_test( dispersion_out != NULL );
341  cpl_test( absorder_out != NULL );
342 
343  cpl_test_eq( cpl_table_get_nrow(linetable_in),
344  cpl_table_get_nrow(linetable_out) );
345 
346  /* not required: cpl_test_eq( cpl_table_get_ncol(linetable_in),
347  cpl_table_get_ncol(linetable_out) );
348  */
349 
350  cpl_test_eq_string( filename, linetable_filename );
351 
352  {
353  int order;
354  int x;
355 
356  for (order = minorder; order <= maxorder; order++) {
357  for (x = 1; x <= nx; x += nx/6) {
358  cpl_test_rel(
359  uves_polynomial_evaluate_2d(absorder , x, order),
360  uves_polynomial_evaluate_2d(absorder_out, x, order), 0.001);
361 
362  cpl_test_rel(
363  uves_polynomial_evaluate_2d(dispersion , x, order),
364  uves_polynomial_evaluate_2d(dispersion_out, x, order), 0.001);
365  }
366  }
367  }
368 
369  cleanup:
370  uves_free_frameset(&frames);
371  uves_free_table(&linetable_in);
372  uves_free_table(&linetable_out);
373  uves_polynomial_delete(&dispersion);
374  uves_polynomial_delete(&absorder);
375  uves_polynomial_delete(&dispersion_out);
376  uves_polynomial_delete(&absorder_out);
377  uves_free_propertylist(&header_out);
378  uves_free_propertylist(&header);
379  uves_free_propertylist(&eheader);
380  uves_free_table(&ordertable);
381  uves_free_table(&tracetable);
382  uves_polynomial_delete(&order_locations);
383 
384  return;
385 }
386 
387 
388 /*----------------------------------------------------------------------------*/
392 /*----------------------------------------------------------------------------*/
393 static void
395 {
396  const char *values[] = {"HISTORY", "",
397  "HISTORY", "'FIBREPOS','R*8',1,9,'3E23.15'",
398  "HISTORY", " -3.243571124678650E+01 -2.309646501161805E+01 -1.402902770375962E+01",
399  "HISTORY", " -4.772375924542811E+00 4.827040349175236E+00 1.378761244187003E+01",
400  "HISTORY", " 2.321337764943556E+01 3.243571124678650E+01 -3.552713678800501E-15",
401  "HISTORY", "",
402  "HISTORY", "'COEFFR','R*4',1,20,'5E14.7'",
403  "HISTORY", "9.4893160E+00 4.0716226E+03 0.0000000E+00 2.3000000E+01 1.8538159E-04",
404  "HISTORY", "0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00",
405  "HISTORY", "",
406  "HISTORY", "'INTVAL','I",
407  "HISTORY", "1 2 3 4 5 6",
408  "HISTORY", "7",
409  "HISTORY", "",
410  "HISTORY", "'LEGAL','C",
411  "HISTORY", " a sdfasdf",
412  "HISTORY", "",
413  "HISTORY", "'ILLEGAL','C",
414  "HISTORY", "1bsdf",
415  "HISTORY", "bsdf",
416  "HISTORY", "",
417  "HISTORY", "'CHIPCHOICE','C",
418  "HISTORY", "abcd",
419  "HISTORY", ""};
420 
421  int N = sizeof(values) / sizeof(const char *) / 2;
422 
423  uves_propertylist *header = NULL;
424  double *resultd = NULL;
425  int *resulti = NULL;
426  float *resultf = NULL;
427  const char *results = NULL;
428  int result_length, i;
429  int nkeys;
430  cpl_type result_type;
431 
432  header = uves_propertylist_new();
433  for (i = 0; i < N; i++)
434  {
435  uves_propertylist_append_string(header, values[i*2], values[i*2+1]);
436  }
437 
438  check_nomsg(resultd = uves_read_midas_array(header, "FIBREPOS", &result_length,
439  &result_type, &nkeys));
440 
441  cpl_test_eq(result_type, CPL_TYPE_DOUBLE);
442  cpl_test_eq(result_length, 9);
443  cpl_test_eq(nkeys, 5);
444 
445  /* Check numbers, see above */
446  cpl_test_rel(resultd[0], -32, 0.10);
447  cpl_test_rel(resultd[3], -4.7, 0.10);
448  cpl_test_rel(resultd[6], 23, 0.10);
449  cpl_test( fabs(resultd[8]) < 0.001);
450 
451  /* float */
452  check_nomsg(resultf = uves_read_midas_array(header, "COEFFR", &result_length,
453  &result_type, &nkeys));
454  cpl_test_eq(result_type, CPL_TYPE_FLOAT);
455  cpl_test_eq(result_length, 10);
456  cpl_test_eq(nkeys, 4);
457 
458  cpl_test_rel(resultf[0], 9.489, 0.01);
459  cpl_test_rel(resultf[1], 4071, 0.01);
460  cpl_test_abs(resultf[2], 0.000, 0.01);
461  cpl_test_rel(resultf[3], 23.00, 0.01);
462 
463  /* integer */
464  check_nomsg(resulti = uves_read_midas_array(header, "INTVAL", &result_length,
465  &result_type, &nkeys));
466 
467  cpl_test_eq(result_type, CPL_TYPE_INT);
468  cpl_test_eq(result_length, 7);
469  cpl_test_eq(nkeys, 4);
470  for (i = 1; i <= 7; i++)
471  {
472  cpl_test_eq(resulti[i-1], i);
473  }
474 
475 
476  /* string */
477  check_nomsg( results = uves_read_midas_array(header, "LEGAL", &result_length,
478  &result_type, &nkeys) );
479 
480  cpl_test_eq(result_type, CPL_TYPE_STRING);
481  cpl_test_eq(result_length, 10);
482  cpl_test_eq(nkeys, 3);
483  cpl_test_eq_string(results, " a sdfasdf");
484 
485  cpl_test(uves_read_midas_array(header, "ILLEGAL2", &result_length,
486  &result_type, &nkeys) == NULL);
488 
489  uves_free_string_const(&results);
490  check_nomsg(results = uves_read_midas_array(header, "CHIPCHOICE", &result_length,
491  &result_type, &nkeys));
492 
493  cpl_test_eq(result_type, CPL_TYPE_STRING);
494  cpl_test_eq(result_length, 4);
495  cpl_test_eq(nkeys, 3);
496  cpl_test_eq_string(results, "abcd");
497 
498  /* Performance test (relevant for long FLAMES FITS headers) */
499  N = 9000;
500  uves_free_propertylist(&header);
501  header = uves_propertylist_new();
502  uves_propertylist_append_string(header, "HISTORY", "'SELIDX','I*4',1,48389,'7I10'");
503  for (i = 0; i < N; i++)
504  {
505  uves_propertylist_append_string(
506  header, "HISTORY",
507  " 64605 64606 64607 64608 64609 64610 64611");
508  }
509  uves_propertylist_append_string(header, "HISTORY", "");
510 
511  uves_free_int(&resulti);
512  check_nomsg( resulti = uves_read_midas_array(header, "SELIDX", &result_length,
513  &result_type, &nkeys));
514 
515  cpl_test_eq(result_type, CPL_TYPE_INT);
516  cpl_test_eq(result_length, N*7);
517  cpl_test_eq(nkeys, 1+N+1);
518 
519  cleanup:
520  uves_free_propertylist(&header);
521  uves_free_double(&resultd);
522  uves_free_int(&resulti);
523  uves_free_float(&resultf);
524  uves_free_string_const(&results);
525  return;
526 }
527 
528 /*----------------------------------------------------------------------------*/
532 /*----------------------------------------------------------------------------*/
533 static void
535 {
536  const int N = 100;
537  int i;
538 
539  cpl_image *image = cpl_image_new(N, 1, CPL_TYPE_DOUBLE);
540 
541  double inf = DBL_MAX;
542  for (i = 1; i <= N; i++)
543  {
544  cpl_image_set(image, i, 1, -FLT_MAX*200);
545  inf *= 10;
546  }
547 
548 
549  cpl_image_set(image, 1, 1, inf);
550  cpl_image_set(image, 2, 1, inf/inf);
551 
552  uves_save_image(image, "dfs.fits", NULL, true, true);
553  uves_free_image(&image);
554 
555  return;
556 }
557 
558 /*----------------------------------------------------------------------------*/
562 /*----------------------------------------------------------------------------*/
563 static void
565 {
566  cpl_frameset *frames = cpl_frameset_new();
567  cpl_parameterlist *parameters = cpl_parameterlist_new();
568  int nx = 1500;
569  int ny = 1024;
570  int nkey = 360;
571  cpl_image *image = cpl_image_new(nx, ny, CPL_TYPE_DOUBLE);
573  uves_propertylist *product_header = uves_propertylist_new();
574  const char *starttime;
575  const char *recipe_id = "uves_cal_phony";
576  const char *tag = "PHONY_TAG";
577  const char *raw_filename = "raw_file.fits";
578 
579  uves_define_global_parameters(parameters);
580  cpl_test_eq( cpl_error_get_code(), CPL_ERROR_NONE );
581 
582  /* Create raw image */
583  {
584  cpl_image *raw_image = cpl_image_new(nx, ny, CPL_TYPE_DOUBLE);
585  cpl_frame *raw_frame = cpl_frame_new();
586 
587  {
588  int i;
589  for (i = 0; i < nkey; i++)
590  {
591  const char *key_name = uves_sprintf("KEY%d", i);
592  uves_propertylist_append_int(raw_header, key_name, i);
593  uves_free_string_const(&key_name);
594  }
595  uves_propertylist_append_string(raw_header, "ORIGIN", "unknown...");
596  }
597 
598  uves_image_save(raw_image,
599  raw_filename,
600  CPL_BPP_IEEE_FLOAT,
601  raw_header,
602  CPL_IO_DEFAULT);
603  cpl_test_eq( cpl_error_get_code(), CPL_ERROR_NONE );
604 
605  uves_free_image(&raw_image);
606 
607  /* Wrap frame */
608  cpl_frame_set_tag(raw_frame, "BIAS_BLUE"); /* Use recognized tag,
609  so that FRAME_TYPE
610  is set to RAW */
611  cpl_frame_set_filename(raw_frame, raw_filename);
612  cpl_frameset_insert(frames, raw_frame);
613  }
614 
615  starttime = uves_initialize(frames, parameters, recipe_id,
616  "This recipe does not do anything");
617  cpl_test_eq( cpl_error_get_code(), CPL_ERROR_NONE );
618 
619  uves_frameset_insert(frames,
620  image,
621  CPL_FRAME_GROUP_PRODUCT,
622  CPL_FRAME_TYPE_IMAGE,
623  CPL_FRAME_LEVEL_INTERMEDIATE,
624  "dfs_product.fits",
625  tag,
626  raw_header,
627  product_header,
628  NULL, /* table header */
629  parameters,
630  recipe_id,
631  PACKAGE "/" PACKAGE_VERSION,
632  NULL, /* qc table */
633  starttime,
634  false, /* dump PAF */
635  0 /* stats_mask */);
636 
637  cpl_test_eq( cpl_error_get_code(), CPL_ERROR_NONE );
638  cpl_test( cpl_frameset_find(frames, tag) != NULL);
639 
640  uves_free_frameset(&frames);
641  uves_free_parameterlist(&parameters);
642  uves_free_image(&image);
643  uves_free_propertylist(&raw_header);
644  uves_free_propertylist(&product_header);
645  uves_free_string_const(&starttime);
646  return;
647 }
648 
649 
650 /*----------------------------------------------------------------------------*/
654 /*----------------------------------------------------------------------------*/
655 
656 int main(void)
657 {
658  /* Initialize CPL + UVES messaging */
659  cpl_test_init(PACKAGE_BUGREPORT, CPL_MSG_WARNING);
660  cpl_errorstate initial_errorstate = cpl_errorstate_get();
661 // cpl_msg_set_level(CPL_MSG_DEBUG);
662 
664  "Test of MIDAS array conversion");
665 
666 
668 
670  "Test of MIDAS array conversion failed");
671 
673 
675 
676  cleanup:
677  if (cpl_error_get_code() != CPL_ERROR_NONE)
678  {
679  cpl_errorstate_dump(initial_errorstate,CPL_FALSE,NULL);
680  }
681  return cpl_test_end(0);
682 }
683 
684