63 #include <uves_corrbadpix.h>
64 #include <uves_chip.h>
65 #include <uves_utils_wrappers.h>
66 #include <uves_error.h>
94 cpl_image *master_bias = NULL;
101 map = cpl_calloc(1,
sizeof(
int*));
102 map[0] = cpl_calloc(4,
sizeof(
int));
110 map = cpl_calloc(3,
sizeof(
int*));
111 map[0] = cpl_calloc(4,
sizeof(
int));
116 map[1] = cpl_calloc(4,
sizeof(
int));
121 map[2] = cpl_calloc(4,
sizeof(
int));
128 for (blue = 0; blue <= 1; blue++)
129 for (binx = 1; binx <= 3; binx++)
130 for (biny = 1; biny <= 3; biny++)
132 (binx == 1 && biny == 3) ||
133 (binx == 2 && biny == 1) ||
134 (binx == 3 && biny == 1) ||
135 (binx == 3 && biny == 2) ||
136 (binx == 3 && biny == 3)
140 chip != UVES_CHIP_INVALID;
143 uves_free_image(&master_bias);
144 master_bias = cpl_image_new(4096/biny, 2048/binx, CPL_TYPE_DOUBLE);
147 for (mark_bad = 0; mark_bad <= 1; mark_bad++)
153 "Error getting bad pixel map");
160 binx, biny, mark_bad,0),
161 "Error in bad pixel correction");
164 if (chip == UVES_CHIP_BLUE)
173 CPL_ERROR_ILLEGAL_OUTPUT,
"Wrong output header size: %ld "
183 uves_free_propertylist(&header);
184 uves_free_image(&master_bias);
198 cpl_test_init(PACKAGE_BUGREPORT, CPL_MSG_WARNING);
204 return cpl_test_end(0);
void uves_propertylist_empty(uves_propertylist *self)
Remove all properties from a property list.
void uves_badmap_free(int ***badmap)
Deallocate bpm position.
int ** uves_get_badpix(enum uves_chip chip, int binx, int biny, int mark_bad, bool red_ccd_new)
Get hard-coded bpm map.
uves_propertylist * uves_propertylist_new(void)
Create an empty property list.
long uves_propertylist_get_size(const uves_propertylist *self)
Get the current size of a property list.
static void test_bad_corr(void)
Call the functions which had many memory errors.
enum uves_chip uves_chip_get_first(bool blue)
Get first chip for blue or red arm.
enum uves_chip uves_chip_get_next(enum uves_chip chip)
Get next chip.
int uves_correct_badpix_all(cpl_image *master_bias, uves_propertylist *mbias_header, enum uves_chip chip, int binx, int biny, int mark_bad, bool red_ccd_new)
Correct all bad pixels on a chip.
int main(void)
Test of uves_corrbadpix.