-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.py
executable file
·37 lines (35 loc) · 1.15 KB
/
header.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import pyfits
import numpy as np
from numpy import array
import glob
from glob import glob
a=glob('/Users/Sony/Desktop/zspec.4N4449.fits')
b=array(a)
string = "";
for i in b:
hdu_list=pyfits.open(i)
table_hdu=hdu_list[1]
table_header=table_hdu.header
string += "\n Name of data set:"
print i
string += "\nRight Ascension:"
print table_header['MRDFITS']
string += "\nDeclination:"
print table_header['FXPOSIT']
string += "\nCoordinate of one end of the slit:"
print table_header['FXMOVE']
string += "\nCoordinate of the other end of the slit:"
print table_header['MRD_HREAD']
string += "\nPosition Angle of the slit:"
print table_header['FXPAR']
table_data=table_hdu.data
table_data.field(0)
string += "\nPosition along slit length of a target:"
print table_data.field('OBJPOS')
string += "\ncoordinate on one end of extraction window:"
print table_data.field('R1')
string += "\ncoordinate on other end of extraction window:"
print table_data.field('R2')
string += "\n "
string += "\n================================================================"
string += "\n "