fors_image.h

00001 /* $Id: fors_image.h,v 1.30 2010/09/14 07:49:30 cizzo Exp $
00002  *
00003  * This file is part of the FORS Library
00004  * Copyright (C) 2002-2010 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  02110-1301 USA
00019  */
00020 
00021 /*
00022  * $Author: cizzo $
00023  * $Date: 2010/09/14 07:49:30 $
00024  * $Revision: 1.30 $
00025  * $Name: fors-4_8_6 $
00026  */
00027 
00028 #ifndef FORS_IMAGE_H
00029 #define FORS_IMAGE_H
00030 
00031 #include <fors_setting.h>
00032 #include <cpl.h>
00033 
00034 typedef struct _fors_image fors_image;
00035 
00036 extern const cpl_type FORS_IMAGE_TYPE;
00037 
00038 /* Container */
00039 #undef LIST_ELEM
00040 #define LIST_ELEM fors_image
00041 #include <list.h>
00042 
00043 /* Constructors */
00044 fors_image *fors_image_new(cpl_image *data, cpl_image *weights);
00045 
00046 fors_image *fors_image_duplicate(const fors_image *image);
00047 
00048 /* Desctructors */
00049 void fors_image_delete(fors_image **image);
00050 void fors_image_delete_const(const fors_image **image);
00051 
00052 
00053 /* I/O */
00054 fors_image *fors_image_load(const cpl_frame *frame, const fors_image *bias,
00055                 const fors_setting *setting,
00056                 double *saturated);
00057 
00058 
00059 fors_image_list *fors_image_load_list(const cpl_frameset *frames, 
00060                       const fors_image *bias,
00061                       const fors_setting *setting,
00062                       double *saturated);
00063 
00064 const fors_image_list *
00065 fors_image_load_list_const(const cpl_frameset *frames, const fors_image *bias,
00066                            const fors_setting *setting,
00067                            double *saturated);
00068 
00069 void
00070 fors_image_save(const fors_image *image, const cpl_propertylist *header,
00071         const char *filename);
00072 
00073 void
00074 fors_image_save_sex(const fors_image *image, const cpl_propertylist *header,
00075                     const char *filename_dat,
00076                     const char *filename_var,
00077                     int radius);
00078 
00079 /* Other */
00080 int fors_image_get_size_x(const fors_image *image);
00081 int fors_image_get_size_y(const fors_image *image);
00082 const float *fors_image_get_data_const(const fors_image *image);
00083 
00084 void fors_image_draw(fors_image *image, int type,
00085              double x, double y,
00086              int radius, double color);
00087 
00088 void fors_image_crop(fors_image *image,
00089              int xlo, int ylo,
00090              int xhi, int yhi);
00091 
00092 /* Arithmetic */
00093 void fors_image_subtract(fors_image *left, const fors_image *right);
00094 void fors_image_multiply(fors_image *left, const fors_image *right);
00095 void fors_image_multiply_noerr(fors_image *left, const cpl_image *right);
00096 void fors_image_divide(fors_image *left, const fors_image *right);
00097 void fors_image_divide_noerr(fors_image *left, cpl_image *right);
00098 void fors_image_abs(fors_image *image);
00099 void fors_image_square(fors_image *image);
00100 
00101 void fors_image_exponential(fors_image *image, double b, double db);
00102 void fors_image_multiply_scalar(fors_image *image, double s, double ds);
00103 void fors_image_divide_scalar(fors_image *image, double s, double ds);
00104 void fors_image_subtract_scalar(fors_image *image, double s, double ds);
00105 
00106 fors_image *fors_image_collapse_create(const fors_image_list *images);
00107 fors_image *fors_image_collapse_median_create(const fors_image_list *images);
00108 fors_image *fors_image_collapse_minmax_create(const fors_image_list *images, 
00109                                               int low, int high);
00110 fors_image *fors_image_collapse_ksigma_create(const fors_image_list *images, 
00111                                               int low, int high, int iter);
00112 
00113 cpl_image *
00114 fors_image_filter_median_create(const fors_image *image, 
00115                                 int xradius,
00116                                 int yradius,
00117                                 int xstart, 
00118                                 int ystart,
00119                                 int xend,
00120                                 int yend,
00121                                 int xstep,
00122                                 int ystep,
00123                                 bool use_data);
00124 
00125 cpl_image *
00126 fors_image_flat_fit_create(fors_image *image,
00127                            int step,
00128                            int degree,
00129                            float level);
00130 cpl_image *
00131 fors_image_filter_max_create(const fors_image *image,
00132                              int xradius,
00133                              int yradius,
00134                              bool use_data);
00135 
00136 /* Statistics */
00137 double fors_image_get_mean(const fors_image *image, double *dmean);
00138 double fors_image_get_median(const fors_image *image, double *dmedian);
00139 
00140 double fors_image_get_stdev(const fors_image *image, double *dstdev);
00141 double fors_image_get_stdev_robust(const fors_image *image, 
00142                    double cut,
00143                    double *dstdev);
00144 double fors_image_get_error_mean(const fors_image *image, double *dmean);
00145 
00146 double fors_image_get_min(const fors_image *image);
00147 double fors_image_get_max(const fors_image *image);
00148 
00149 #endif

Generated on Fri Mar 4 09:46:00 2011 for FORS Pipeline Reference Manual by  doxygen 1.4.7