FORS Pipeline Reference Manual  5.0.9
fors_subtract_bias.c
1 /*
2  * This file is part of the FORS Data Reduction Pipeline
3  * Copyright (C) 2002-2010 European Southern Observatory
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 #ifdef HAVE_CONFIG_H
21 #include <config.h>
22 #endif
23 
24 #include "fors_utils.h"
25 #include "fors_image.h"
26 
27 
28 #undef cleanup
29 #define cleanup
30 
35 void fors_subtract_bias(fors_image * image,
36  const fors_image *bias)
37 {
38  /* Variance is now (image_noise**2 + bias_noise**2) */
39  fors_image_subtract(image, bias);
40 
41  assure( !cpl_error_get_code(), return , "Bias subtraction failed" );
42 
43 }
44 
45 void fors_subtract_bias_imglist(fors_image_list * imglist,
46  const fors_image *bias)
47 {
48 
49  fors_image * img = fors_image_list_first(imglist);
50  for(int i = 0; i< fors_image_list_size(imglist); i++)
51  {
52  fors_subtract_bias(img, bias);
53  img = fors_image_list_next(imglist);
54  }
55 
56  assure( !cpl_error_get_code(), return , "Bias subtraction failed" );
57 
58 }
void fors_image_subtract(fors_image *left, const fors_image *right)
Subtract images.
Definition: fors_image.c:595
#define assure(EXPR)
Definition: list.c:101