37 #define G_PRJ_X2S "GWcsCAR::prj_x2s(int, int, int, int, double*, double*,"\
38 " double*, double*, int*)"
86 const double& crval1,
const double& crval2,
87 const double& crpix1,
const double& crpix2,
88 const double& cdelt1,
const double& cdelt2) :
89 GWcs(coords, crval1, crval2, crpix1, crpix2, cdelt1, cdelt2)
224 result.append(
"=== GWcsCAR ===");
308 m_w.push_back(1.0/
m_w[0]);
343 const double* x,
const double* y,
344 double* phi,
double* theta,
int* stat)
const
365 const double* xp = x;
367 int rowlen = nx * spt;
368 for (
int ix = 0; ix < nx; ++ix, rowoff += spt, xp += sxy) {
369 double s =
m_w[1] * (*xp +
m_x0);
370 double* phip = phi + rowoff;
371 for (
int iy = 0; iy < my; ++iy, phip += rowlen) {
377 const double* yp = y;
378 double* thetap = theta;
380 for (
int iy = 0; iy < ny; ++iy, yp += sxy) {
381 double t =
m_w[1] * (*yp +
m_y0);
382 for (
int ix = 0; ix < mx; ++ix, thetap += spt) {
389 int status =
prj_bchk(1.0e-13, nx, my, spt, phi, theta, stat);
423 const double* phi,
const double* theta,
424 double* x,
double* y,
int* stat)
const
445 const double* phip = phi;
447 int rowlen = nphi * sxy;
448 for (
int iphi = 0; iphi < nphi; ++iphi, rowoff += sxy, phip += spt) {
449 double xi =
m_w[0] * (*phip) -
m_x0;
450 double* xp = x + rowoff;
451 for (
int itheta = 0; itheta < mtheta; ++itheta, xp += rowlen) {
458 const double* thetap = theta;
461 for (
int itheta = 0; itheta < ntheta; ++itheta, thetap += spt) {
462 double eta =
m_w[0] * (*thetap) -
m_y0;
463 for (
int iphi = 0; iphi < mphi; ++iphi, yp += sxy) {
void init_members(void)
Initialise class members.
Interface definition for the WCS registry class.
void copy_members(const GWcsCAR &wcs)
Copy class members.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print WCS information.
void prj_off(const double &phi0, const double &theta0) const
Compute fiducial offset to force (x,y) = (0,0) at (phi0,theta0)
virtual GWcsCAR * clone(void) const
Clone instance.
void free_members(void)
Delete class members.
World Coordinate Projection registry class interface definition.
void wcs_set(void) const
Setup of World Coordinate System.
virtual GWcs & operator=(const GWcs &wcs)
Assignment operator.
virtual ~GWcsCAR(void)
Destructor.
void init_members(void)
Initialise class members.
double m_x0
Fiducial x offset.
virtual void clear(void)
Clear instance.
std::string wcs_print(const GChatter &chatter=NORMAL) const
Print WCS information.
void prj_set(void) const
Setup of projection.
Plate carree (CAR) projection class 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-Cartesian projection.
void free_members(void)
Delete class members.
Plate carree (CAR) projection class definition.
std::vector< double > m_w
Intermediate values.
void prj_x2s(int nx, int ny, int sxy, int spt, const double *x, const double *y, double *phi, double *theta, int *stat) const
Cartesian-to-spherical deprojection.
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.
GWcsCAR & operator=(const GWcsCAR &wcs)
Assignment operator.
double m_y0
Fiducial y offset.
GWcsCAR(void)
Void constructor.
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 free_members(void)
Delete class members.
const GWcsCAR g_wcs_car_seed
double m_r0
Radius of the generating sphere.
Mathematical function definitions.