38 #define G_PRJ_X2S "GWcsAIT::prj_x2s(int, int, int, int, double*, double*,"\
39 " double*, double*, int*)"
40 #define G_PRJ_S2X "GWcsAIT::prj_s2x(int, int, int, int, double*, double*,"\
41 " double*, double*, int*)"
90 const double& crval1,
const double& crval2,
91 const double& crpix1,
const double& crpix2,
92 const double& cdelt1,
const double& cdelt2) :
93 GWcs(coords, crval1, crval2, crpix1, crpix2, cdelt1, cdelt2)
229 result.append(
"=== GWcsAIT ===");
317 m_w[1] = 1.0 / (2.0 *
m_w[0]);
353 const double* x,
const double* y,
354 double* phi,
double* theta,
int* stat)
const
357 const double tol = 1.0e-13;
382 const double* xp = x;
384 int rowlen = nx * spt;
385 for (
int ix = 0; ix < nx; ++ix, rowoff += spt, xp += sxy) {
386 double xj = *xp +
m_x0;
387 double s = 1.0 - xj * xj *
m_w[2];
388 double t = xj * m_w[3];
389 double* phip = phi + rowoff;
390 double* thetap = theta + rowoff;
391 for (
int iy = 0; iy < my; ++iy, phip += rowlen, thetap += rowlen) {
398 const double* yp = y;
400 double* thetap = theta;
402 for (
int iy = 0; iy < ny; ++iy, yp += sxy) {
403 double yj = *yp +
m_y0;
404 double yj2 = yj * yj *
m_w[1];
405 for (
int ix = 0; ix < mx; ++ix, phip += spt, thetap += spt) {
411 double s = *phip - yj2;
417 #if defined(G_DEBUG_PRJ)
418 std::cout <<
"prj_x2s(Phi)..:";
419 std::cout <<
" nx=" << nx;
420 std::cout <<
" ny=" << ny;
421 std::cout <<
" ix=" << ix;
422 std::cout <<
" iy=" << iy;
423 std::cout <<
" yp=" << *yp;
424 std::cout <<
" yj=" << yj;
425 std::cout <<
" yj2=" << yj2;
426 std::cout <<
" phip=" << *phip;
427 std::cout <<
" s=" << s;
428 std::cout << std::endl;
434 double x0 = 2.0*z*z - 1.0;
435 double y0 = z*(*thetap);
436 if (x0 == 0.0 && y0 == 0.0) {
444 double t = z*yj/
m_r0;
452 #if defined(G_DEBUG_PRJ)
453 std::cout <<
"prj_x2s(Theta):";
454 std::cout <<
" x0=" << x0;
455 std::cout <<
" y0=" << y0;
456 std::cout <<
" phip=" << *phip;
457 std::cout <<
" z=" << z;
458 std::cout <<
" yj=" << yj;
459 std::cout <<
" m_r0=" <<
m_r0;
460 std::cout <<
" t=" << t;
461 std::cout << std::endl;
464 t = (t < 0) ? -90.0 : 90.0;
511 const double* phi,
const double* theta,
512 double* x,
double* y,
int* stat)
const
537 const double* phip = phi;
539 int rowlen = nphi * sxy;
540 for (
int iphi = 0; iphi < nphi; ++iphi, rowoff += sxy, phip += spt) {
541 double w = (*phip)/2.0;
545 double* xp = x + rowoff;
546 double* yp = y + rowoff;
547 for (
int itheta = 0; itheta < mtheta; ++itheta) {
556 const double* thetap = theta;
560 for (
int itheta = 0; itheta < ntheta; ++itheta, thetap += spt) {
568 for (
int iphi = 0; iphi < mphi; ++iphi, xp += sxy, yp += sxy) {
570 *xp = 2.0 * w * costhe * (*xp) -
m_x0;
571 *yp = w * sinthe -
m_y0;
void init_members(void)
Initialise class members.
Interface definition for the WCS registry class.
void prj_off(const double &phi0, const double &theta0) const
Compute fiducial offset to force (x,y) = (0,0) at (phi0,theta0)
void copy_members(const GWcsAIT &wcs)
Copy class members.
GVector abs(const GVector &vector)
Computes absolute of vector elements.
void free_members(void)
Delete class members.
Aitoff (AIT) projection class definition.
GWcsAIT & operator=(const GWcsAIT &wcs)
Assignment operator.
GWcsAIT(void)
Void constructor.
virtual void clear(void)
Clear instance.
void free_members(void)
Delete class members.
const GWcsAIT g_wcs_ait_seed
World Coordinate Projection registry class interface definition.
void prj_s2x(int nphi, int ntheta, int spt, int sxy, const double *phi, const double *theta, double *x, double *y, int *stat) const
Generic spherical-to-pixel projection.
GVector sqrt(const GVector &vector)
Computes square root of vector elements.
void wcs_set(void) const
Setup of World Coordinate System.
virtual ~GWcsAIT(void)
Destructor.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print WCS information.
void sincosd(const double &angle, double *s, double *c)
Compute sine and cosine of angle in degrees.
virtual GWcs & operator=(const GWcs &wcs)
Assignment operator.
double m_x0
Fiducial x offset.
std::string wcs_print(const GChatter &chatter=NORMAL) const
Print WCS information.
void prj_x2s(int nx, int ny, int sxy, int spt, const double *x, const double *y, double *phi, double *theta, int *stat) const
Pixel-to-spherical deprojection.
void free_members(void)
Delete class members.
std::vector< double > m_w
Intermediate values.
Aitoff (AIT) projection class definition.
void prj_set(void) const
Setup of projection.
Abstract world coordinate system base class.
double m_y0
Fiducial y offset.
double atan2d(const double &y, const double &x)
Compute arc tangens in degrees.
void check_prj_s2x_status(const std::string &origin, const int &status, const int &number)
Checks status of GWcs::prj_s2x method.
void check_prj_x2s_status(const std::string &origin, const int &status, const int &number)
Checks status of GWcs::prj_x2s method.
Exception handler interface definition.
double asind(const double &value)
Compute arc sine in degrees.
bool m_prjset
Projection is set.
void init_members(void)
Initialise class members.
void init_members(void)
Initialise class members.
virtual GWcsAIT * clone(void) const
Clone instance.
double m_r0
Radius of the generating sphere.
Mathematical function definitions.