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 #ifdef HAVE_CONFIG_H
00029 #include <config.h>
00030 #endif
00031
00032
00033
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
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
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