Replace this call with cpl_image_filter_mask() using CPL_FILTER_STDEV and CPL_BORDER_FILTER.
Member cpl_image_fit_gaussian (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)
If you need a 2D gaussian fit please use the function cpl_fit_image_gaussian(). Please note that on CPL versions earlier than 5.1.0 this function was wrongly documented: the parameters sig_x and sig_y were defined as "the sigma in x (or y) of the gaussian", while actually they returned the semi-major and semi-minor axes of the gaussian distribution at 1-sigma. PLEASE NOTE THAT IF YOU USED THIS FUNCTION FOR DETERMINING THE SPREAD OF A DISTRIBUTION ALONG THE X DIRECTION, THIS WAS VERY LIKELY OVERESTIMATED (because sig_x was always assigned the semi-major axis of the distribution ignoring the rotation), WHILE THE SPREAD ALONG THE Y DIRECTION WOULD BE UNDERESTIMATED. In addition to that, even with circular distributions this function may lead to an underestimation of sig_x and sig_y (up to 25% underestimation in the case of noiseless data with a box 4 times the sigma, 1% underestimation in the case of noiseless data with a box 7 times the sigma). This latter problem is related to the function cpl_image_iqe().