39#include "eris_nix_casu_utils.h"
64 casu_fits *** invar) {
66 if (cpl_error_get_code() != CPL_ERROR_NONE)
return cpl_error_get_code();
67 if (!limlist)
return CPL_ERROR_NONE;
69 cpl_size nimages = limlist->size;
70 *indata = cpl_malloc(nimages *
sizeof(casu_fits *));
71 *inconf = cpl_malloc(nimages *
sizeof(casu_fits *));
72 *invar = cpl_malloc(nimages *
sizeof(casu_fits *));
74 for (
int i = 0; i < (int)nimages; i++) {
75 enu_check(limlist->limages[i]->himage != NULL,
77 "located image has no himage");
86 double* pconf = cpl_image_get_data_double(limlist->limages[i]->confidence);
87 cpl_binary* pbpm_data = cpl_mask_get_data(mask);
88 cpl_binary* pbpm_errs = cpl_mask_get_data(mskerr);
89 for(cpl_size indexj = 0; indexj < sy; indexj++) {
90 for(cpl_size indexi = 0; indexi < sx; indexi++) {
91 if(!isfinite(pdata[indexi+indexj*sx]) ) {
92 pbpm_data[indexi+indexj*sx] = CPL_BINARY_1;
93 pbpm_errs[indexi+indexj*sx] = CPL_BINARY_1;
94 pconf[indexi+indexj*sx] = 0;
103 limlist->limages[i]->himage),
104 CPL_TYPE_FLOAT), NULL,
105 limlist->limages[i]->plist,
106 limlist->limages[i]->plist);
107 (*indata)[i]->fname = cpl_strdup(cpl_frame_get_filename(
108 limlist->limages[i]->frame));
109 (*indata)[i]->nexten = 1;
110 enu_check(limlist->limages[i]->confidence != NULL,
111 CPL_ERROR_NULL_INPUT,
112 "located image has no confidence array");
113 (*inconf)[i] = casu_fits_wrap(cpl_image_cast(
114 limlist->limages[i]->confidence,
115 CPL_TYPE_FLOAT), NULL,
116 limlist->limages[i]->plist, NULL);
117 (*inconf)[i]->fname = cpl_strdup(cpl_frame_get_filename(
118 limlist->limages[i]->frame));
119 (*inconf)[i]->nexten = 4;
121 limlist->limages[i]->himage),
122 CPL_TYPE_FLOAT), NULL,
123 limlist->limages[i]->plist,
124 limlist->limages[i]->plist);
125 (*invar)[i]->fname = cpl_strdup(cpl_frame_get_filename(
126 limlist->limages[i]->frame));
127 (*invar)[i]->nexten = 2;
134 return cpl_error_get_code();;
cpl_error_code encu_limlist_to_casu_fits(located_imagelist *limlist, casu_fits ***indata, casu_fits ***inconf, casu_fits ***invar)
Translate a located_imagelist to arrays of casu_fits structs.
cpl_image * hdrl_image_get_error(hdrl_image *himg)
get error as cpl image
cpl_size hdrl_image_get_size_y(const hdrl_image *self)
return size of Y dimension of image
cpl_size hdrl_image_get_size_x(const hdrl_image *self)
return size of X dimension of image
cpl_image * hdrl_image_get_image(hdrl_image *himg)
get data as cpl image