00001 00002 /*---------------------------------------------------------------------------- 00003 * E.S.O. 00004 *---------------------------------------------------------------------------- 00005 * File name : dead_pixels.h 00006 * Author : Nicolas Devillard 00007 * Created on : Sept 15, 1995 00008 * Hardware : Sun Sparc 20 00009 * Software : ANSI C under Solaris Unix 00010 * Part of ECLIPSE library for Adonis 00011 * Description : dead pixel localization/elimination 00012 *--------------------------------------------------------------------------*/ 00013 00014 /* 00015 00016 $Id: dead_pixels.h,v 1.1 2003/09/03 12:50:47 amodigli Exp $ 00017 $Author: amodigli $ 00018 $Date: 2003/09/03 12:50:47 $ 00019 $Revision: 1.1 $ 00020 00021 */ 00022 00023 #ifndef _DEAD_PIXELS_H_ 00024 #define _DEAD_PIXELS_H_ 00025 00026 /*---------------------------------------------------------------------------- 00027 * Includes 00028 *--------------------------------------------------------------------------*/ 00029 00030 #include <stdio.h> 00031 #include <math.h> 00032 00033 #include "memory.h" 00034 #include "cube_defs.h" 00035 #include "cube_handling.h" 00036 #include "cube_arith.h" 00037 #include "cube2image.h" 00038 #include "image_filters.h" 00039 #include "pixelmaps.h" 00040 #include "globals.h" 00041 00042 00043 /*---------------------------------------------------------------------------- 00044 * Defines 00045 *--------------------------------------------------------------------------*/ 00046 00047 #define DEAD_PIX 0 00048 #define GOOD_PIX 1 00049 00050 00051 /*---------------------------------------------------------------------------- 00052 * Function ANSI C prototypes 00053 *--------------------------------------------------------------------------*/ 00054 00055 /*---------------------------------------------------------------------------- 00056 Function : get_number_of_good_pix() 00057 In : pixel_map 00058 Out : ulong32 00059 Job : find out how many good pixels are in a pixel map 00060 Notice : 00061 ---------------------------------------------------------------------------*/ 00062 00063 ulong32 00064 get_number_of_good_pix(pixel_map * map1) ; 00065 00066 00067 /*---------------------------------------------------------------------------- 00068 Function : clean_image_dead_pix() 00069 In : image, dead pixel map 00070 Out : newly allocated, clean image 00071 Job : clean out an image of its dead pixels 00072 Notice : 00073 ---------------------------------------------------------------------------*/ 00074 00075 OneImage * 00076 clean_image_dead_pix( 00077 OneImage * dirty, 00078 pixel_map * deadpixmap 00079 ) ; 00080 00081 00082 /*---------------------------------------------------------------------------- 00083 Function : clean_cube_dead_pix() 00084 In : 1 cube, dead pixel map 00085 Out : newly allocated cube 00086 Job : clean out a cube of its bad pixels 00087 Notice : the same map is applied to each plane for cleaning 00088 no 3d process 00089 ---------------------------------------------------------------------------*/ 00090 00091 OneCube * 00092 clean_cube_dead_pix( 00093 OneCube * dirty, 00094 pixel_map * deadpixmap 00095 ) ; 00096 00097 /*--------------------------------------------------------------------------- 00098 Function : clean_cube_dead_pix_local() 00099 In : 1 cube, 1 dead pixel map 00100 Out : int 0 if Ok, -1 otherwise 00101 Job : clean out a cube of its bad pixels. 00102 Notice : works locally, the input cube is modified 00103 ---------------------------------------------------------------------------*/ 00104 00105 int clean_cube_dead_pix_local( 00106 OneCube * in, 00107 pixel_map * deadpixmap 00108 ) ; 00109 00110 00111 /*---------------------------------------------------------------------------- 00112 Function : count_pixels_in_interval() 00113 In : 1 image, upper and lower bounds of a pixelvalue interval 00114 Out : message on stdout 00115 Job : counts how many pixels are above upper and below lower 00116 threshold. 00117 Notice : 00118 ---------------------------------------------------------------------------*/ 00119 00120 void 00121 count_pixels_in_interval( 00122 OneImage * image1, 00123 double lo_bound, 00124 double hi_bound 00125 ) ; 00126 00127 00128 /*---------------------------------------------------------------------------- 00129 Function : detect_dead_by_median() 00130 In : 1 image 00131 Out : bad pixel map 00132 Job : detects bad pixels by differentiating original image and 00133 median-filtered version, and detecting remaining spikes. 00134 Notice : 00135 ---------------------------------------------------------------------------*/ 00136 00137 pixel_map * 00138 detect_dead_by_median( 00139 OneImage * dirty, 00140 pixelvalue median_threshold 00141 ) ; 00142 00143 00144 /*---------------------------------------------------------------------------- 00145 Function : pixelmap_by_median() 00146 In : sky cube name, median threshold 00147 Out : bad pixel map 00148 Job : detects bad pixels using a median method 00149 Notice : 00150 ---------------------------------------------------------------------------*/ 00151 00152 pixel_map * 00153 pixelmap_by_median( 00154 char * skyname, 00155 pixelvalue median_threshold 00156 ) ; 00157 00158 00159 /*---------------------------------------------------------------------------- 00160 Function : pixelmap_by_time_obs() 00161 In : sky cube name 00162 Out : bad pixel map 00163 Job : find out bad pixels by observing pixel behavior in time 00164 Notice : 00165 ---------------------------------------------------------------------------*/ 00166 00167 pixel_map * 00168 pixelmap_by_time_obs( 00169 char * skyname, 00170 double sigma_width 00171 ) ; 00172 00173 #endif 00174 /*--------------------------------------------------------------------------*/
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001