37 #define G_PRJ_X2S "GWcsSFL::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)
223 result.append(
"=== GWcsSFL ===");
342 const double* x,
const double* y,
343 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 s =
m_w[1] * (*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;
397 #if defined(G_DEBUG_PRJ)
398 std::cout <<
"prj_x2s(Phi)..:";
399 std::cout <<
" nx=" << nx;
400 std::cout <<
" ny=" << ny;
401 std::cout <<
" ix=" << ix;
402 std::cout <<
" iy=" << iy;
403 std::cout <<
" yp=" << *yp;
404 std::cout <<
" yj=" << yj;
405 std::cout <<
" phip=" << *phip;
406 std::cout <<
" s=" << s;
407 std::cout << std::endl;
415 double t =
m_w[1] * yj;
418 for (
int ix = 0; ix < mx; ++ix, phip += spt, thetap += spt) {
430 status =
prj_bchk(1.0e-12, nx, my, spt, phi, theta, stat);
464 const double* phi,
const double* theta,
465 double* x,
double* y,
int* stat)
const
486 const double* phip = phi;
488 int rowlen = nphi * sxy;
489 for (
int iphi = 0; iphi < nphi; ++iphi, rowoff += sxy, phip += spt) {
490 double xi =
m_w[0] * (*phip);
491 double* xp = x + rowoff;
492 for (
int itheta = 0; itheta < mtheta; ++itheta, xp += rowlen) {
498 const double* thetap = theta;
502 for (
int itheta = 0; itheta < ntheta; ++itheta, thetap += spt) {
504 double eta =
m_w[0] * (*thetap) -
m_y0;
505 for (
int iphi = 0; iphi < mphi; ++iphi, xp += sxy, yp += sxy) {
506 *xp = xi * (*xp) -
m_x0;
void init_members(void)
Initialise class members.
Interface definition for the WCS registry class.
void init_members(void)
Initialise class members.
Sanson-Flamsteed (SFL) projection class definition.
void prj_off(const double &phi0, const double &theta0) const
Compute fiducial offset to force (x,y) = (0,0) at (phi0,theta0)
GWcsSFL(void)
Void constructor.
GVector cos(const GVector &vector)
Computes cosine of vector elements.
virtual ~GWcsSFL(void)
Destructor.
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_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.
Sanson-Flamsteed (SFL) projection class definition.
World Coordinate Projection registry class interface definition.
void wcs_set(void) const
Setup of World Coordinate System.
virtual GWcsSFL * clone(void) const
Clone Sanson-Flamsteed projection.
virtual GWcs & operator=(const GWcs &wcs)
Assignment operator.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print Sanson-Flamsteed projection information.
double m_x0
Fiducial x offset.
std::string wcs_print(const GChatter &chatter=NORMAL) const
Print WCS information.
virtual void clear(void)
Clear Sanson-Flamsteed projection.
GWcsSFL & operator=(const GWcsSFL &wcs)
Assignment operator.
void free_members(void)
Delete class members.
std::vector< double > m_w
Intermediate values.
const GWcsSFL g_wcs_sfl_seed
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 cosd(const double &angle)
Compute cosine of angle in degrees.
void prj_set(void) const
Setup of projection.
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 copy_members(const GWcsSFL &wcs)
Copy class members.
void free_members(void)
Delete class members.
double m_r0
Radius of the generating sphere.
Mathematical function definitions.