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
|
---|
2 | from ROOT import gSystem
|
---|
3 | gSystem.Load('pyfits2_h.so')
|
---|
4 | from ROOT import *
|
---|
5 |
|
---|
6 | f = fits('20120304_018.fits.gz')
|
---|
7 | #f = fits('20120304_012.drs.fits.gz')
|
---|
8 |
|
---|
9 | kk=f.GetPy_KeyKeys()
|
---|
10 | kv=f.GetPy_KeyValues()
|
---|
11 | kc=f.GetPy_KeyComments()
|
---|
12 | kt=f.GetPy_KeyTypes()
|
---|
13 |
|
---|
14 | ck=f.GetPy_ColumnKeys()
|
---|
15 | co=f.GetPy_ColumnOffsets()
|
---|
16 | cn=f.GetPy_ColumnNums()
|
---|
17 | cs=f.GetPy_ColumnSizes()
|
---|
18 | ct=f.GetPy_ColumnTypes()
|
---|
19 | cu=f.GetPy_ColumnUnits()
|
---|
20 |
|
---|
21 | print len(kk), len(kv), len(kc), len(kt)
|
---|
22 | k=zip(kv,kc,kt)
|
---|
23 | k = zip (kk, k)
|
---|
24 | k = dict(k)
|
---|
25 |
|
---|
26 | print len(ck), len(co), len(cn), len(cs), len(ct), len(cu)
|
---|
27 | c = zip(co,cn,cs,ct,cu)
|
---|
28 | c = zip(ck ,c)
|
---|
29 | c = dict(c)
|
---|
30 |
|
---|
31 | def printk():
|
---|
32 | for i in sorted(k):
|
---|
33 | print i, k[i]
|
---|
34 |
|
---|
35 | def printc():
|
---|
36 | for i in sorted(c):
|
---|
37 | print i, c[i] |
---|
Note:
See
TracBrowser
for help on using the repository browser.