55#define MODULE_ID "XSH_STARTUP"
76 if (cpl_error_get_code() != CPL_ERROR_NONE) {
87 cpl_image* img_raw=NULL;
88 cpl_image* img_raw1=NULL;
89 cpl_image* img_noise=NULL;
110 const char* name=
"raw_ima.fits";
114 int xg=(int)(xc+offx);
115 int yg=(int)(yc+offy);
124 check(img_raw=cpl_image_new(sx,sy,CPL_TYPE_FLOAT));
125 check(img_raw1=cpl_image_new(sx,sy,CPL_TYPE_FLOAT));
126 check(img_noise=cpl_image_new(sx,sy,CPL_TYPE_FLOAT));
129 check(cpl_image_fill_gaussian(img_raw,xc,yc,flux,sigx,sigy));
130 check(cpl_image_fill_gaussian(img_raw1,xc1,yc1,flux1,sigx1,sigy1));
131 check(cpl_image_fill_noise_uniform(img_noise,min,
max));
132 check(cpl_image_add(img_raw,img_noise));
133 check(cpl_image_add(img_raw,img_raw1));
135 check(cpl_image_save(img_raw,name,CPL_BPP_IEEE_FLOAT,NULL,CPL_IO_DEFAULT));
140 &sig_x,&sig_y,&fwhm_x,&fwhm_y));
141 xsh_msg(
"xc=%d yc=%d xg=%d yg=%d xcen=%f ycen=%f S/N=%f",
142 xc,yc,xg,yg,xcen,ycen,norm/noise);
int main()
Unit test of xsh_bspline_interpol.
#define xsh_error_dump(level)
cpl_error_code xsh_image_find_barycenter(const cpl_image *im, int xpos, int ypos, int size, double *norm, double *xcen, double *ycen, double *sig_x, double *sig_y, double *fwhm_x, double *fwhm_y)
Apply a gaussian fit on an image sub window.
#define xsh_msg(...)
Print a message on info level.
void xsh_free_image(cpl_image **i)
Deallocate an image and set the pointer to NULL.
#define TESTS_CLEAN_WORKSPACE(DRL_ID)
#define TESTS_INIT_WORKSPACE(DRL_ID)
#define TESTS_INIT(DRL_ID)