00001 /* * 00002 * This file is part of the ESO X-shooter Pipeline * 00003 * Copyright (C) 2006 European Southern Observatory * 00004 * * 00005 * This library is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the Free Software * 00017 * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA * 00018 * */ 00019 00020 /* 00021 * $Author: amodigli $ 00022 * $Date: 2009/09/27 10:37:36 $ 00023 * $Revision: 1.3 $ 00024 */ 00025 00026 #ifndef XSH_DATA_PRE_3D_H 00027 #define XSH_DATA_PRE_3D_H 00028 00029 /*---------------------------------------------------------------------------- 00030 Includes 00031 ----------------------------------------------------------------------------*/ 00032 #include <xsh_data_instrument.h> 00033 00034 #include <cpl.h> 00035 #include <xsh_error.h> 00036 #include <xsh_data_image_3d.h> 00037 00038 /*---------------------------------------------------------------------------- 00039 Typedefs 00040 ----------------------------------------------------------------------------*/ 00041 00042 #define XSH_PRE_DATA_TYPE CPL_TYPE_FLOAT 00043 #define XSH_PRE_DATA_BPP CPL_BPP_IEEE_FLOAT 00044 #define XSH_PRE_ERRS_TYPE CPL_TYPE_FLOAT 00045 #define XSH_PRE_ERRS_BPP CPL_BPP_IEEE_FLOAT 00046 #define XSH_PRE_QUAL_TYPE CPL_TYPE_INT 00047 #define XSH_PRE_QUAL_BPP CPL_BPP_32_SIGNED 00048 00049 typedef struct { 00050 xsh_image_3d *data; 00051 cpl_propertylist *data_header; 00052 00053 xsh_image_3d *errs; 00054 cpl_propertylist *errs_header; 00055 00056 xsh_image_3d *qual; 00057 cpl_propertylist *qual_header; 00058 00059 cpl_frame_group group; 00060 /* instrument related with PRE */ 00061 xsh_instrument* instrument; 00062 /* NAXIS1 and NAXIS2 keywords */ 00063 int naxis1, naxis2, naxis3 ; 00064 /* BINX et BINY keywords */ 00065 int binx, biny; 00066 /* image size (DATA,ERRS,QUAL) in pixels */ 00067 int nx, ny, nz; 00068 } xsh_pre_3d; 00069 00070 #include <xsh_badpixelmap.h> 00071 00072 00073 /*---------------------------------------------------------------------------- 00074 Methods 00075 ----------------------------------------------------------------------------*/ 00076 00077 /* Create/destroy */ 00078 void xsh_pre_3d_free(xsh_pre_3d ** pre); 00079 xsh_pre_3d * xsh_pre_3d_load(cpl_frame * frame); 00080 00081 cpl_frame* xsh_pre_3d_save( const xsh_pre_3d *pre, const char *filename, 00082 int temp); 00083 00084 xsh_pre_3d * xsh_pre_3d_new(int size_x, int size_y, int size_z ); 00085 00086 /* get */ 00087 int xsh_pre_3d_get_nx(const xsh_pre_3d *pre); 00088 int xsh_pre_3d_get_ny(const xsh_pre_3d *pre); 00089 int xsh_pre_3d_get_nz(const xsh_pre_3d *pre); 00090 00091 cpl_frame_group xsh_pre_3d_get_group(const xsh_pre_3d * pre); 00092 cpl_mask * xsh_pre_3d_get_bpmap(const xsh_pre_3d * pre); 00093 00094 /* Accessor functions 00095 * (const/non-const variants of each) 00096 */ 00097 xsh_image_3d * xsh_pre_3d_get_data( xsh_pre_3d * pre_3d ) ; 00098 xsh_image_3d * xsh_pre_3d_get_errs( xsh_pre_3d * pre_3d ) ; 00099 xsh_image_3d * xsh_pre_3d_get_qual( xsh_pre_3d * pre_3d ) ; 00100 00101 const 00102 cpl_propertylist *xsh_pre_3d_get_header_const(const xsh_pre_3d *pre); 00103 cpl_propertylist *xsh_pre_3d_get_header ( xsh_pre_3d *pre); 00104 00105 #endif