00001 00002 /*---------------------------------------------------------------------------- 00003 * E.S.O. 00004 *---------------------------------------------------------------------------- 00005 * File name : pixelmaps.h 00006 * Author : Nicolas Devillard 00007 * Created on : Mar 03, 1997 00008 * Hardware : Sun Sparc 20 00009 * Software : ANSI C under Solaris Unix 00010 * Part of ECLIPSE library for Adonis 00011 * Description : pixel map handling 00012 *--------------------------------------------------------------------------*/ 00013 00014 /* 00015 00016 $Id: pixelmaps.h,v 1.3 2005/03/16 13:16:28 amodigli Exp $ 00017 $Author: amodigli $ 00018 $Date: 2005/03/16 13:16:28 $ 00019 $Revision: 1.3 $ 00020 00021 */ 00022 00023 00024 #ifndef _PIXEL_MAPS_H_ 00025 #define _PIXEL_MAPS_H_ 00026 00027 00028 /*---------------------------------------------------------------------------- 00029 * Includes 00030 *--------------------------------------------------------------------------*/ 00031 00032 #include <stdio.h> 00033 #include <math.h> 00034 00035 #include "memory.h" 00036 #include "cube_defs.h" 00037 #include "cube_handling.h" 00038 #include "cube2image.h" 00039 #include "globals.h" 00040 00041 /*---------------------------------------------------------------------------- 00042 * Defines 00043 *--------------------------------------------------------------------------*/ 00044 /*<python>*/ 00045 #define ONE 1 00046 #define FLAG -1.e+9 00047 #define ZERO 0./0. 00048 /*</python>*/ 00049 /* Zero now has to be NaN, due to use of isnan() throughout code).*/ 00050 00051 00052 /*---------------------------------------------------------------------------- 00053 * Function ANSI C prototypes 00054 *--------------------------------------------------------------------------*/ 00055 00056 00057 /*--------------------------------------------------------------------------- 00058 * Function : new_pixelmap() 00059 * In : PixelMap Size 00060 * Out : Pointer to newly allocated structure 00061 * Job : Allocate space for a new pixel map 00062 * Notice : 00063 *--------------------------------------------------------------------------*/ 00064 00065 pixel_map * 00066 new_pixelmap( 00067 int lx, 00068 int ly 00069 ) ; 00070 00071 00072 00073 /*--------------------------------------------------------------------------- 00074 * Function : destroy_pixelmap() 00075 * In : PixelMap pointer 00076 * Out : void 00077 * Job : frees all memory associated to a pixel_map 00078 * Notice : 00079 *--------------------------------------------------------------------------*/ 00080 00081 void 00082 destroy_pixelmap(pixel_map * to_destroy) ; 00083 00084 00085 /*--------------------------------------------------------------------------- 00086 * Function : thresh_image_to_pixelmap() 00087 * In : OneCube, allocated pixel map to update, threshholds 00088 * Out : dead pixel map 00089 * Job : Builds a dead pixel map from an image 00090 * Notice : Give interval for authorized standard deviations, all 00091 * pixels out of this interval will be rejected 00092 *--------------------------------------------------------------------------*/ 00093 00094 pixel_map * 00095 thresh_image_to_pixelmap( 00096 OneImage * to_threshold, 00097 double lo_cut, 00098 double hi_cut 00099 ) ; 00100 00101 00102 /*--------------------------------------------------------------------------- 00103 * Function : update_pixelmap() 00104 * In : Pixel map to update, pixel map to update with 00105 * Out : void 00106 * Job : updates first pixelmap (1st argument) with second 00107 * sets to zero in first map pixels which are set to zero 00108 * in second map (zeroer). 00109 * Notice : 00110 *--------------------------------------------------------------------------*/ 00111 00112 void 00113 update_pixelmap( 00114 pixel_map * updated, 00115 pixel_map * zeroer 00116 ) ; 00117 00118 00119 /*--------------------------------------------------------------------------- 00120 * Function : dump_pixelmap() 00121 * In : pixel_map, filename 00122 * Out : void 00123 * Job : dumps a pixel map on a file in FITS format 00124 * Notice : 8 bit per pel FITS 00125 *--------------------------------------------------------------------------*/ 00126 00127 void 00128 dump_pixelmap( 00129 pixel_map * to_dump, 00130 char * filename 00131 ) ; 00132 00133 00134 /*--------------------------------------------------------------------------- 00135 * Function : load_pixelmap() 00136 * In : file name 00137 * Out : pixel_map 00138 * Job : loads a pixel_map into memory 00139 * Notice : 00140 *--------------------------------------------------------------------------*/ 00141 00142 pixel_map * 00143 load_pixelmap(char * filename) ; 00144 00145 00146 /*--------------------------------------------------------------------------- 00147 * Function : promote_pixelmap_to_image() 00148 * In : pixel_map* 00149 * Out : OneImage* 00150 * Job : convert a pixel_map structure to an image structure 00151 * Notice : 00152 *--------------------------------------------------------------------------*/ 00153 00154 OneImage *promote_pixelmap_to_image(pixel_map *to_promote) ; 00155 00156 00157 /*--------------------------------------------------------------------------- 00158 * Function : update_pixcount_pixelmap() 00159 * In : Pixel map to be updated 00160 * Out : void 00161 * Job : Counts the number of good pixels and overwrites the current 00162 * ngoodpix 00163 * Notice : 00164 *--------------------------------------------------------------------------*/ 00165 00166 void 00167 update_pixcount_pixelmap(pixel_map * to_update) ; 00168 00169 00170 /*--------------------------------------------------------------------------- 00171 Function : pixelmap_binary_AND() 00172 In : two pixelmaps 00173 Out : int 0 if Ok, anything else otherwise 00174 Job : perform a binary AND 00175 Notice : modifies the first input pixel map 00176 ---------------------------------------------------------------------------*/ 00177 00178 int pixelmap_binary_AND(pixel_map * p1, pixel_map * p2); 00179 00180 00181 /*--------------------------------------------------------------------------- 00182 Function : pixelmap_binary_OR() 00183 In : two pixelmaps 00184 Out : int 0 if Ok, anything else otherwise 00185 Job : perform a binary OR 00186 Notice : modifies the first input pixel map 00187 ---------------------------------------------------------------------------*/ 00188 00189 int pixelmap_binary_OR(pixel_map * p1, pixel_map * p2); 00190 00191 00192 /*--------------------------------------------------------------------------- 00193 Function : pixelmap_binary_XOR() 00194 In : two pixelmaps 00195 Out : int 0 if Ok, anything else otherwise 00196 Job : perform a binary XOR 00197 Notice : modifies the first input pixel map 00198 ---------------------------------------------------------------------------*/ 00199 00200 int pixelmap_binary_XOR(pixel_map * p1, pixel_map * p2); 00201 00202 00203 /*--------------------------------------------------------------------------- 00204 Function : pixelmap_binary_NOT() 00205 In : 1 pixelmap 00206 Out : int 0 if Ok, anything else otherwise 00207 Job : perform a binary NOT 00208 Notice : modifies the input pixel map 00209 ---------------------------------------------------------------------------*/ 00210 00211 int pixelmap_binary_NOT(pixel_map * p1); 00212 00213 #endif 00214 /*--------------------------------------------------------------------------*/
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001