Example #1
0
 // INVERSE(s_healpix_inverse)  sphere
 // Project coordinates from cartesian (x, y) to geographic (lon, lat)
 inline void inv(T const& xy_x, T const& xy_y, T& lp_lon, T& lp_lat) const
 {
     /* Check whether (x, y) lies in the HEALPix image */
     if (in_image(xy_x, xy_y, 0, 0, 0) == 0) {
         lp_lon = HUGE_VAL;
         lp_lat = HUGE_VAL;
         BOOST_THROW_EXCEPTION( projection_exception(error_invalid_x_or_y) );
     }
     return healpix_sphere_inverse(xy_x, xy_y, lp_lon, lp_lat);
 }
Example #2
0
 // INVERSE(s_rhealpix_inverse)  sphere
 // Project coordinates from cartesian (x, y) to geographic (lon, lat)
 inline void inv(T xy_x, T xy_y, T& lp_lon, T& lp_lat) const
 {
     /* Check whether (x, y) lies in the rHEALPix image. */
     if (in_image(xy_x, xy_y, 1, this->m_proj_parm.north_square, this->m_proj_parm.south_square) == 0) {
         lp_lon = HUGE_VAL;
         lp_lat = HUGE_VAL;
         BOOST_THROW_EXCEPTION( projection_exception(error_invalid_x_or_y) );
     }
     combine_caps(xy_x, xy_y, this->m_proj_parm.north_square, this->m_proj_parm.south_square, 1);
     return healpix_sphere_inverse(xy_x, xy_y, lp_lon, lp_lat);
 }
Example #3
0
 // INVERSE(e_healpix_inverse)  ellipsoid
 // Project coordinates from cartesian (x, y) to geographic (lon, lat)
 inline void inv(T const& xy_x, T const& xy_y, T& lp_lon, T& lp_lat) const
 {
     /* Check whether (x, y) lies in the HEALPix image. */
     if (in_image(xy_x, xy_y, 0, 0, 0) == 0) {
         lp_lon = HUGE_VAL;
         lp_lat = HUGE_VAL;
         BOOST_THROW_EXCEPTION( projection_exception(error_invalid_x_or_y) );
     }
     healpix_sphere_inverse(xy_x, xy_y, lp_lon, lp_lat);
     lp_lat = auth_lat(this->params(), m_proj_parm, lp_lat, 1);
 }
Example #4
0
static LP s_healpix_inverse(XY xy, PJ *P) { /* sphere */
    LP lp = {0.0,0.0};

    /* Check whether (x, y) lies in the HEALPix image */
    if (in_image(xy.x, xy.y, 0, 0, 0) == 0) {
        lp.lam = HUGE_VAL;
        lp.phi = HUGE_VAL;
        pj_ctx_set_errno(P->ctx, -15);
        return lp;
    }
    return healpix_sphere_inverse(xy);
}
Example #5
0
static LP s_rhealpix_inverse(XY xy, PJ *P) { /* sphere */
    struct pj_opaque *Q = P->opaque;
    LP lp = {0.0,0.0};

    /* Check whether (x, y) lies in the rHEALPix image. */
    if (in_image(xy.x, xy.y, 1, Q->north_square, Q->south_square) == 0) {
        lp.lam = HUGE_VAL;
        lp.phi = HUGE_VAL;
        pj_ctx_set_errno(P->ctx, -15);
        return lp;
    }
    xy = combine_caps(xy.x, xy.y, Q->north_square, Q->south_square, 1);
    return healpix_sphere_inverse(xy);
}
Example #6
0
static LP e_healpix_inverse(XY xy, PJ *P) { /* ellipsoid */
    LP lp = {0.0,0.0};

    /* Check whether (x, y) lies in the HEALPix image. */
    if (in_image(xy.x, xy.y, 0, 0, 0) == 0) {
        lp.lam = HUGE_VAL;
        lp.phi = HUGE_VAL;
        pj_ctx_set_errno(P->ctx, -15);
        return lp;
    }
    lp = healpix_sphere_inverse(xy);
    lp.phi = auth_lat(P, lp.phi, 1);
    return lp;
}