-
Notifications
You must be signed in to change notification settings - Fork 5
/
cutspec.py
44 lines (37 loc) · 1.23 KB
/
cutspec.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
38
39
40
41
42
43
44
#!/usr/bin/env python
#
# A script to trim images
#
# Load Python standard modules
import glob
# Load third-party modules
from pyraf import iraf
iraf.imred()
iraf.ccdred()
imagesre = str(raw_input("Enter regular expression to images: "))
imageslist = glob.glob(imagesre)
imagesin = ', '.join(imageslist)
imagesout = ', '.join([img[:-5]+'_trimed.fits' for img in imageslist])
trimsection = str(raw_input('Enter trim section: '))
iraf.ccdred.ccdproc.unlearn()
iraf.ccdred.combine.unlearn()
iraf.ccdred.setinstrument.unlearn()
iraf.ccdred.setinstrument.review = False
iraf.ccdred.setinstrument(instrument='coude')
iraf.ccdred.ccdproc.ccdtype = ''
iraf.ccdred.ccdproc.noproc = False
iraf.ccdred.ccdproc.fixpix = False
iraf.ccdred.ccdproc.overscan = False
iraf.ccdred.ccdproc.darkcor = False
iraf.ccdred.ccdproc.illumcor = False
iraf.ccdred.ccdproc.fringecor = False
iraf.ccdred.ccdproc.readcor = False
iraf.ccdred.ccdproc.scancor = False
iraf.ccdred.ccdproc.readaxis = 'line'
iraf.ccdred.ccdproc.zerocor = False
iraf.ccdred.ccdproc.flatcor = False
iraf.ccdred.ccdproc.trim = True
iraf.ccdred.ccdproc.trimsec = trimsection
iraf.ccdred.ccdproc.output = imagesout
iraf.ccdred.ccdproc(images=imagesin)
print '--- DONE ---'