Exemplo n.º 1
0
/***********************************************************************//**
 * @brief Read LAT source map from HDU.
 *
 * @param[in] hdu Image HDU.
 *
 * @exception GLATException::wcs_incompatible
 *            Source map not compatible with sky map
 *
 * This method reads a LAT source map from a FITS image. The source map is
 * stored in a GSkyMap object and is given in units of counts/pixel/MeV.
 ***************************************************************************/
void GLATEventCube::read_srcmap(const GFitsImage& hdu)
{
    // Allocate skymap
    GSkyMap* map = new GSkyMap;

    // Read skymap
    map->read(hdu);

    // Check that source map sky projection is consistent with counts
    // map sky projection
    if (*(m_map.projection()) != *(map->projection())) {
        throw GLATException::wcs_incompatible(G_READ_SRCMAP, hdu.extname());
    }

    // Check that source map dimension is consistent with counts map
    // dimension
    if (m_map.nx() != map->nx() ||
        m_map.ny() != map->ny()) {
        throw GLATException::wcs_incompatible(G_READ_SRCMAP, hdu.extname());
    }

    // Check that source map has required number of energy bins
    if (m_map.nmaps()+1 != map->nmaps()) {
        throw GLATException::wcs_incompatible(G_READ_SRCMAP, hdu.extname());
    }

    // Append source map to list of maps
    m_srcmap.push_back(map);
    m_srcmap_names.push_back(hdu.extname());

    // Return
    return;
}
Exemplo n.º 2
0
/***********************************************************************//**
 * @brief Return number of pixels
 *
 * @return Number of pixels.
 ***************************************************************************/
inline
int GCOMEventCube::npix(void) const
{
    return (m_map.npix());
}
Exemplo n.º 3
0
/***********************************************************************//**
 * @brief Return number of Psi bins
 *
 * @return Number of Psi bins.
 ***************************************************************************/
inline
int GCOMEventCube::npsi(void) const
{
    return (m_map.ny());
}
Exemplo n.º 4
0
/***********************************************************************//**
 * @brief Return number of Phibar bins
 *
 * @return Number of Phibar bins.
 ***************************************************************************/
inline
int GCOMEventCube::nphi(void) const
{
    return (m_map.nmaps());
}
Exemplo n.º 5
0
/***********************************************************************//**
 * @brief Return number of Chi bins
 *
 * @return Number of Chi bins.
 ***************************************************************************/
inline
int GCOMEventCube::nchi(void) const
{
    return (m_map.nx());
}