We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1b17cf9 commit fb7a782Copy full SHA for fb7a782
scripts/updsateFitsHeader.py
@@ -0,0 +1,31 @@
1
+import sys
2
+
3
+from astropy.io import fits
4
5
+fname = sys.argv[1]
6
+print("Looking at header for file ", fname)
7
8
+hdul = fits.open(fname)
9
10
+hdr = hdul[0].header
11
12
+expTime = hdr['EXPTIME']
13
14
+hdr['XBINNING'] = 2
15
+hdr['YBINNING'] = 2
16
+hdr.set('XBINNING', 2)
17
+hdr.set('YBINNING', 2)
18
19
+#print("Telescope: ", hdr['TELESCOP'])
20
+print("Exposure time: ", expTime)
21
+#print("Object: ", hdr['OBJECT'])
22
+print("Gain: ", hdr['GAIN'])
23
+#print("Offset:", hdr['OFFSET'])
24
+print("Binning: ", hdr['XBINNING'], "x", hdr['YBINNING'])
25
+print("Bits per pixel:", hdr['BITPIX'])
26
+print("Width: ", hdr['NAXIS1'], " x Height: ", hdr['NAXIS2'])
27
28
+hdul.writeto('updated.fits')
29
30
+hdul.close()
31
0 commit comments