Exemplo n.º 1
0
/***********************************************************************//**
 * @brief Setup of projection
 *
 * This method sets up the projection information. The method has been
 * adapted from the wcslib function prj.c::sflset.
 *
 *   Given and/or returned:
 *      m_r0      Reset to 180/pi if 0.
 *      m_phi0    Reset to 0.0 if undefined.
 *      m_theta0  Reset to 0.0 if undefined.
 *
 *   Returned:
 *      m_x0      Fiducial offset in x.
 *      m_y0      Fiducial offset in y.
 *      m_w[0]    r0*(pi/180)
 *      m_w[1]    (180/pi)/r0
 ***************************************************************************/
void GWcsSFL::prj_set(void) const
{
    // Signal that projection has been set (needs to be done before calling
    // the prj_off() method to avoid an endless loop)
    m_prjset = true;

    // Initialise projection parameters
    m_w.assign(2, 0.0);
    
    // Precompute
    if (m_r0 == 0.0) {
        m_r0 = gammalib::rad2deg;
        m_w[0] = 1.0;
        m_w[1] = 1.0;
    }
    else {
        m_w[0] = m_r0 * gammalib::deg2rad;
        m_w[1] = 1.0 / m_w[0];
    }

    // Compute fiducial offset
    prj_off(0.0, 0.0);
    
    // Return
    return;
}
Exemplo n.º 2
0
/***********************************************************************//**
 * @brief Setup of projection
 *
 * This method sets up the projection information. The method has been
 * adapted from the wcslib function prj.c::merset.
 *
 *   Given and/or returned:
 *      m_r0      Reset to 180/pi if 0.
 *      m_phi0    Reset to 0.0 if undefined.
 *      m_theta0  Reset to 0.0 if undefined.
 *
 *   Returned:
 *      m_x0      Fiducial offset in x.
 *      m_y0      Fiducial offset in y.
 *      m_w[0]    r0*(pi/180)
 *      m_w[1]    (180/pi)/r0
 ***************************************************************************/
void GWcsMER::prj_set(void) const
{
    // Initialise projection parameters
    m_w.clear();
    
    // Precompute 
    if (m_r0 == 0.0) {
        m_r0 = gammalib::rad2deg;
        m_w.push_back(1.0);
        m_w.push_back(1.0);
    } 
    else {
        m_w.push_back(m_r0 * gammalib::deg2rad);
        m_w.push_back(1.0/m_w[0]);
    }
    
    // Compute fiducial offset
    prj_off(0.0, 0.0);
    
    // Signal that projection has been set
    m_prjset = true;
    
    // Return
    return;
}
Exemplo n.º 3
0
/***********************************************************************//**
 * @brief Setup of projection
 *
 * This method sets up the projection information. The method has been
 * adapted from the wcslib function prj.c::molset (version 4.20).
 *
 *   Given and/or returned:
 *      m_r0      Reset to 180/pi if 0.
 *      m_phi0    Reset to  0.0 if undefined.
 *      m_theta0  Reset to  0.0 if undefined.
 *
 *   Returned:
 *      m_x0      Fiducial offset in x.
 *      m_y0      Fiducial offset in y.
 *      m_w[0]    sqrt(2)*r0
 *      m_w[1]    sqrt(2)*r0/90
 *      m_w[2]    1/(sqrt(2)*r0)
 *      m_w[3]    90/r0
 *      m_w[4]    2/pi
 ***************************************************************************/
void GWcsMOL::prj_set(void) const
{
    // Initialise projection parameters
    m_w.assign(5, 0.0);
    
    // Set undefined parameters
    if (m_r0 == 0.0) {
        m_r0 = gammalib::rad2deg;
    }
    
    // Precompute 
    m_w[0] = gammalib::sqrt_two * m_r0;
    m_w[1] = m_w[0]/90.0;
    m_w[2] = 1.0/m_w[0];
    m_w[3] = 90.0/m_r0;
    m_w[4] = 2.0/gammalib::pi;
    
    // Compute fiducial offset
    prj_off(0.0, 0.0);
    
    // Signal that projection has been set
    m_prjset = true;
    
    // Return
    return;
}
Exemplo n.º 4
0
/***********************************************************************//**
 * @brief Setup of projection
 *
 * This method sets up the projection information. The method has been
 * adapted from the wcslib function prj.c::carset.
 *
 *   Given and/or returned:
 *      m_r0      Reset to 180/pi if 0.
 *      m_phi0    Reset to  0.0 if undefined.
 *      m_theta0  Reset to 90.0 if undefined.
 *
 *   Returned:
 *      m_x0      Fiducial offset in x.
 *      m_y0      Fiducial offset in y.
 *      m_w[0]    2*r0
 *      m_w[1]    1/(2*r0)
 ***************************************************************************/
void GWcsSTG::prj_set(void) const
{
    // Initialise projection parameters
    m_w.clear();
    
    // Precompute 
    if (m_r0 == 0.0)
        m_r0 = rad2deg;
    m_w.push_back(2.0 * m_r0);
    m_w.push_back(1.0/m_w[0]);
    
    // Compute fiducial offset
    prj_off(0.0, 90.0);
    
    // Signal that projection has been set
    m_prjset = true;
    
    // Return
    return;
}
Exemplo n.º 5
0
/***********************************************************************//**
 * @brief Setup of projection
 *
 * This method sets up the projection information. The method has been
 * adapted from the wcslib function prj.c::tanset.
 *
 *   Given and/or returned:
 *      m_r0      Reset to 180/pi if 0.
 *      m_phi0    Reset to  0.0 if undefined.
 *      m_theta0  Reset to 90.0 if undefined.
 *
 *   Returned:
 *      m_x0      Fiducial offset in x.
 *      m_y0      Fiducial offset in y.
 ***************************************************************************/
void GWcsTAN::prj_set(void) const
{
    // Signal that projection has been set (needs to be done before calling
    // the prj_off() method to avoid an endless loop)
    m_prjset = true;

    // Initialise projection parameters
    m_w.clear();
    
    // Precompute 
    if (m_r0 == 0.0) {
        m_r0 = gammalib::rad2deg;
    }
    
    // Compute fiducial offset
    prj_off(0.0, 90.0);
    
    // Return
    return;
}