/***********************************************************************//** * @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; }
/***********************************************************************//** * @brief Return number of Psi bins * * @return Number of Psi bins. ***************************************************************************/ inline int GCOMEventCube::npsi(void) const { return (m_map.ny()); }