Commit 4d8c2812946e26d6ff9b26c1b744fe79571702ea

Authored by knodlseder
1 parent 99ced245

use hascolumn() instead of has()

Showing 1 changed file with 9 additions and 7 deletions
scripts/cta_root2caldb.py
... ... @@ -452,7 +452,7 @@ class caldb():
452 452 # calls of this method
453 453 #
454 454 # ENERG_LO
455   - if not hdu.has("ENERG_LO"):
  455 + if not hdu.hascolumn("ENERG_LO"):
456 456 hdu.append_column(GFitsTableFloatCol("ENERG_LO", 1, neng))
457 457 hdu["ENERG_LO"].unit("TeV")
458 458 for ieng in range(neng):
... ... @@ -460,7 +460,7 @@ class caldb():
460 460 hdu["ENERG_LO"][0,ieng] = e_lo
461 461 #
462 462 # ENERG_HI
463   - if not hdu.has("ENERG_HI"):
  463 + if not hdu.hascolumn("ENERG_HI"):
464 464 hdu.append_column(GFitsTableFloatCol("ENERG_HI", 1, neng))
465 465 hdu["ENERG_HI"].unit("TeV")
466 466 for ieng in range(neng):
... ... @@ -468,7 +468,7 @@ class caldb():
468 468 hdu["ENERG_HI"][0,ieng] = e_hi
469 469 #
470 470 # THETA_LO
471   - if not hdu.has("THETA_LO"):
  471 + if not hdu.hascolumn("THETA_LO"):
472 472 hdu.append_column(GFitsTableFloatCol("THETA_LO", 1, noffset))
473 473 hdu["THETA_LO"].unit("deg")
474 474 for ioff in range(noffset):
... ... @@ -477,7 +477,7 @@ class caldb():
477 477  
478 478 #
479 479 # THETA_LO
480   - if not hdu.has("THETA_HI"):
  480 + if not hdu.hascolumn("THETA_HI"):
481 481 hdu.append_column(GFitsTableFloatCol("THETA_HI", 1, noffset))
482 482 hdu["THETA_HI"].unit("deg")
483 483 for ioff in range(noffset):
... ... @@ -485,7 +485,7 @@ class caldb():
485 485 hdu["THETA_HI"][0,ioff] = o_hi
486 486 #
487 487 # "NAME"
488   - if not hdu.has(name):
  488 + if not hdu.hascolumn(name):
489 489 hdu.append_column(GFitsTableFloatCol(name, 1, neng*noffset))
490 490 hdu[name].unit(unit)
491 491 hdu[name].dim([neng, noffset])
... ... @@ -593,8 +593,10 @@ if __name__ == '__main__':
593 593 CTA response.
594 594 """
595 595 # Set ROOT filename
596   - path = "/Users/jurgen/Documents/Travail/Projects/CTA/WP-MC/root/IFAEOffaxis"
597   - irf = "SubarrayE_offaxis.root"
  596 + #path = "/Users/jurgen/Documents/Travail/Projects/CTA/WP-MC/root/IFAEOffaxis"
  597 + #irf = "SubarrayE_offaxis.root"
  598 + path = "/Users/jurgen/Documents/Travail/Projects/CTA/WP-MC/root/IFAEOffaxisPerformanceBEI_Nov2011"
  599 + irf = "SubarrayE_IFAE_50hours_20111121_offaxis.root"
598 600 filename = path+"/"+irf
599 601  
600 602 # Allocate caldb
... ...