37 #define G_PRJ_X2S "GWcsMER::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(
"=== GWcsMER ===");
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) {
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
449 const double* phip = phi;
451 int rowlen = nphi * sxy;
452 for (
int iphi = 0; iphi < nphi; ++iphi, rowoff += sxy, phip += spt) {
453 double xi =
m_w[0] * (*phip) -
m_x0;
454 double* xp = x + rowoff;
455 for (
int itheta = 0; itheta < mtheta; ++itheta, xp += rowlen) {
462 const double* thetap = theta;
465 for (
int itheta = 0; itheta < ntheta; ++itheta, thetap += spt) {
468 if (*thetap <= -90.0 || *thetap >= 90.0) {
476 for (
int iphi = 0; iphi < mphi; ++iphi, yp += sxy) {
double tand(const double &angle)
Compute tangens of angle in degrees.
void init_members(void)
Initialise class members.
Mercator's (MER) projection class definition.
Interface definition for the WCS registry class.
GWcsMER(void)
Void constructor.
GWcsMER & operator=(const GWcsMER &wcs)
Assignment operator.
void prj_off(const double &phi0, const double &theta0) const
Compute fiducial offset to force (x,y) = (0,0) at (phi0,theta0)
virtual GWcsMER * clone(void) const
Clone Mercator's projection.
void init_members(void)
Initialise class members.
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.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print WCS information.
void free_members(void)
Delete class members.
const GWcsMER g_wcs_mer_seed
World Coordinate Projection registry class interface definition.
double atand(const double &value)
Compute arc tangens in degrees.
void copy_members(const GWcsMER &wcs)
Copy class members.
void wcs_set(void) const
Setup of World Coordinate System.
GVector log(const GVector &vector)
Computes natural logarithm of vector elements.
virtual GWcs & operator=(const GWcs &wcs)
Assignment operator.
double m_x0
Fiducial x offset.
virtual void clear(void)
Clear Mercator's projection.
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 prj_set(void) const
Setup of 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.
virtual ~GWcsMER(void)
Destructor.
double m_y0
Fiducial y offset.
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.
GVector exp(const GVector &vector)
Computes exponential of vector elements.
void free_members(void)
Delete class members.
Mercator's (MER) projection class definition.
double m_r0
Radius of the generating sphere.
Mathematical function definitions.