Commit 88447c332bf8d2c1b24e97215cc0743e6a0e2c8e
1 parent
2ce711e8
use has() method for checking the presence of columns
Showing
2 changed files
with
5 additions
and
17 deletions
src/ctselect/ctselect.cpp
| @@ -586,34 +586,22 @@ std::string ctselect::check_infile(const std::string& filename) const | @@ -586,34 +586,22 @@ std::string ctselect::check_infile(const std::string& filename) const | ||
| 586 | std::vector<std::string> missing; | 586 | std::vector<std::string> missing; |
| 587 | 587 | ||
| 588 | // Check for existence of TIME column | 588 | // Check for existence of TIME column |
| 589 | - try { | ||
| 590 | - GFitsTableCol* col = table->column("TIME"); | ||
| 591 | - } | ||
| 592 | - catch (GException::fits_column_not_found& e) { | 589 | + if (!table->has("TIME")) { |
| 593 | missing.push_back("TIME"); | 590 | missing.push_back("TIME"); |
| 594 | } | 591 | } |
| 595 | 592 | ||
| 596 | // Check for existence of ENERGY column | 593 | // Check for existence of ENERGY column |
| 597 | - try { | ||
| 598 | - GFitsTableCol* col = table->column("ENERGY"); | ||
| 599 | - } | ||
| 600 | - catch (GException::fits_column_not_found& e) { | 594 | + if (!table->has("ENERGY")) { |
| 601 | missing.push_back("ENERGY"); | 595 | missing.push_back("ENERGY"); |
| 602 | } | 596 | } |
| 603 | 597 | ||
| 604 | // Check for existence of RA column | 598 | // Check for existence of RA column |
| 605 | - try { | ||
| 606 | - GFitsTableCol* col = table->column("RA"); | ||
| 607 | - } | ||
| 608 | - catch (GException::fits_column_not_found& e) { | 599 | + if (!table->has("RA")) { |
| 609 | missing.push_back("RA"); | 600 | missing.push_back("RA"); |
| 610 | } | 601 | } |
| 611 | 602 | ||
| 612 | // Check for existence of DEC column | 603 | // Check for existence of DEC column |
| 613 | - try { | ||
| 614 | - GFitsTableCol* col = table->column("DEC"); | ||
| 615 | - } | ||
| 616 | - catch (GException::fits_column_not_found& e) { | 604 | + if (!table->has("DEC")) { |
| 617 | missing.push_back("DEC"); | 605 | missing.push_back("DEC"); |
| 618 | } | 606 | } |
| 619 | 607 |
src/ctselect/ctselect.hpp
| @@ -33,7 +33,7 @@ | @@ -33,7 +33,7 @@ | ||
| 33 | 33 | ||
| 34 | /* __Definitions _________________________________________________________ */ | 34 | /* __Definitions _________________________________________________________ */ |
| 35 | #define CTSELECT_NAME "ctselect" | 35 | #define CTSELECT_NAME "ctselect" |
| 36 | -#define CTSELECT_VERSION "00-02-02" | 36 | +#define CTSELECT_VERSION "00-02-03" |
| 37 | 37 | ||
| 38 | 38 | ||
| 39 | /***********************************************************************//** | 39 | /***********************************************************************//** |