version 1.2, 2011/08/16 02:29:10
|
version 1.3, 2011/11/11 08:44:05
|
Line 333 int imageinterp( |
|
Line 333 int imageinterp( |
|
double P, /* angle between CCD y-axis and solar vertical */ | double P, /* angle between CCD y-axis and solar vertical */ |
/* positive to the east (CCW) */ | /* positive to the east (CCW) */ |
double rsun, /* pixels */ | double rsun, /* pixels */ |
|
double Rmax, /* maximum disk radius to use (e.g. 0.95) */ |
|
int NaN_beyond_rmax, |
int interpolation, /* option */ | int interpolation, /* option */ |
int cols, /* width of output array */ | int cols, /* width of output array */ |
int rows, /* height of output array */ | int rows, /* height of output array */ |
Line 345 int imageinterp( |
|
Line 346 int imageinterp( |
|
double x, y; /* CCD location of desired point */ | double x, y; /* CCD location of desired point */ |
int row, col; /* index into output array */ | int row, col; /* index into output array */ |
int rowoffset; | int rowoffset; |
double xratio, yratio; |
double xratio, yratio, Rmax2; |
| |
long i; | long i; |
double *vdp; | double *vdp; |
Line 358 int imageinterp( |
|
Line 359 int imageinterp( |
|
vp=V; | vp=V; |
for (i=0;i<xpixels*ypixels;i++) *vdp++=(double)*vp++; | for (i=0;i<xpixels*ypixels;i++) *vdp++=(double)*vp++; |
| |
|
Rmax2 = Rmax*Rmax*rsun*rsun; |
|
|
if (cols > kMaxCols) | if (cols > kMaxCols) |
{ | { |
return kLIBASTRO_DimensionMismatch; | return kLIBASTRO_DimensionMismatch; |
Line 378 int imageinterp( |
|
Line 381 int imageinterp( |
|
| |
for (col = 0; col < cols; col++) { | for (col = 0; col < cols; col++) { |
| |
xtmp=col*xratio - x0; |
xtmp = (col + 0.5)*xratio - 0.5 - x0; |
ytmp=row*yratio - y0; |
ytmp = (row + 0.5)*yratio - 0.5 - y0; |
x= x0 + xtmp*cos(P) + ytmp*sin(P); |
if ((xtmp*xtmp + ytmp*ytmp) >= Rmax2) |
y= y0 - xtmp*sin(P) + ytmp*cos(P); |
{ |
|
*(U + rowoffset + col) = (NaN_beyond_rmax) ? DRMS_MISSING_FLOAT : (float)0.0; |
|
continue; |
|
} |
|
x= x0 + xtmp*cos(P) - ytmp*sin(P); |
|
y= y0 + xtmp*sin(P) + ytmp*cos(P); |
| |
Distort(x, y, rsun, +1, &x, &y, distpars); | Distort(x, y, rsun, +1, &x, &y, distpars); |
| |