00001 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 00002 /* vim:set sw=2 sts=2 et cin: */ 00003 /* 00004 * This file is part of the MUSE Instrument Pipeline 00005 * Copyright (C) 2008-2014 European Southern Observatory 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00020 */ 00021 00022 #ifndef MUSE_GEO_H 00023 #define MUSE_GEO_H 00024 00025 /*----------------------------------------------------------------------------* 00026 * Includes * 00027 *----------------------------------------------------------------------------*/ 00028 #include <cpl.h> 00029 00030 #include "muse_cplwrappers.h" 00031 #include "muse_image.h" 00032 #include "muse_imagelist.h" 00033 00037 /*----------------------------------------------------------------------------* 00038 * Defines * 00039 *----------------------------------------------------------------------------*/ 00040 /* This lists some constants that are not really hard instrument properties * 00041 * (and hence do not belong into muse_instrument.h) but where set up by * 00042 * experience with a few (full) geometry datasets sind spring of 2013. */ 00043 00044 /* define some standard gap sizes to fall back onto; these numbers * 00045 * were derived as the peaks of the histograms of the valid * 00046 * (positive) gap sizes of the datasets 2013-06 and 2013-08 */ 00047 static const double kMuseGeoMiddleGap = 0.04, /* [pix] for central gap */ 00048 kMuseGeoOuterGap = 0.07; /* [pix] for left and right gaps */ 00049 /* approximate vertical size of an IFU, guessed from real data */ 00050 static const double kMuseGeoIFUVGap = 1.5780; /* [mm] */ 00051 00052 /* maximum slice angle to expect in the creation of the geometry * 00053 * table (the real angles should be much smaller, but angles above * 00054 * this absolute value will definitely be wrong ) */ 00055 static const double kMuseGeoSliceMaxAngle = 5.; /* [deg] */ 00056 00057 /*----------------------------------------------------------------------------* 00058 * Special variable types * 00059 *----------------------------------------------------------------------------*/ 00060 extern const muse_cpltable_def muse_geo_measurements_def[]; 00061 extern const muse_cpltable_def muse_geo_table_def[]; 00062 00063 /*----------------------------------------------------------------------------*/ 00070 /*----------------------------------------------------------------------------*/ 00071 typedef struct { 00077 cpl_table *table; 00078 00083 double scale; 00084 } muse_geo_table; 00085 00086 /*----------------------------------------------------------------------------*/ 00090 /*----------------------------------------------------------------------------*/ 00091 typedef enum { 00092 MUSE_GEO_CENTROID_BARYCENTER = 0, 00093 MUSE_GEO_CENTROID_GAUSSIAN 00094 } muse_geo_centroid_type; 00095 00098 /*----------------------------------------------------------------------------* 00099 * Function prototypes * 00100 *----------------------------------------------------------------------------*/ 00101 cpl_table *muse_geo_table_extract_ifu(const cpl_table *, const unsigned char); 00102 double muse_geo_table_ifu_area(const cpl_table *, const unsigned char, double); 00103 00104 cpl_vector *muse_geo_lines_get(const cpl_table *); 00105 cpl_table *muse_geo_measure_spots(muse_image *, muse_imagelist *, const cpl_table *, const cpl_table *, const cpl_vector *, double, muse_geo_centroid_type); 00106 00107 cpl_error_code muse_geo_compute_pinhole_local_distance(cpl_array *, cpl_table *); 00108 double muse_geo_compute_pinhole_global_distance(cpl_array *, double, double, double); 00109 00110 muse_geo_table *muse_geo_table_new(cpl_size, double); 00111 muse_geo_table *muse_geo_table_duplicate(const muse_geo_table *); 00112 void muse_geo_table_delete(muse_geo_table *); 00113 00114 muse_geo_table *muse_geo_determine_initial(cpl_table *, const cpl_table *); 00115 muse_geo_table *muse_geo_determine_horizontal(const muse_geo_table *); 00116 cpl_error_code muse_geo_refine_horizontal(muse_geo_table *, cpl_table *); 00117 muse_geo_table *muse_geo_determine_vertical(const muse_geo_table *); 00118 cpl_error_code muse_geo_finalize(muse_geo_table *); 00119 cpl_error_code muse_geo_correct_slices(muse_geo_table *, cpl_propertylist *, double); 00120 00121 cpl_error_code muse_geo_qc_global(const muse_geo_table *, cpl_propertylist *); 00122 00123 #endif /* MUSE_GEO_H */
1.6.1