HAWKI Pipeline Reference Manual 1.8.12
|
00001 /* $Id: hawki_obj_det.c,v 1.2 2009/09/29 09:13:00 cgarcia Exp $ 00002 * 00003 * This file is part of the HAWKI Pipeline 00004 * Copyright (C) 2002,2003 European Southern Observatory 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 */ 00020 00021 /* 00022 * $Author: cgarcia $ 00023 * $Date: 2009/09/29 09:13:00 $ 00024 * $Revision: 1.2 $ 00025 * $Name: hawki-1_8_12 $ 00026 */ 00027 00028 #ifdef HAVE_CONFIG_H 00029 #include <config.h> 00030 #endif 00031 00032 /*----------------------------------------------------------------------------- 00033 Includes 00034 -----------------------------------------------------------------------------*/ 00035 00036 #include <float.h> 00037 #include <string.h> 00038 #include <math.h> 00039 #include <cpl.h> 00040 00041 #include "hawki_dfs.h" 00042 #include "hawki_utils.h" 00043 #include "hawki_pfits.h" 00044 #include "hawki_obj_det.h" 00045 00046 /*----------------------------------------------------------------------------*/ 00050 /*----------------------------------------------------------------------------*/ 00051 00054 /*----------------------------------------------------------------------------*/ 00067 int hawki_obj_prop_stats 00068 (cpl_table ** objs_prop, cpl_propertylist ** objs_prop_stats) 00069 { 00070 cpl_errorstate prestate = cpl_errorstate_get(); 00071 int idet; 00072 00073 /* Checking input */ 00074 if(objs_prop == NULL || objs_prop_stats == NULL) 00075 { 00076 cpl_msg_error(__func__, "The property list or the tel table is null"); 00077 return -1; 00078 } 00079 00080 /* Compute the statistics */ 00081 for(idet = 0; idet < HAWKI_NB_DETECTORS; ++idet) 00082 { 00083 cpl_propertylist_append_double 00084 (objs_prop_stats[idet], "ESO QC OBJ ANGLE MEAN", 00085 cpl_table_get_column_mean(objs_prop[idet], HAWKI_COL_OBJ_ANGLE)); 00086 cpl_propertylist_append_double 00087 (objs_prop_stats[idet], "ESO QC OBJ ANGLE MED", 00088 cpl_table_get_column_median(objs_prop[idet], HAWKI_COL_OBJ_ANGLE)); 00089 cpl_propertylist_append_double 00090 (objs_prop_stats[idet], "ESO QC OBJ ANGLE MIN", 00091 cpl_table_get_column_min(objs_prop[idet], HAWKI_COL_OBJ_ANGLE)); 00092 cpl_propertylist_append_double 00093 (objs_prop_stats[idet], "ESO QC OBJ ANGLE MAX", 00094 cpl_table_get_column_max(objs_prop[idet], HAWKI_COL_OBJ_ANGLE)); 00095 cpl_propertylist_append_double 00096 (objs_prop_stats[idet], "ESO QC OBJ ANGLE STDEV", 00097 cpl_table_get_column_stdev(objs_prop[idet], HAWKI_COL_OBJ_ANGLE)); 00098 00099 cpl_propertylist_append_double 00100 (objs_prop_stats[idet], "ESO QC OBJ ELLIP MEAN", 00101 cpl_table_get_column_mean(objs_prop[idet], HAWKI_COL_OBJ_ELLIP)); 00102 cpl_propertylist_append_double 00103 (objs_prop_stats[idet], "ESO QC OBJ ELLIP MED", 00104 cpl_table_get_column_median(objs_prop[idet], HAWKI_COL_OBJ_ELLIP)); 00105 cpl_propertylist_append_double 00106 (objs_prop_stats[idet], "ESO QC OBJ ELLIP MIN", 00107 cpl_table_get_column_min(objs_prop[idet], HAWKI_COL_OBJ_ELLIP)); 00108 cpl_propertylist_append_double 00109 (objs_prop_stats[idet], "ESO QC OBJ ELLIP MAX", 00110 cpl_table_get_column_max(objs_prop[idet], HAWKI_COL_OBJ_ELLIP)); 00111 cpl_propertylist_append_double 00112 (objs_prop_stats[idet], "ESO QC OBJ ELLIP STDEV", 00113 cpl_table_get_column_stdev(objs_prop[idet], HAWKI_COL_OBJ_ELLIP)); 00114 } 00115 00116 if(!cpl_errorstate_is_equal(prestate)) 00117 return -1; 00118 return 0; 00119 } 00120