00001 /* $Id: visir_spc_optmod.h,v 1.13 2007/03/12 09:58:51 llundin Exp $ 00002 * 00003 * This file is part of the VISIR 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., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA 00019 */ 00020 00021 /* 00022 * $Author: llundin $ 00023 * $Date: 2007/03/12 09:58:51 $ 00024 * $Revision: 1.13 $ 00025 * $Name: visir-3_5_0 $ 00026 */ 00027 00028 #ifndef VISIR_SPC_OPTMOD_H 00029 #define VISIR_SPC_OPTMOD_H 00030 00031 /*----------------------------------------------------------------------------- 00032 Defines 00033 -----------------------------------------------------------------------------*/ 00034 00035 /* The size of the VISIR Optical Model object */ 00036 #define VISIR_SPC_OPTMOD_SIZEOF (4*sizeof(int) + 14 * sizeof(double)) 00037 00038 /*----------------------------------------------------------------------------- 00039 New types 00040 -----------------------------------------------------------------------------*/ 00041 00042 enum visir_spc_resol_ { 00043 VISIR_SPC_R_ERR = 0, 00044 VISIR_SPC_R_LR, 00045 VISIR_SPC_R_MR, 00046 VISIR_SPC_R_HR, 00047 VISIR_SPC_R_GHR 00048 }; 00049 00050 typedef enum visir_spc_resol_ visir_spc_resol; 00051 00052 struct visir_optmod_ { 00053 /* For this struct only the size is public */ 00054 /* The first member ensures proper alignment of this and its 00055 corresponding private struct, the second member ensures that 00056 the two structs have identical sizes */ 00057 00058 /* Any access to the below two members leads to undefined behaviour! */ 00059 00060 double ensure_alignment; 00061 char contents[VISIR_SPC_OPTMOD_SIZEOF - sizeof(double)]; 00062 }; 00063 00064 typedef struct visir_optmod_ visir_optmod; 00065 00066 #undef VISIR_SPC_OPTMOD_SIZEOF 00067 00068 /*----------------------------------------------------------------------------- 00069 Function prototypes 00070 -----------------------------------------------------------------------------*/ 00071 00072 int visir_spc_optmod_init(visir_spc_resol, double, visir_optmod *); 00073 double visir_spc_optmod_wlen(const visir_optmod *, double *, double *); 00074 double visir_spc_optmod_cross_dispersion(const visir_optmod *, double); 00075 double visir_spc_optmod_echelle(const visir_optmod *, double, int); 00076 double visir_spc_optmod_resolution(const visir_optmod *); 00077 double visir_spc_optmod_dispersion(const visir_optmod *); 00078 int visir_spc_optmod_side_is_A(const visir_optmod *); 00079 int visir_spc_optmod_get_echelle_order(const visir_optmod *); 00080 00081 #endif