Beispiel #1
0
def lris_rpreproc(image):
    '''Take an LRIS red image, combine into a single extension, subtract overscan,
    trim, and rotate.'''

    iraf.keck()
    iraf.lris()

    # Need grating name to start
    grating = get_head("../rawdata/%s" % image, "GRANAME", extn=0)

    # Convert to single extension fits image
    iraf.multi2simple("../rawdata/%s" % image,
                      "r%s.fits" % image[8:12],
                      overscan=yes,
                      header=yes,
                      trim=yes,
                      verbose=no,
                      debug=no)

    # Trim and rotate
    iraf.imcopy("r%s[%s]" % (image[8:12], LGRATINGS[grating]["trimreg"]),
                "tr%s" % image[8:12])
    iraf.imtranspose("tr%s" % image[8:12], "rtr%s" % image[8:12])

    return
Beispiel #2
0
def deimos_preproc(image):

    '''Take a MEF DEIMOS image, extract the relevant extensions, trim the
    LVM slit masks appropriately, and rename.'''

    # Needing grating
    graname = get_head(image, "GRATENAM", extn=0)
    
    # "Blue" chip
    iraf.imcopy("%s[%i]" % (image, BEXT), "d%s_B.fits" % image[6:10])
    iraf.ccdproc("d%s_B.fits" % image[6:10], overscan=yes, trim=yes,
                 fixpix=yes, biassec=BBIASSEC, trimsec=BTRIMSEC,
                 fixfile="%s_%i.fits" % (MASK, BEXT))
    iraf.imcopy("d%s_B.fits%s" % (image[6:10], DGRATINGS[graname]["blvmreg"]),
                "td%s_B.fits" % image[6:10])
    iraf.imtranspose("td%s_B.fits" % image[6:10], "rtd%s_B.fits" % image[6:10])

    # "Red" chip
    iraf.imcopy("%s[%i]" % (image, REXT), "d%s_R.fits" % image[6:10])
    iraf.ccdproc("d%s_R.fits" % image[6:10], overscan=yes, trim=yes,
                 fixpix=yes, biassec=RBIASSEC, trimsec=RTRIMSEC,
                 fixfile="%s_%i.fits" % (MASK, BEXT))
    iraf.imcopy("d%s_R.fits%s" % (image[6:10], DGRATINGS[graname]["rlvmreg"]),
                "td%s_R.fits" % image[6:10])
    iraf.imtranspose("td%s_R.fits" % image[6:10], "rtd%s_R.fits" % image[6:10])
    iraf.rotate("rtd%s_R.fits" % image[6:10], "rtd%s_R.fits" % image[6:10], 180.0)

    return
Beispiel #3
0
def lris_bpreproc(image):

    '''Take an LRIS blue image, combine into a single extension, subtract overscan,
    trim, and rotate.'''

    iraf.keck()
    iraf.lris()
    
    # Need grating name to start
    grism = get_head("../rawdata/%s" % image, "GRISNAME", extn=0)

    # Convert to single extension fits image
    iraf.multi2simple("../rawdata/%s" % image, "b%s.fits" % image[8:12],
                      overscan=yes, header=yes, trim=yes, verbose=no, debug=no)

    # Trim and rotate
    iraf.imcopy("b%s[%s]" % (image[8:12], LGRISMS[grism]["trimreg"]),
                "tb%s" % image[8:12])
    iraf.imtranspose("tb%s" % image[8:12], "rtb%s" % image[8:12])

    return
Beispiel #4
0
def deimos_preproc(image):
    '''Take a MEF DEIMOS image, extract the relevant extensions, trim the
    LVM slit masks appropriately, and rename.'''

    # Needing grating
    graname = get_head(image, "GRATENAM", extn=0)

    # "Blue" chip
    iraf.imcopy("%s[%i]" % (image, BEXT), "d%s_B.fits" % image[6:10])
    iraf.ccdproc("d%s_B.fits" % image[6:10],
                 overscan=yes,
                 trim=yes,
                 fixpix=yes,
                 biassec=BBIASSEC,
                 trimsec=BTRIMSEC,
                 fixfile="%s_%i.fits" % (MASK, BEXT))
    iraf.imcopy("d%s_B.fits%s" % (image[6:10], DGRATINGS[graname]["blvmreg"]),
                "td%s_B.fits" % image[6:10])
    iraf.imtranspose("td%s_B.fits" % image[6:10], "rtd%s_B.fits" % image[6:10])

    # "Red" chip
    iraf.imcopy("%s[%i]" % (image, REXT), "d%s_R.fits" % image[6:10])
    iraf.ccdproc("d%s_R.fits" % image[6:10],
                 overscan=yes,
                 trim=yes,
                 fixpix=yes,
                 biassec=RBIASSEC,
                 trimsec=RTRIMSEC,
                 fixfile="%s_%i.fits" % (MASK, BEXT))
    iraf.imcopy("d%s_R.fits%s" % (image[6:10], DGRATINGS[graname]["rlvmreg"]),
                "td%s_R.fits" % image[6:10])
    iraf.imtranspose("td%s_R.fits" % image[6:10], "rtd%s_R.fits" % image[6:10])
    iraf.rotate("rtd%s_R.fits" % image[6:10], "rtd%s_R.fits" % image[6:10],
                180.0)

    return