version 1.1, 2009/06/18 20:12:09
|
version 1.3, 2011/11/11 08:44:05
|
Line 328 int imageinterp( |
|
Line 328 int imageinterp( |
|
| |
int xpixels, /* x width of input array */ | int xpixels, /* x width of input array */ |
int ypixels, /* y width of input array */ | int ypixels, /* y width of input array */ |
|
double x0, /* x pixel address of disk center */ |
|
double y0, /* y pixel address of disk center */ |
|
double P, /* angle between CCD y-axis and solar vertical */ |
|
/* 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 341 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; |
float *vp; | float *vp; |
|
double xtmp, ytmp; |
| |
double *VD; | double *VD; |
VD=(double *)(malloc(xpixels*ypixels*sizeof(double))); | VD=(double *)(malloc(xpixels*ypixels*sizeof(double))); |
Line 353 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 373 int imageinterp( |
|
Line 381 int imageinterp( |
|
| |
for (col = 0; col < cols; col++) { | for (col = 0; col < cols; col++) { |
| |
x=col*xratio; |
xtmp = (col + 0.5)*xratio - 0.5 - x0; |
y=row*yratio; |
ytmp = (row + 0.5)*yratio - 0.5 - y0; |
|
if ((xtmp*xtmp + ytmp*ytmp) >= Rmax2) |
|
{ |
|
*(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); |
| |