38 #define G_PRJ_X2S "GWcsARC::prj_x2s(int, int, int, int, double*, double*,"\
39 " double*, double*, int*)"
40 #define G_PRJ_S2X "GWcsARC::prj_s2x(int, int, int, int, double*, double*,"\
41 " double*, double*, int*)"
89 const double& crval1,
const double& crval2,
90 const double& crpix1,
const double& crpix2,
91 const double& cdelt1,
const double& cdelt2) :
92 GWcs(coords, crval1, crval2, crpix1, crpix2, cdelt1, cdelt2)
228 result.append(
"=== GWcsARC ===");
347 const double* x,
const double* y,
348 double* phi,
double* theta,
int* stat)
const
369 const double* xp = x;
371 int rowlen = nx * spt;
372 for (
int ix = 0; ix < nx; ++ix, rowoff += spt, xp += sxy) {
373 double xj = *xp +
m_x0;
374 double* phip = phi + rowoff;
375 for (
int iy = 0; iy < my; ++iy, phip += rowlen) {
381 const double* yp = y;
383 double* thetap = theta;
385 for (
int iy = 0; iy < ny; ++iy, yp += sxy) {
386 double yj = *yp +
m_y0;
387 double yj2 = yj * yj;
388 for (
int ix = 0; ix < mx; ++ix, phip += spt, thetap += spt) {
397 *thetap = 90.0 - r *
m_w[1];
404 int status =
prj_bchk(1.0e-13, nx, my, spt, phi, theta, stat);
438 const double* phi,
const double* theta,
439 double* x,
double* y,
int* stat)
const
464 const double* phip = phi;
466 int rowlen = nphi * sxy;
467 for (
int iphi = 0; iphi < nphi; ++iphi, rowoff += sxy, phip += spt) {
471 double* xp = x + rowoff;
472 double* yp = y + rowoff;
473 for (
int itheta = 0; itheta < mtheta; ++itheta) {
482 const double* thetap = theta;
486 for (
int itheta = 0; itheta < ntheta; ++itheta, thetap += spt) {
489 double r =
m_w[0] * (90.0 - *thetap);
492 for (
int iphi = 0; iphi < mphi; ++iphi, xp += sxy, yp += sxy) {
493 *xp = r * (*xp) -
m_x0;
494 *yp = -r * (*yp) -
m_y0;
GWcsARC(void)
Void constructor.
void init_members(void)
Initialise class members.
Interface definition for the WCS registry class.
Zenithal/azimuthal equidistant (ARC) projection class definition.
void prj_set(void) const
Setup of projection.
void prj_off(const double &phi0, const double &theta0) const
Compute fiducial offset to force (x,y) = (0,0) at (phi0,theta0)
GWcsARC & operator=(const GWcsARC &wcs)
Assignment operator.
Zenithal/azimuthal equidistant (ARC) projection class definition.
virtual ~GWcsARC(void)
Destructor.
void free_members(void)
Delete class members.
virtual void clear(void)
Clear instance.
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.
World Coordinate Projection registry class interface definition.
GVector sqrt(const GVector &vector)
Computes square root of vector elements.
void wcs_set(void) const
Setup of World Coordinate System.
virtual GWcsARC * clone(void) const
Clone instance.
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.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print WCS information.
std::string wcs_print(const GChatter &chatter=NORMAL) const
Print WCS information.
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.
void free_members(void)
Delete class members.
std::vector< double > m_w
Intermediate values.
Abstract world coordinate system base class.
int prj_bchk(const double &tol, const int &nphi, const int &ntheta, const int &spt, double *phi, double *theta, int *stat) const
Performs bounds checking on native spherical coordinates.
double m_y0
Fiducial y offset.
double atan2d(const double &y, const double &x)
Compute arc tangens in degrees.
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.
bool m_prjset
Projection is set.
void init_members(void)
Initialise class members.
void init_members(void)
Initialise class members.
const GWcsARC g_wcs_arc_seed
void free_members(void)
Delete class members.
void copy_members(const GWcsARC &wcs)
Copy class members.
double m_r0
Radius of the generating sphere.
Mathematical function definitions.