Commit 2ef54a55a10c1c2a56fe36fd7ca9ec685e4ae1a3

Authored by Jürgen Knödlseder
1 parent 585d6676

GCaldb::filename selection method is now case insensitive.

The method converts the selection strings to upper case before comparison.
inst/cta/src/GCTAResponse.cpp
... ... @@ -527,7 +527,7 @@ void GCTAResponse::load(const std::string& rspname)
527 527 m_caldb = caldb;
528 528  
529 529 // First attempt reading the response using the GCaldb interface
530   - std::string expr = "NAME("+gammalib::toupper(rspname)+")";
  530 + std::string expr = "NAME("+rspname+")";
531 531 std::string aeffname = m_caldb.filename("","","EFF_AREA","","",expr);
532 532 std::string psfname = m_caldb.filename("","","RPSF","","",expr);
533 533 std::string edispname = m_caldb.filename("","","EDISP","","",expr);
... ...
src/obs/GCaldb.cpp
... ... @@ -387,7 +387,8 @@ std::string GCaldb::filename(const std::string& detector,
387 387 // Check for detector
388 388 if (detector.length() > 0) {
389 389 const GFitsTableCol* column = (*m_cif)["DETNAM"];
390   - if (detector == column->string(i)) {
  390 + if (gammalib::toupper(detector) ==
  391 + gammalib::toupper(column->string(i))) {
391 392 match_detector = true;
392 393 }
393 394 }
... ... @@ -398,7 +399,8 @@ std::string GCaldb::filename(const std::string& detector,
398 399 // Check for filter
399 400 if (filter.length() > 0) {
400 401 const GFitsTableCol* column = (*m_cif)["FILTER"];
401   - if (filter == column->string(i)) {
  402 + if (gammalib::toupper(filter) ==
  403 + gammalib::toupper(column->string(i))) {
402 404 match_filter = true;
403 405 }
404 406 }
... ... @@ -409,7 +411,8 @@ std::string GCaldb::filename(const std::string& detector,
409 411 // Check for code name
410 412 if (codename.length() > 0) {
411 413 const GFitsTableCol* column = (*m_cif)["CAL_CNAM"];
412   - if (codename == column->string(i)) {
  414 + if (gammalib::toupper(codename) ==
  415 + gammalib::toupper(column->string(i))) {
413 416 match_codename = true;
414 417 }
415 418 }
... ... @@ -420,7 +423,8 @@ std::string GCaldb::filename(const std::string& detector,
420 423 // Check for date
421 424 if (date.length() > 0) {
422 425 const GFitsTableCol* column = (*m_cif)["CAL_VSD"];
423   - if (date == column->string(i)) {
  426 + if (gammalib::toupper(date) ==
  427 + gammalib::toupper(column->string(i))) {
424 428 match_date = true;
425 429 }
426 430 }
... ... @@ -431,7 +435,8 @@ std::string GCaldb::filename(const std::string& detector,
431 435 // Check for time
432 436 if (time.length() > 0) {
433 437 const GFitsTableCol* column = (*m_cif)["CAL_VST"];
434   - if (time == column->string(i)) {
  438 + if (gammalib::toupper(time) ==
  439 + gammalib::toupper(column->string(i))) {
435 440 match_time = true;
436 441 }
437 442 }
... ... @@ -444,7 +449,8 @@ std::string GCaldb::filename(const std::string& detector,
444 449 const GFitsTableCol* column = (*m_cif)["CAL_CBD"];
445 450 int num_columns = column->elements(i);
446 451 for (int k = 0; k < num_columns; ++k) {
447   - if (expr == column->string(i,k)) {
  452 + if (gammalib::toupper(expr) ==
  453 + gammalib::toupper(column->string(i,k))) {
448 454 match_expr = true;
449 455 break;
450 456 }
... ...