UVES Pipeline Reference Manual  5.4.6
flames_reduce_vcorrel.c
1 
2 /*
3  * This file is part of the ESO UVES Pipeline
4  * Copyright (C) 2004,2005 European Southern Observatory
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA
19  */
20 
21 
22 /*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*/
30 #include <irplib_utils.h>
31 #include <uves_msg.h>
32 #include <uves_error.h>
33 #include <uves_qclog.h>
34 #include <uves_dfs.h>
35 #include <uves_utils_wrappers.h>
36 #include <flames_midas_def.h>
37 #include <flames_corvel.h>
38 #include <flames_reduce_vcorrel.h>
39 
40 
41 // Simultaneous corvel simcal data reduction
42 double DRS_CVEL_MIN = -6.;
43 double DRS_CVEL_MAX = +6.;
44 double DRS_CVEL_STEP = 0.5;
45 
46 
47 int
48 flames_reduce_vcorrel(const char* sci_pfx,
49  const char* cvel_pfx,
50  const char* ccd_id,
51  const int ord_max,
52  const cpl_frame* cvel_tab,
53  const char* xxima_pfx,
54  const char* xwcal_pfx,
55  const double drs_cvel_min,
56  const double drs_cvel_max,
57  double* zero_point,
58  double* avg_cnt,
59  double* sig_cnt,
60  cpl_table* qclog)
61 {
62 
63  int ord = 0;
64  int ord_min=1;
65  char cvel_tab_name[80];
66  char tim_ccf[80];
67  char nim_ccf[80];
68  char iim_pfx[80];
69  char tab_pfx[80];
70  char nim_pfx[80];
71  char tim_pfx[80];
72  char ref_frm[80];
73  char otab[80];
74  const int npix=(drs_cvel_max-drs_cvel_min)/DRS_CVEL_STEP+1;
75 
76  cpl_image* tim_ccf_ima=NULL;
77  cpl_image* nim_ccf_ima=NULL;
78 
79  cpl_table* cvel_tbl=NULL;
80  double ccfcnt[ord_max];
81  int num_ord=0;
82  int status=0;
83  int unit=0;
84  int actvals=0;
85  int null=0;
86 
87  int in_ima_id=0;
88  int iim_pfx_id=0;
89 
90  char out_cvel_tab[80];
91  char out_tot_ima[80];
92  char out_nrm_ima[80];
93  cpl_table* cvel_ord_tbl=NULL;
94  int row_pos=0;
95 
96  cpl_image* tot_ima=NULL;
97  cpl_image* nrm_ima=NULL;
98  int nrow=0;
99 
100  double ccf_max=0;
101  double wav_rng=0;
102  double pix_tot=0;
103  int lin_tot=0;
104  cpl_propertylist* plist_ima_new=NULL;
105  cpl_propertylist* plist_tbl_new=NULL;
106 
107  double corvel_max=0;
108 
109 
110  char key_name[80];
111 
112  const char* command=NULL;
113 
114 
115 
116  //Fixme
117  uves_msg_debug("sci_pfx=%s",sci_pfx);
118  uves_msg_debug("ccd_id=%s",ccd_id);
119 
120  sprintf(otab,"%s%s%s",cvel_pfx,ccd_id,".fits");
121  sprintf(tim_ccf,"%s%s%s%s","tot_",cvel_pfx,ccd_id,".fits");
122  sprintf(nim_ccf,"%s%s%s%s","nrm_",cvel_pfx,ccd_id,".fits");
123  sprintf(iim_pfx,"%s%s%s%s","mw",sci_pfx,xxima_pfx,".fits");
124  sprintf(tab_pfx,"%s%s%s","tab_",ccd_id,"_");
125  sprintf(nim_pfx,"%s%s%s","nrm_",ccd_id,"_");
126  sprintf(tim_pfx,"%s%s%s","tot_",ccd_id,"_");
127  sprintf(ref_frm,"%s%s%s","w",sci_pfx,xwcal_pfx);
128 
129 
130  uves_msg_debug("pointer=%p",cvel_tab);
131 
132  uves_msg("name=%s",cpl_frame_get_filename(cvel_tab));
133  sprintf(cvel_tab_name,"%s",cpl_frame_get_filename(cvel_tab));
134 
135  uves_msg_debug("npix=%d",npix);
136  tim_ccf_ima=cpl_image_new(npix,ord_max,CPL_TYPE_FLOAT);
137  nim_ccf_ima=cpl_image_new(npix,ord_max,CPL_TYPE_FLOAT);
138 
139 
140  //AMO:Fixme
141  row_pos=0;
142  uves_msg_debug("ord_max=%d nlines=%d",ord_max,npix*ord_max);
143  //cvel_tbl=cpl_table_new(npix*ord_max);
144  cvel_tbl=cpl_table_new(0);
145  check_nomsg(cpl_table_new_column(cvel_tbl,"Select",CPL_TYPE_INT));
146  check_nomsg(cpl_table_new_column(cvel_tbl,"ccf_pos",CPL_TYPE_DOUBLE));
147  check_nomsg(cpl_table_new_column(cvel_tbl,"ccf_nrm",CPL_TYPE_DOUBLE));
148  check_nomsg(cpl_table_new_column(cvel_tbl,"ccf_out",CPL_TYPE_DOUBLE));
149  check_nomsg(cpl_table_new_column(cvel_tbl,"ORDER",CPL_TYPE_INT));
150  check_nomsg(plist_ima_new=cpl_propertylist_new());
151 
152 
153 
154  ck0_nomsg(uves_qclog_add_string(qclog,
155  "QC TEST2 ID",
156  "Fibre-Science-QC",
157  "Name of QC test",
158  "%s"));
159  uves_check_rec_status(0);
160 
161  for (ord=ord_min;ord<=ord_max;ord++) {
162  ccfcnt[ord]=0;
163  //for (ord=2;ord<=2;ord++) {
164 
165  sprintf(out_cvel_tab,"%s%s%d%s","tab_",ccd_id,ord,".fits");
166  sprintf(out_tot_ima,"%s%s%d%s","tot_",ccd_id,ord,".fits");
167  sprintf(out_nrm_ima,"%s%s%d%s","nrm_",ccd_id,ord,".fits");
168 
169 
170  uves_msg_debug("vc2 %s %s %s",out_cvel_tab,out_tot_ima,out_nrm_ima);
171  uves_msg_debug("iim_pfx=%s cvel_tab_name=%s ord=%d",
172  iim_pfx,cvel_tab_name,ord);
173 
174  uves_msg_debug("out_cvel_tab=%s",out_cvel_tab);
175  uves_msg_debug("out_tot_ima=%s",out_tot_ima);
176  uves_msg_debug("out_nrm_ima=%s",out_nrm_ima);
177  uves_msg_debug("ord=%d",ord);
178 
179 
180 
181 
182  check_nomsg(flames_corvel(iim_pfx,
183  cvel_tab_name,
184  ord,
185  out_cvel_tab,
186  out_tot_ima,
187  out_nrm_ima,
188  drs_cvel_min,
189  drs_cvel_max,
190  DRS_CVEL_STEP));
191 
192 
193  uves_msg_debug("CVEL MAX=%f MIN=%f STEP=%f",
194  drs_cvel_min,drs_cvel_max,DRS_CVEL_STEP);
195 
196  check_nomsg(tot_ima=cpl_image_load(out_tot_ima,CPL_TYPE_FLOAT,0,0));
197  check_nomsg(nrm_ima=cpl_image_load(out_nrm_ima,CPL_TYPE_FLOAT,0,0));
198  check_nomsg(cpl_image_copy(tim_ccf_ima,tot_ima,1,ord-ord_min+1));
199  check_nomsg(cpl_image_copy(nim_ccf_ima,nrm_ima,1,ord-ord_min+1));
200  check_nomsg(cvel_ord_tbl=cpl_table_load(out_cvel_tab,1,1));
201 
202 
203  check_nomsg(cpl_table_new_column(cvel_ord_tbl,"ORDER",CPL_TYPE_INT));
204  check_nomsg(nrow=cpl_table_get_nrow(cvel_ord_tbl));
205 
206  check_nomsg(cpl_table_fill_column_window_int(cvel_ord_tbl,"ORDER",0,nrow,ord));
207  if(ord==ord_min) {
208  const char* unit=cpl_table_get_column_unit(cvel_ord_tbl,"ccf_pos");
209  cpl_table_set_column_unit(cvel_tbl,"ccf_pos",unit);
210  unit=cpl_table_get_column_unit(cvel_ord_tbl,"ccf_nrm");
211  cpl_table_set_column_unit(cvel_tbl,"ccf_nrm",unit);
212  unit=cpl_table_get_column_unit(cvel_ord_tbl,"ccf_out");
213  cpl_table_set_column_unit(cvel_tbl,"ccf_out",unit);
214  }
215  check_nomsg(cpl_table_insert(cvel_tbl,cvel_ord_tbl,row_pos));
216  row_pos+=nrow;
217 
218  if((status=SCFOPN(out_tot_ima,D_R4_FORMAT,0,F_IMA_TYPE,&in_ima_id))!=0) {
219  uves_msg_error("opening frame %s",out_tot_ima);
220  return flames_midas_error(MAREMMA);
221  }
222 
223  if((status=SCFOPN(iim_pfx,D_R4_FORMAT,0,F_IMA_TYPE,&iim_pfx_id))!=0) {
224  uves_msg_error("opening frame %s",iim_pfx);
225  return flames_midas_error(MAREMMA);
226  }
227 
228 
229 
230  sprintf(key_name,"%s","CORVEL_MAX");
231  if((status=SCDRDD(iim_pfx_id,key_name,1,1,&actvals,&corvel_max,&unit,&null))
232  != 0) {
233  uves_msg_error("Reading descriptor %s from frame %s",
234  key_name,out_tot_ima);
235  return flames_midas_error(MAREMMA);
236  }
237 
238 
239 
240  sprintf(key_name,"%s%d","CCF_PMX",ord);
241  uves_msg_debug("corvel_max=%g",corvel_max);
242  if(!irplib_isnan(corvel_max)) {
243  ccfcnt[ord]=corvel_max;
244  check_nomsg(cpl_propertylist_append_double(plist_ima_new,key_name,
245  corvel_max));
246 
247 
248 
249  ck0_nomsg(uves_qclog_add_double(qclog,
250  cpl_sprintf("%s%d%s",
251  "QC CCF",ord," POSMAX"),
252  corvel_max,
253  "CCF pos Max",
254  "%f"));
255 
256 
257  } else {
258  ccfcnt[ord]=999;
259  check_nomsg(cpl_propertylist_append_double(plist_ima_new,key_name,
260  999));
261 
262 
263 
264 
265  ck0_nomsg(uves_qclog_add_double(qclog,
266  cpl_sprintf("%s%d%s",
267  "QC CCF",ord," POSMAX"),
268  999,
269  "CCF pos Max",
270  "%f"));
271 
272 
273  }
274 
275 
276  sprintf(key_name,"%s","CCF_MAX");
277  if((status=SCDRDD(in_ima_id,key_name,1,1,&actvals,&ccf_max,&unit,&null))
278  != 0) {
279  uves_msg_error("Reading descriptor %s from frame %s",
280  key_name,out_tot_ima);
281  return flames_midas_error(MAREMMA);
282  }
283 
284 
285  sprintf(key_name,"%s%d","CCF_MAX",ord);
286  uves_msg_debug("ccf_max=%g",ccf_max);
287  check_nomsg(cpl_propertylist_append_double(plist_ima_new,key_name,ccf_max));
288 
289 
290  ck0_nomsg(uves_qclog_add_double(qclog,
291  cpl_sprintf("%s%d%s",
292  "QC CCF",ord," INTMAX"),
293  ccf_max,
294  "CCF Int Max",
295  "%f"));
296 
297 
298 
299  sprintf(key_name,"%s","WAV_RNG");
300  if((status=SCDRDD(in_ima_id,key_name,1,1,&actvals,&wav_rng,&unit,&null))
301  != 0) {
302  uves_msg_error("Reading descriptor %s from frame %s",
303  key_name,out_tot_ima);
304  return flames_midas_error(MAREMMA);
305  }
306 
307  sprintf(key_name,"%s%d","WAV_RNG",ord);
308  uves_msg_debug("wav_rng=%g",wav_rng);
309  uves_msg_debug("key_name=%s",key_name);
310  check_nomsg(cpl_propertylist_append_double(plist_ima_new,key_name,wav_rng));
311 
312 
313  ck0_nomsg(uves_qclog_add_double(qclog,
314  cpl_sprintf("%s%d%s",
315  "QC CCF",ord," WAVRNG"),
316  wav_rng,
317  "CCF Range",
318  "%f"));
319 
320 
321 
322  sprintf(key_name,"%s","PIX_TOT");
323  if((status=SCDRDD(in_ima_id,key_name,1,1,&actvals,&pix_tot,&unit,&null))
324  != 0) {
325  uves_msg_error("Reading descriptor %s from frame %s",
326  key_name,out_tot_ima);
327  return flames_midas_error(MAREMMA);
328  }
329 
330 
331  uves_msg_debug("pix_tot=%g",pix_tot);
332  if(!irplib_isinf(pix_tot)) {
333 
334  sprintf(key_name,"%s%d","PIX_TOT",ord);
335  check_nomsg(cpl_propertylist_append_double(plist_ima_new,key_name,pix_tot));
336 
337  ck0_nomsg(uves_qclog_add_double(qclog,
338  cpl_sprintf("%s%d%s",
339  "QC CCF",ord," PIXTOT"),
340  pix_tot,
341  "CCF Pix",
342  "%f"));
343 
344  } else {
345 
346  sprintf(key_name,"%s%d","PIX_TOT",ord);
347  check_nomsg(cpl_propertylist_append_double(plist_ima_new,key_name,999.));
348 
349  ck0_nomsg(uves_qclog_add_double(qclog,
350  cpl_sprintf("%s%d%s",
351  "QC CCF",ord," PIXTOT"),
352  999,
353  "CCF Pix",
354  "%f"));
355 
356 
357  }
358 
359  sprintf(key_name,"%s","LIN_TOT");
360  if((status=SCDRDI(in_ima_id,key_name,1,1,&actvals,&lin_tot,&unit,&null))
361  != 0) {
362  uves_msg_error("Reading descriptor %s from frame %s",
363  key_name,out_tot_ima);
364  return flames_midas_error(MAREMMA);
365  }
366 
367 
368  sprintf(key_name,"%s%d","LIN_TOT",ord);
369 
370  check_nomsg(cpl_propertylist_append_int(plist_ima_new,key_name,lin_tot));
371  uves_msg_debug("lin_tot=%d",lin_tot);
372 
373 
374  ck0_nomsg(uves_qclog_add_int(qclog,
375  cpl_sprintf("%s%d%s",
376  "QC CCF",ord," LINTOT"),
377  pix_tot,
378  "CCF Lin",
379  "%d"));
380 
381 
382  if((status = SCFCLO(in_ima_id))!=0) {
383  uves_msg_error("Closing frame %d",in_ima_id);
384  return flames_midas_error(MAREMMA);
385  }
386  if((status = SCFCLO(iim_pfx_id))!=0) {
387  uves_msg_error("Closing frame %d",iim_pfx_id);
388  return flames_midas_error(MAREMMA);
389  }
390 
391 
392  uves_free_table(&cvel_ord_tbl);
393  uves_free_image(&tot_ima);
394  uves_free_image(&nrm_ima);
395 
396  command=uves_sprintf("%s%s","rm -rf ",out_cvel_tab);
397  system(command);
398  command=uves_sprintf("%s%s","rm -rf ",out_tot_ima);
399  system(command);
400  command=uves_sprintf("%s%s","rm -rf ",out_nrm_ima);
401  system(command);
402 
403 
404  } //end loop over orders
405 
406 
407  check_nomsg(cpl_image_save(tim_ccf_ima, "tot_ima.fits",CPL_BPP_IEEE_FLOAT,
408  plist_ima_new,CPL_IO_DEFAULT));
409  check_nomsg(cpl_image_save(nim_ccf_ima, "nrm_ima.fits",CPL_BPP_IEEE_FLOAT,
410  plist_ima_new,CPL_IO_DEFAULT));
411 
412  check_nomsg(cpl_table_save(cvel_tbl, plist_tbl_new, NULL, otab,
413  CPL_IO_DEFAULT));
414 
415  uves_free_image(&tim_ccf_ima);
416  uves_free_image(&nim_ccf_ima);
417  uves_free_table(&cvel_tbl);
418 
419  ord = ord_max-ord_min+1;
420  //flames_cveltab(cpfx_ccd_id_tbl,ord);
421 
422 
423 
424  num_ord = 0;
425  *avg_cnt=0;
426  for (ord=ord_min; ord<= ord_max; ord++) {
427  if (ccfcnt[ord] != 999) {
428  *avg_cnt +=ccfcnt[ord];
429  uves_msg_debug("POSMAX avg=%g cnt=%g ord=%d",*avg_cnt,ccfcnt[ord],ord);
430  num_ord += 1;
431  }
432  }
433 
434  *avg_cnt /= num_ord;
435  *sig_cnt=0;
436  for (ord = ord_min; ord <= ord_max; ord++) {
437  if (ccfcnt[ord] != 999) {
438  *sig_cnt += (ccfcnt[ord]-*avg_cnt)*(ccfcnt[ord]-*avg_cnt);
439  uves_msg_debug("sig=%g cnt=%g ord=%d",*sig_cnt,ccfcnt[ord],ord);
440  }
441  }
442  *sig_cnt = sqrt(*sig_cnt/(num_ord-1));
443 
444  *zero_point+=(*avg_cnt);
445 
446 
447  /*
448  uves_msg("POSMAX avg=%g sig=%g zp=%g",*avg_cnt,*sig_cnt,*zero_point);
449  */
450 
451  ck0_nomsg(uves_qclog_add_double(qclog,
452  "QC CCF POSAVG",
453  *avg_cnt,
454  "CCF pos avg",
455  "%f"));
456 
457 
458  ck0_nomsg(uves_qclog_add_double(qclog,
459  "QC CCF POSRMS",
460  *sig_cnt,
461  "CCF pos rms",
462  "%f"));
463  /* commented out to match FUVES-MIDAS results
464 
465  ck0_nomsg(uves_qclog_add_double(qclog,
466  "QC CCF POSOFF",
467  *zero_point,
468  "CCF pos avg from ThAr calibration",
469  "%f"));
470 
471  */
472 
473 
474 
475  uves_msg_debug("POSAVG=%f POSRMS=%f",*avg_cnt,*sig_cnt);
476 
477 
478  /*
479  do ord = ord_min ord_max
480 
481  CORVEL/FLAMES {iim_pfx}{ord}.bdf {cvel_tab} {ord} -
482  {tab_pfx}{ord}.tbl {tim_pfx}{ord}.bdf {nim_pfx}{ord}.bdf
483 
484 
485 
486  insert/ima {tim_pfx}{ord}.bdf {tim_ccf} @1,@{ord}
487  insert/ima {nim_pfx}{ord}.bdf {nim_ccf} @1,@{ord}
488 
489  create/column {tab_pfx}{ord}.tbl :ORDER
490  compute/table {tab_pfx}{ord}.tbl :ORDER = {ord}
491  if counter .eq. 0 then
492  merge/table {tab_pfx}{ord}.tbl {cpfx}_{ccd_id}.tbl
493  counter = counter + 1
494  else
495  -rename {cpfx}_{ccd_id}.tbl tmp.tbl
496  merge/table tmp.tbl {tab_pfx}{ord}.tbl {cpfx}_{ccd_id}.tbl
497  endif
498  copy/dd {iim_pfx}{ord}.bdf CORVEL_MAX {cpfx}_{ccd_id}.tbl CCF_PMX{ord}
499  qc1log/out 1 {otab} "QC.CCF{ord}.POSMAX" {{iim_pfx}{ord}.bdf,CORVEL_MAX} "CCF pos Max"
500  qc1log/out 1 {otab} "QC.CCF{ord}.INTMAX" {{tab_pfx}{ord}.tbl,CCF_MAX} "CCF Int Max"
501  qc1log/out 1 {otab} "QC.CCF{ord}.WAVRNG" {{tab_pfx}{ord}.tbl,WAV_RNG} "CCF Range"
502  qc1log/out 1 {otab} "QC.CCF{ord}.PIXTOT" {{tab_pfx}{ord}.tbl,PIX_TOT} "CCF Pix"
503  qc1log/out 1 {otab} "QC.CCF{ord}.LINTOT" {{tab_pfx}{ord}.tbl,LIN_TOT} "CCF Lin"
504  if "{{iim_pfx}{ord}.bdf,CORVEL_MAX}" .ne. "NAN" then
505  ccfcnt({ord}) = {{iim_pfx}{ord}.bdf,CORVEL_MAX}
506  else
507  mess/out 2 {pid} "Pos Max Nan for order {ord}. Skip it"
508  ccfcnt({ord}) = 999
509  endif
510 
511  copy/dd {tab_pfx}{ord}.tbl CCF_MAX {cpfx}_{ccd_id}.tbl CCF_MAX{ord}
512  copy/dd {tab_pfx}{ord}.tbl WAV_RNG {cpfx}_{ccd_id}.tbl WAV_RNG{ord}
513  copy/dd {tab_pfx}{ord}.tbl PIX_TOT {cpfx}_{ccd_id}.tbl PIX_TOT{ord}
514  copy/dd {tab_pfx}{ord}.tbl LIN_TOT {cpfx}_{ccd_id}.tbl LIN_TOT{ord}
515 
516 
517 
518  copy/dd {iim_pfx}{ord}.bdf CORVEL_MAX {tim_ccf} CCF_PMX{ord}
519  copy/dd {tim_pfx}{ord}.bdf CCF_MAX {tim_ccf} CCF_MAX{ord}
520  copy/dd {tim_pfx}{ord}.bdf WAV_RNG {tim_ccf} WAV_RNG{ord}
521  copy/dd {tim_pfx}{ord}.bdf PIX_TOT {tim_ccf} PIX_TOT{ord}
522  copy/dd {tim_pfx}{ord}.bdf LIN_TOT {tim_ccf} LIN_TOT{ord}
523 
524  copy/dd {iim_pfx}{ord}.bdf CORVEL_MAX {nim_ccf} CCF_PMX{ord}
525  copy/dd {nim_pfx}{ord}.bdf CCF_MAX {nim_ccf} CCF_MAX{ord}
526  copy/dd {nim_pfx}{ord}.bdf WAV_RNG {nim_ccf} WAV_RNG{ord}
527  copy/dd {nim_pfx}{ord}.bdf PIX_TOT {nim_ccf} PIX_TOT{ord}
528  copy/dd {nim_pfx}{ord}.bdf LIN_TOT {nim_ccf} LIN_TOT{ord}
529 
530  enddo
531  ord = {ord_max}-{ord_min}+1
532  CVELTAB/FLAMES {cpfx}_{ccd_id}.tbl {ord}
533 
534 
535 
536  nord = 0
537  do ord = ord_min ord_max
538  if ccfcnt({ord}) .ne. 999 then
539  avgcnt = avgcnt+ccfcnt({ord})
540  nord = nord+1
541  endif
542  enddo
543  avgcnt = avgcnt/(nord)
544  do ord = ord_min ord_max
545  if ccfcnt({ord}) .ne. 999 then
546  sigcnt = sigcnt+(ccfcnt({ord})-avgcnt)*(ccfcnt({ord})-avgcnt)
547  endif
548  enddo
549  sigcnt = m$sqrt(sigcnt/(nord-1))
550 
551 
552  mess/out {DRS_MES_LEV} {pid} "POSAVG={avgcnt} POSRMS={sigcnt}"
553  qc1log/out 1 {otab} "QC.CCF.POSAVG" {avgcnt} "CCF pos avg"
554  qc1log/out 1 {otab} "QC.CCF.POSRMS" {sigcnt} "CCF pos rms"
555  qc1log/out 1 {otab} "QC.CCF.POSOFF" {p8} "CCF pos avg from ThAr calibration"
556 
557  qc1log/out 3
558  return {avgcnt}
559  !set/format {cpfx}_{ccd_id}.tbl
560 
561 
562  */
563  cleanup:
564 
565  if(plist_ima_new!=NULL) {
566  uves_msg_warning("free");
567  cpl_propertylist_delete(plist_ima_new);
568  plist_ima_new=NULL;
569  }
570  uves_free_table(&cvel_tbl);
571  uves_free_image(&tim_ccf_ima);
572  uves_free_image(&nim_ccf_ima);
573  uves_free_image(&tot_ima);
574  uves_free_image(&nrm_ima);
575  uves_free_table(&cvel_ord_tbl);
576 
577 
578 
579  if (cpl_error_get_code() != CPL_ERROR_NONE) {
580  uves_check_rec_status(9);
581  //uves_free_imagelist(&obj_cor);
582  return -1;
583  } else {
584  return 0;
585  }
586 
587 }
588 
#define uves_msg_error(...)
Print an error message.
Definition: uves_msg.h:64
#define uves_msg_warning(...)
Print an warning message.
Definition: uves_msg.h:87
int uves_qclog_add_string(cpl_table *table, const char *key_name, const char *value, const char *key_help, const char *format)
Add string key to QC-LOG table.
Definition: uves_qclog.c:683
#define check_nomsg(CMD)
Definition: uves_error.h:204
int uves_qclog_add_double(cpl_table *table, const char *key_name, const double value, const char *key_help, const char *format)
Add double key to QC-LOG table.
Definition: uves_qclog.c:641
int uves_qclog_add_int(cpl_table *table, const char *key_name, const int value, const char *key_help, const char *format)
Add integer key to QC-LOG table.
Definition: uves_qclog.c:521
#define uves_msg(...)
Print a message on 'info' or 'debug' level.
Definition: uves_msg.h:119
#define uves_msg_debug(...)
Print a debug message.
Definition: uves_msg.h:97