def bluebias(images, biassec1=BLUEBIAS1, trimsec1=BLUETRIM1, biassec2=BLUEBIAS2, trimsec2=BLUETRIM2): '''Subtract overscan and trim blue frames''' for image in images: root, ext = image.split('.') iraf.ccdproc(image, output='%s_1' % root, ccdtype='', noproc=no, fixpix=no, overscan=yes, trim=yes, zerocor=no, darkcor=no, flatcor=no, illumcor=no, fringecor=no, readcor=no, scancor=no, biassec=biassec1, trimsec=trimsec1) iraf.ccdproc(image, output='%s_2' % root, ccdtype='', noproc=no, fixpix=no, overscan=yes, trim=yes, zerocor=no, darkcor=no, flatcor=no, illumcor=no, fringecor=no, readcor=no, scancor=no, biassec=biassec2, trimsec=trimsec2) iraf.imjoin('%s_1,%s_2' % (root, root), 'j%s' % image, 1) update_head('j%s' % image, 'DISPAXIS', 1) update_head('j%s' % image, ['CCDSEC', 'DATASEC'], ['[1:2048,1:270]', '[1:2048,1:270]']) return
def bluebias(images, biassec1=BLUEBIAS1, trimsec1=BLUETRIM1, biassec2=BLUEBIAS2, trimsec2=BLUETRIM2): '''Subtract overscan and trim blue frames''' for image in images: root,ext=image.split('.') iraf.ccdproc(image, output='%s_1' % root, ccdtype='', noproc=no, fixpix=no, overscan=yes, trim=yes, zerocor=no, darkcor=no, flatcor=no, illumcor=no, fringecor=no, readcor=no, scancor=no, biassec=biassec1, trimsec=trimsec1) iraf.ccdproc(image, output='%s_2' % root, ccdtype='', noproc=no, fixpix=no, overscan=yes, trim=yes, zerocor=no, darkcor=no, flatcor=no, illumcor=no, fringecor=no, readcor=no, scancor=no, biassec=biassec2, trimsec=trimsec2) iraf.imjoin('%s_1,%s_2' % (root, root), 'j%s' % image, 1) update_head('j%s' % image, 'DISPAXIS', 1) update_head('j%s' % image, ['CCDSEC', 'DATASEC'], ['[1:2048,1:270]', '[1:2048,1:270]']) return
### The ccd has an overscan and a blank in the middle. ### So we need to cut the two useful regions out, then join them together print "Splitting the image into two regions to remove the central blank strip" ### Delete any previous files os.system("rm -f " + file_path_temp + "*_" + "ccdproc_" + file_name) ### Extract region 1 iraf.imcopy( input = file_path_temp + "ccdproc_" + file_name+ region1, \ output = file_path_temp + "1_" + "ccdproc_" + file_name) ### Extract region 2 iraf.imcopy( input = file_path_temp + "ccdproc_" + file_name+ region2, \ output = file_path_temp + "2_" + "ccdproc_" + file_name) ### Join region 1 and 2 together iraf.imjoin( input = file_path_temp + "1_" + "ccdproc_"+file_name + "," + file_path_temp + "2_" + "ccdproc_"+file_name ,\ output = file_path_temp + "out_" + "ccdproc_" + file_name,\ join_dimension = 1) print "Image joined together" print "Reduced image: " + file_path_temp + "out_ccdproc_" + file_name else: os.system("mv "+file_path_temp + "ccdproc_" + file_name+" "+file_path_temp + "out_ccdproc_" + file_name)