Commit 875d39a1bc1560b63e0529bf65bdd8b648e3b158

Authored by knodlseder
1 parent a74b1b85

extension and column numbers start from 0

Showing 1 changed file with 6 additions and 6 deletions
src/fits/GFitsHDU.cpp
... ... @@ -342,7 +342,7 @@ GFitsData* GFitsHDU::data(void) const
342 342 {
343 343 // If no header pointer is available then throw exception
344 344 if (m_data == NULL)
345   - throw GException::fits_no_data(G_HEADER, "No data found");
  345 + throw GException::fits_no_data(G_DATA, "No data found");
346 346  
347 347 // Return data pointer
348 348 return m_data;
... ... @@ -413,7 +413,7 @@ GFitsTableCol* GFitsHDU::column(const std::string& colname) const
413 413 /***********************************************************************//**
414 414 * @brief Return pointer to column of table
415 415 *
416   - * @param[in] colnum Number FITS table column to be returned (starting from 1)
  416 + * @param[in] colnum Number FITS table column to be returned (starting from 0)
417 417 *
418 418 * If this method is called for an image a 'fits_HDU_not_a_table' exception
419 419 * will be thrown.
... ... @@ -486,7 +486,7 @@ void GFitsHDU::init_members(void)
486 486 // Initialise members
487 487 m_fitsfile.HDUposition = 0;
488 488 m_fitsfile.Fptr = NULL;
489   - m_hdunum = 1;
  489 + m_hdunum = 0;
490 490 m_name.clear();
491 491 m_type = 0;
492 492 m_header = NULL;
... ... @@ -550,7 +550,7 @@ void GFitsHDU::connect(__fitsfile* fptr)
550 550 {
551 551 // First connect HDU
552 552 m_fitsfile = *fptr;
553   - m_hdunum = m_fitsfile.HDUposition + 1;
  553 + m_hdunum = m_fitsfile.HDUposition;
554 554  
555 555 // Then connect data
556 556 if (m_data != NULL) m_data->connect(fptr);
... ... @@ -621,7 +621,7 @@ GFitsImage* GFitsHDU::new_image(void)
621 621 * @brief Open HDU
622 622 *
623 623 * @param[in] fptr FITS file pointer
624   - * @param[in] hdunum Number of HDU (starting from 1)
  624 + * @param[in] hdunum Number of HDU (starting from 0)
625 625 *
626 626 * Opens an (existing) HDU in the FITS file. This method does NOT create any
627 627 * HDU if it does not exist. Opening consists of fetching all header cards
... ... @@ -637,7 +637,7 @@ void GFitsHDU::open(__fitsfile* fptr, int hdunum)
637 637 throw GException::fits_error(G_OPEN, status);
638 638  
639 639 // Store information.
640   - // Note that the HDU number - 1 is stored in m_fitsfile->HDUposition !!!
  640 + // Note that the HDU number is stored in m_fitsfile->HDUposition !!!
641 641 m_fitsfile = *fptr;
642 642 m_hdunum = hdunum;
643 643  
... ...