source: fact/tools/pyscripts/examples/pyfits_h_new_features.py@ 17138

Last change on this file since 17138 was 13336, checked in by neise, 13 years ago
example for the new features of pyfits.h
  • Property svn:executable set to *
File size: 727 bytes
Line 
1#!/usr/bin/python -i
2from ROOT import gSystem
3gSystem.Load('pyfits2_h.so')
4from ROOT import *
5
6f = fits('20120304_018.fits.gz')
7#f = fits('20120304_012.drs.fits.gz')
8
9kk=f.GetPy_KeyKeys()
10kv=f.GetPy_KeyValues()
11kc=f.GetPy_KeyComments()
12kt=f.GetPy_KeyTypes()
13
14ck=f.GetPy_ColumnKeys()
15co=f.GetPy_ColumnOffsets()
16cn=f.GetPy_ColumnNums()
17cs=f.GetPy_ColumnSizes()
18ct=f.GetPy_ColumnTypes()
19cu=f.GetPy_ColumnUnits()
20
21print len(kk), len(kv), len(kc), len(kt)
22k=zip(kv,kc,kt)
23k = zip (kk, k)
24k = dict(k)
25
26print len(ck), len(co), len(cn), len(cs), len(ct), len(cu)
27c = zip(co,cn,cs,ct,cu)
28c = zip(ck ,c)
29c = dict(c)
30
31def printk():
32 for i in sorted(k):
33 print i, k[i]
34
35def printc():
36 for i in sorted(c):
37 print i, c[i]
Note: See TracBrowser for help on using the repository browser.