* Supplies the FITS image label corresponding to the given index. Zero * returns the first label that precedes actual image data. Extra labels that * have no data can be accessed by calling extraFitsLabel(). * * @see extraFitsLabel() * * @param labelNumber The index to the FITS header image label. * * @return PvlGroup version of a FITS label corresponding to reques
| 257 | * @return PvlGroup version of a FITS label corresponding to requested label number. |
| 258 | */ |
| 259 | PvlGroup ProcessImportFits::fitsImageLabel(int labelNumber) const { |
| 260 | |
| 261 | if (labelNumber >= m_fitsImageLabels->size()) { |
| 262 | QString msg = QObject::tr("The requested label number [%1], from file [%2] is " |
| 263 | "past the last image group found in this FITS file. " |
| 264 | "Image label count is [%3]").arg(labelNumber). |
| 265 | arg(m_name.expanded()).arg(m_fitsImageLabels->size()-1); |
| 266 | throw IException(IException::User, msg, _FILEINFO_); |
| 267 | } |
| 268 | |
| 269 | if (!m_fitsImageLabels) { |
| 270 | QString msg = QObject::tr("The FITS label has not been initialized, " |
| 271 | "call setFitsFile first."); |
| 272 | throw IException(IException::Programmer, msg, _FILEINFO_); |
| 273 | } |
| 274 | else if (m_fitsImageLabels->size() < labelNumber) { |
| 275 | QString msg = QObject::tr("The requested FITS label number " |
| 276 | "was not found in file [%1].").arg(m_name.toString()); |
| 277 | throw IException(IException::Programmer, msg, _FILEINFO_); |
| 278 | } |
| 279 | |
| 280 | return *(*m_fitsImageLabels)[labelNumber]; |
| 281 | } |
| 282 | |
| 283 | |
| 284 | /** |
no test coverage detected