#include #include #include #include "nrutil.h" //y is the input image, nx and ny are the pixels along x and y axis; //yt and residu are the required matrix for the function //para contains the needed parameters: centx=para[3], centy=para[4] void star_gaus(float **y,int nx,int ny,double *para); void main() { int i, j; int IMAGE_WIDTH, IMAGE_HEIGHT; float center_x, center_y; float R, dis; float **Gauss_map; double *para; //double para[10]; IMAGE_WIDTH = 180; IMAGE_HEIGHT = 180; center_x = IMAGE_WIDTH/2 -0.; center_y = IMAGE_HEIGHT/2+0.; R = sqrt(center_x*center_x + center_y*center_y); //Gauss_map = np.zeros((IMAGE_HEIGHT, IMAGE_WIDTH)) Gauss_map = matrix(0, IMAGE_HEIGHT-1, 0, IMAGE_WIDTH-1); para = dvector(0,10); for(i=0; iy[i])ymin=y[i]; } //printf("ymax=%e,imax=%d\n",ymax,imax); kc=ymax;kd=ymax/12.; det=ysigma=kc*exp(-0.5);//printf("det=%e,kc=%e\n",det,kc); for(i=0;i0){ for(j=-4;j<=4;j++){ sigma=sigmac+j*sigmad; if(sigma>0){ sigma2v=-1./(2.*sigma*sigma); for(p=-4;p<=4;p++){ xt=xc+p*xd; for(q=-4;q<=4;q++){ yt=yc+q*yd; k2=0; if(fbg==0){ bg=bg0; for(m=0;m