Commit 875d39a1bc1560b63e0529bf65bdd8b648e3b158
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,7 +342,7 @@ GFitsData* GFitsHDU::data(void) const | ||
| 342 | { | 342 | { |
| 343 | // If no header pointer is available then throw exception | 343 | // If no header pointer is available then throw exception |
| 344 | if (m_data == NULL) | 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 | // Return data pointer | 347 | // Return data pointer |
| 348 | return m_data; | 348 | return m_data; |
| @@ -413,7 +413,7 @@ GFitsTableCol* GFitsHDU::column(const std::string& colname) const | @@ -413,7 +413,7 @@ GFitsTableCol* GFitsHDU::column(const std::string& colname) const | ||
| 413 | /***********************************************************************//** | 413 | /***********************************************************************//** |
| 414 | * @brief Return pointer to column of table | 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 | * If this method is called for an image a 'fits_HDU_not_a_table' exception | 418 | * If this method is called for an image a 'fits_HDU_not_a_table' exception |
| 419 | * will be thrown. | 419 | * will be thrown. |
| @@ -486,7 +486,7 @@ void GFitsHDU::init_members(void) | @@ -486,7 +486,7 @@ void GFitsHDU::init_members(void) | ||
| 486 | // Initialise members | 486 | // Initialise members |
| 487 | m_fitsfile.HDUposition = 0; | 487 | m_fitsfile.HDUposition = 0; |
| 488 | m_fitsfile.Fptr = NULL; | 488 | m_fitsfile.Fptr = NULL; |
| 489 | - m_hdunum = 1; | 489 | + m_hdunum = 0; |
| 490 | m_name.clear(); | 490 | m_name.clear(); |
| 491 | m_type = 0; | 491 | m_type = 0; |
| 492 | m_header = NULL; | 492 | m_header = NULL; |
| @@ -550,7 +550,7 @@ void GFitsHDU::connect(__fitsfile* fptr) | @@ -550,7 +550,7 @@ void GFitsHDU::connect(__fitsfile* fptr) | ||
| 550 | { | 550 | { |
| 551 | // First connect HDU | 551 | // First connect HDU |
| 552 | m_fitsfile = *fptr; | 552 | m_fitsfile = *fptr; |
| 553 | - m_hdunum = m_fitsfile.HDUposition + 1; | 553 | + m_hdunum = m_fitsfile.HDUposition; |
| 554 | 554 | ||
| 555 | // Then connect data | 555 | // Then connect data |
| 556 | if (m_data != NULL) m_data->connect(fptr); | 556 | if (m_data != NULL) m_data->connect(fptr); |
| @@ -621,7 +621,7 @@ GFitsImage* GFitsHDU::new_image(void) | @@ -621,7 +621,7 @@ GFitsImage* GFitsHDU::new_image(void) | ||
| 621 | * @brief Open HDU | 621 | * @brief Open HDU |
| 622 | * | 622 | * |
| 623 | * @param[in] fptr FITS file pointer | 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 | * Opens an (existing) HDU in the FITS file. This method does NOT create any | 626 | * Opens an (existing) HDU in the FITS file. This method does NOT create any |
| 627 | * HDU if it does not exist. Opening consists of fetching all header cards | 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,7 +637,7 @@ void GFitsHDU::open(__fitsfile* fptr, int hdunum) | ||
| 637 | throw GException::fits_error(G_OPEN, status); | 637 | throw GException::fits_error(G_OPEN, status); |
| 638 | 638 | ||
| 639 | // Store information. | 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 | m_fitsfile = *fptr; | 641 | m_fitsfile = *fptr; |
| 642 | m_hdunum = hdunum; | 642 | m_hdunum = hdunum; |
| 643 | 643 |