Ejemplo n.º 1
0
def reduce_beehive():

    util.mkdir(out_dir)

    ## Loop through all the different data sets and reduce them.
    #for key in dict_suffix.keys():
    #for key in ['LS_3wfs_r2', 'LS_5wfs_r2', 'open_r2']:
    for key in ['open_r2']:
        img = dict_images[key]
        suf = dict_suffix[key]
        sky = 'beehive_sky2.fits'

        print('Working on: {1:s}  {0:s}'.format(key, suf))
        print('   Images: ', img)
        print('      Sky: ', sky)

        img_files = [
            data_dir + 'sta{img:03d}{suf:s}.fits'.format(img=ii, suf=suf)
            for ii in img
        ]
        scn_files = [
            data_dir + 'sta{img:03d}{suf:s}_scan.fits'.format(img=ii, suf=suf)
            for ii in img
        ]

        reduce_STA.treat_overscan(img_files)
        #reduce_STA.treat_overscan_working(img_files)  #BUG
        redu.clean_images(scn_files,
                          out_dir,
                          rebin=2,
                          sky_frame=sky_dir + sky,
                          flat_frame=calib_dir + "domeflat.fits")
    return
Ejemplo n.º 2
0
def reduce_FLD2():
    util.mkdir(out_dir)

    # Open Loop
    img_files = [data_dir + 'obj{0:03d}_o.fits'.format(ii) for ii in fnum_o]
    reduce_STA.treat_overscan(img_files)
    scan_img_files = [
        data_dir + 'obj{0:03d}_o_scan.fits'.format(ii) for ii in fnum_o
    ]
    reduce_fli.clean_images(scan_img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_sky.fits',
                            flat_frame=flat_dir + "flat.fits")

    # Closed - threeWFS_LS
    img_files = [
        data_dir + 'obj{0:03d}threeWFS_LS_c.fits'.format(ii) for ii in fnum_c
    ]
    reduce_STA.treat_overscan(img_files)
    scan_img_files = [
        data_dir + 'obj{0:03d}threeWFS_LS_c_scan.fits'.format(ii)
        for ii in fnum_c
    ]
    reduce_fli.clean_images(scan_img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_sky.fits',
                            flat_frame=flat_dir + "flat.fits")

    return
Ejemplo n.º 3
0
def reduce_pleiades():
    ##########
    # Open Loop
    ##########
    data_dir = root_dir + 'Pleiades/'
    sky_file = root_dir + 'reduce/sky/flat.fits'
    flat_file = root_dir + 'reduce/calib/sky.fits'
    out_dir = root_dir + 'reduce/pleiades/'

    fnum = np.arange(57, 67)
    img_files = ['{0:s}/obj{1:03d}.fits'.format(data_dir, ii) for ii in fnum]

    reduce_fli.clean_images(img_files, out_dir, rebin=1,
                                sky_frame=sky_file,
                                flat_frame=flat_file)

    ##########
    # Closed Loop
    ##########
    data_dir = root_dir + 'Pleiades/'
    sky_file = root_dir + 'reduce/sky/flat.fits'
    flat_file = root_dir + 'reduce/calib/sky.fits'
    out_dir = root_dir + 'reduce/pleiades/'
    
    fnum = np.arange(47, 57)
    img_files = ['{0:s}/obj{1:03d}.fits'.format(data_dir, ii) for ii in fnum]

    reduce_fli.clean_images(img_files, out_dir, rebin=1,
                                sky_frame=sky_file,
                                flat_frame=flat_file)

    return
Ejemplo n.º 4
0
def reduce_beehive():

    util.mkdir(out_dir)

    # Loop through all the different data sets and reduce them.
    for key in dict_suffix.keys():
        img = dict_images[key]
        suf = dict_suffix[key]
        sky = dict_skies[key]

        print('Working on: {1:s}  {0:s}'.format(key, suf))
        print('   Images: ', img)
        print('      Sky: ', sky)

        img_files = [
            data_dir + 'sta{img:03d}{suf:s}.fits'.format(img=ii, suf=suf)
            for ii in img
        ]
        scn_files = [
            data_dir + 'sta{img:03d}{suf:s}_scan.fits'.format(img=ii, suf=suf)
            for ii in img
        ]

        reduce_STA.treat_overscan(img_files)
        reduce_fli.clean_images(scn_files,
                                out_dir,
                                rebin=1,
                                sky_frame=sky_dir + sky,
                                flat_frame=flat_dir + "flat.fits")

    return
Ejemplo n.º 5
0
def reduce_fld2():

    util.mkdir(out_dir)

    ## Loop through all the different data sets
    for key in dict_suffix.keys():
        #for key in ['doczskycl']:

        img = dict_images[key]
        suf = dict_suffix[key]
        sky = dict_skies[key]

        print('Working on: {1:s}  {0:s}'.format(key, suf))
        print('   Images: ', img)
        print('      Sky: ', sky)

        img_files = [
            data_dir + 'sta{img:03d}{suf:s}.fits'.format(img=ii, suf=suf)
            for ii in img
        ]
        scn_files = [
            data_dir + 'sta{img:03d}{suf:s}_scan.fits'.format(img=ii, suf=suf)
            for ii in img
        ]

        reduce_STA.treat_overscan(img_files)
        redu.clean_images(scn_files,
                          out_dir,
                          rebin=1,
                          sky_frame=sky_dir + sky,
                          flat_frame=calib_dir + "flat.fits")  #,
        # fix_bad_pixels=True, worry_about_edges=True)

    return
Ejemplo n.º 6
0
def reduce_fld2():

    util.mkdir(out_dir)

    ## Loop through all the different data sets and reduce them.
    #for key in ['open_RIVB', 'LS_RIVB', 'docz_RIVB']: ## Single key setup
    for key in dict_suffix.keys():
        
        img = dict_images[key]
        suf = dict_suffix[key]
        filt = dict_filt[key]

        print('Working on: {1:s}  {0:s}'.format(key, suf))
        print('   Images: ', img)
        print('   Filter: ', filt)
        
        img_files = [data_dir + 'sta{img:03d}{suf:s}.fits'.format(img=ii, suf=suf) for ii in img]
        scn_files = [data_dir + 'sta{img:03d}{suf:s}_scan.fits'.format(img=ii, suf=suf) for ii in img]
        
        reduce_STA.treat_overscan(img_files)
        redu.clean_images(scn_files, out_dir, rebin=1,
                                    sky_frame=sky_dir + f"fld2_sky_{filt}.fits",
                                    flat_frame=calib_dir + f"flat_{filt}.fits")#,
                                # fix_bad_pixels=True, worry_about_edges=True)

    return
Ejemplo n.º 7
0
def reduce_pleiades_binned_ttf():
    sky_dir = root_dir + 'reduce/sky/'
    data_dir = root_dir + 'Pleiades/'
    flat_dir = root_dir + 'reduce/flat/'
    out_dir = root_dir + 'reduce/pleiades/'
    os.chdir(data_dir)

    fnum1 = [
        143, 144, 145, 146, 147, 148, 151, 152, 153, 154, 157, 157, 158, 161,
        162, 165, 166
    ]
    fnum2 = [
        169, 170, 173, 174, 175, 176, 181, 182, 187, 188, 189, 190, 202, 203,
        208, 209, 214
    ]
    fnum3 = [215, 220, 221, 224, 225, 228, 229]
    fnum = fnum1 + fnum2 + fnum3
    img_files = ['obj_ttf{0:03d}.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_195.fits',
                            flat_frame=flat_dir + 'flat.fits')

    return
Ejemplo n.º 8
0
def reduce_pleiades_unbinned_open():
    data_dir = '/Users/jlu/data/imaka/2016_11_18/Pleiades_E/open_loop/'
    os.chdir(data_dir)
    
    # img_files = ['obj_{0:03d}.fits'.format(ii) for ii in range(55, 57)]
    img_files = ['obj_056.fits']

    reduce_fli.clean_images(img_files, rebin=10)

    return
Ejemplo n.º 9
0
def reduce_pleiades_binned_closed():
    data_dir = '/Users/jlu/data/imaka/2016_11_18/Pleiades_E/closed_loop/'
    os.chdir(data_dir)
    
    # img_files = ['obj_{0:03d}.fits'.format(ii) for ii in range(92, 101)]
    # img_files = ['obj_{0:03d}.fits'.format(ii) for ii in range(153, 163)]
    img_files = ['obj_{0:03d}.fits'.format(ii) for ii in range(243, 247)]
    img_files += ['obj_{0:03d}.fits'.format(ii) for ii in range(251, 254)]

    reduce_fli.clean_images(img_files, rebin=2)

    return
Ejemplo n.º 10
0
def reduce_pleiades_binned_open():
    data_dir = '/Users/jlu/data/imaka/2016_11_18/Pleiades_E/open_loop/'
    os.chdir(data_dir)
    
    # img_files = ['obj_{0:03d}.fits'.format(ii) for ii in range(82, 91)]
    # img_files = ['obj_{0:03d}.fits'.format(ii) for ii in range(163, 173)]
    img_files = ['obj_{0:03d}.fits'.format(ii) for ii in range(247, 251)]
    img_files += ['obj_{0:03d}.fits'.format(ii) for ii in range(255, 258)]

    reduce_fli.clean_images(img_files, rebin=2)

    return
Ejemplo n.º 11
0
def reduce_pleiades_binned_closed():
    sky_dir = '/Users/jlu/data/imaka/2016_11_19/20161118/skies/binned/'
    data_dir = '/Users/jlu/data/imaka/2016_11_19/20161118/Pleiades_E/closed_loop/'
    os.chdir(data_dir)

    fnum = [138, 141, 143, 147, 149, 151]
    img_files = ['obj_{0:03d}.fits'.format(ii) for ii in fnum]

    reduce_fli.clean_images(img_files,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky.fits')

    return
Ejemplo n.º 12
0
def reduce_FLD2():
    sky_dir = root_dir + 'reduce/sky/'
    data_dir = root_dir + 'FLD2_2/'
    flat_dir = root_dir + 'reduce/calib/'
    out_dir = root_dir + 'reduce/FLD2_2/'

    util.mkdir(out_dir)

    # Open Loop
    fnum = [4, 5, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45]
    fnum += [51, 54, 57, 60, 63, 66, 69, 72, 75, 78, 81, 85, 88, 89]
    fnum += [92, 95, 99, 103, 107, 110, 113, 116, 119, 122, 125, 128]
    fnum += [
        131, 134, 137, 140, 143, 146, 149, 152, 155, 158, 161, 164, 167, 170
    ]
    img_files = [data_dir + 'obj{0:04d}_o.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_2_sky.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # Closed Loop
    fnum = [96, 100, 104]
    img_files = [data_dir + 'obj{0:04d}_c.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_2_sky.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # Closed A
    fnum = [6, 8, 11, 14, 17, 20, 23, 26, 29, 32, 35, 38, 41, 44, 47, 50, 53]
    fnum += [56, 59, 62, 65, 68, 71, 74, 77, 80, 83, 87, 91, 94, 98, 102, 106]
    fnum += [109, 112, 115, 118, 121, 124, 127, 130, 133, 136, 139, 142, 145]
    fnum += [148, 151, 154, 157, 160, 163, 166, 169]
    img_files = [data_dir + 'obj{0:04d}_cA.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_2_sky.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # Closed B
    fnum = [10, 13, 16, 19, 22, 25, 28, 31, 34, 37, 40, 43, 46, 49, 52, 55, 58]
    fnum += [
        61, 64, 67, 70, 73, 76, 79, 82, 86, 90, 93, 97, 101, 105, 108, 111
    ]
    fnum += [
        114, 117, 120, 123, 126, 129, 132, 135, 138, 141, 144, 147, 150, 153
    ]
    fnum += [156, 159, 162, 165, 168, 171]
    img_files = [data_dir + 'obj{0:04d}_cB.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_2_sky.fits',
                            flat_frame=flat_dir + 'flat.fits')

    return
Ejemplo n.º 13
0
def reduce_orion():

    util.mkdir(out_dir)

    # Open Loop
    img_files = [data_dir + 'obj{0:03d}_o.fits'.format(ii) for ii in fnum_o]
    reduce_STA.treat_overscan(img_files)
    scan_img_files = [data_dir + 'obj{0:03d}_o_scan.fits'.format(ii) for ii in fnum_o]
    reduce_fli.clean_images(scan_img_files, out_dir, rebin=1, sky_frame=sky_dir + 'orion_sky.fits', flat_frame=flat_dir+"flat.fits")

    # Closed Loop - 4W
    img_files = [data_dir + 'obj{0:03d}LS4WFS_c.fits'.format(ii) for ii in fnum_c_4W]
    reduce_STA.treat_overscan(img_files)
    scan_img_files = [data_dir + 'obj{0:03d}LS4WFS_c_scan.fits'.format(ii) for ii in fnum_c_4W]
    reduce_fli.clean_images(scan_img_files, out_dir, rebin=1, sky_frame=sky_dir + 'orion_sky.fits', flat_frame =flat_dir+"flat.fits")

    # Closed Loop - B2

    img_files = [data_dir + 'obj{0:03d}LS4WFS_B2_c.fits'.format(ii) for ii in fnum_c_B2]
    reduce_STA.treat_overscan(img_files)
    scan_img_files = [data_dir + 'obj{0:03d}LS4WFS_B2_c_scan.fits'.format(ii) for ii in fnum_c_B2]
    reduce_fli.clean_images(scan_img_files, out_dir, rebin=1, sky_frame=sky_dir + 'orion_sky.fits', flat_frame =flat_dir+"flat.fits")
    
    # Closed Loop - zc
    img_files = [data_dir + 'obj{0:03d}LS4WFS_zc21_c.fits'.format(ii) for ii in fnum_c_zc]
    reduce_STA.treat_overscan(img_files)
    scan_img_files = [data_dir + 'obj{0:03d}LS4WFS_zc21_c_scan.fits'.format(ii) for ii in fnum_c_zc]
    reduce_fli.clean_images(scan_img_files, out_dir, rebin=1, sky_frame=sky_dir + 'orion_sky.fits', flat_frame =flat_dir+"flat.fits")

    return
Ejemplo n.º 14
0
def reduce_pleiades():
    sky_dir = root_dir + 'reduce/sky/'
    data_dir = root_dir + 'Pleiades/'
    flat_dir = root_dir + 'reduce/calib/'
    out_dir = root_dir + 'reduce/pleiades/'

    #util.mkdir(out_dir)

    #     # Open Loop
    #     fnum = [59, 62, 65, 68, 70, 76, 82, 88]#, 94]
    #     img_files = [data_dir + 'obj{0:04d}_o.fits'.format(ii) for ii in fnum]
    #     reduce_fli.clean_images(img_files, out_dir, rebin=1, sky_frame=sky_dir + 'pleiades_sky.fits', flat_frame=flat_dir + 'flat.fits')

    #     # Closed Loop - a
    #     fnum = [58, 61, 64, 75, 81, 87]#, 93]
    #     img_files = [data_dir + 'obj{0:04d}_ca.fits'.format(ii) for ii in fnum]
    #     reduce_fli.clean_images(img_files, out_dir, rebin=1, sky_frame=sky_dir + 'pleiades_sky.fits', flat_frame = flat_dir + 'flat.fits')

    #     # Closed Loop - b
    #     fnum = [71, 77, 83, 89]
    #     img_files = [data_dir + "obj{0:04d}_cb.fits".format(ii) for ii in fnum]
    #     reduce_fli.clean_images(img_files, out_dir, rebin=1, sky_frame=sky_dir + 'pleiades_sky.fits', flat_frame = flat_dir + 'flat.fits')

    #     # Closed Loop - c
    #     fnum = [72, 78, 84, 90]
    #     img_files = [data_dir + "obj{0:04d}_cc.fits".format(ii) for ii in fnum]
    #     reduce_fli.clean_images(img_files, out_dir, rebin=1, sky_frame=sky_dir + 'pleiades_sky.fits', flat_frame = flat_dir + 'flat.fits')

    #     # Closed Loop - d
    #     fnum = [73, 79, 85]#, 91]
    #     img_files = [data_dir + "obj{0:04d}_cd.fits".format(ii) for ii in fnum]
    #     reduce_fli.clean_images(img_files, out_dir, rebin=1, sky_frame=sky_dir + 'pleiades_sky.fits', flat_frame = flat_dir + 'flat.fits')

    #     # Closed Loop - e
    #     fnum = [74, 80, 86]#, 92]
    #     img_files = [data_dir + "obj{0:04d}_ce.fits".format(ii) for ii in fnum]
    #     reduce_fli.clean_images(img_files, out_dir, rebin=1, sky_frame=sky_dir + 'pleiades_sky.fits', flat_frame = flat_dir + 'flat.fits')

    # TT
    fnum = [60, 63, 69]
    img_files = [data_dir + "obj{0:04d}_tt.fits".format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky.fits',
                            flat_frame=flat_dir + 'flat.fits')

    return
Ejemplo n.º 15
0
def reduce_pleiadies_east():
    data_dir = '/Users/jlu/Google Drive/Instruments/imaka/imaka (1)/Commissioning/2016-11 Observing/20161115/'
    data_dir += 'Focal_plane_images/obs_11152016/'

    dark_dir = data_dir + 'darks/'
    plei_dir = data_dir + 'Pleides_E/'

    dark_file = 'off_0S_0E.fits'

    # img_files = ['off_0S_0E_1.fits', 'off_0S_0E_2.fits', 'off_10S_0E_1.fits', 'off_10S_0E_2.fits',
    #              'off_10S_30E_1.fits', 'off_10S_30E_2.fits']
    img_files = ['off_0S_0E_1.fits']

    reduce_fli.clean_images(img_files)

    return
Ejemplo n.º 16
0
def reduce_pleiades_binned_tt():
    sky_dir = root_dir + 'reduce/sky/'
    data_dir = root_dir + 'Pleiades/'
    flat_dir = root_dir + 'reduce/flat/'
    out_dir = root_dir + 'reduce/pleiades/'
    os.chdir(data_dir)

    fnum = [134, 135, 136, 137, 138, 139, 140]
    img_files = ['obj_tt{0:03d}.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_078.fits',
                            flat_frame=flat_dir + 'flat.fits')

    return
Ejemplo n.º 17
0
def reduce_FLD2():
    sky_dir = root_dir + 'reduce/sky/'
    data_dir = root_dir + 'FLD2_2/'
    flat_dir = root_dir + 'reduce/calib/'
    out_dir = root_dir + 'reduce/FLD2_2/'

    util.mkdir(out_dir)

    # Open Loop
    fnum = [20, 26, 32, 34, 38, 39, 40, 42, 45, 48, 51, 54, 57]
    fnum += [60, 63, 66, 69, 72, 75, 78, 81, 84, 87, 90, 93, 95]
    fnum += [99, 102, 105, 108, 111, 113, 116, 119, 122, 125, 128]
    img_files = [data_dir + 'obj{0:04d}_o.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_2_sky.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # Closed Loop
    fnum = [19, 21, 22, 23, 24, 25, 27, 28, 29, 30, 31]
    img_files = [data_dir + 'obj{0:04d}_c.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_2_sky.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # Closed A
    fnum = [33, 41, 44, 47, 50, 53, 56, 59, 62, 65, 68]
    fnum += [71, 74, 77, 80, 83, 86, 89, 92, 94]
    fnum += [98, 101, 104, 107, 110, 112, 115, 118, 121, 124, 127]
    img_files = [data_dir + 'obj{0:04d}_cA.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_2_sky.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # Closed B
    fnum = [35, 36, 37, 43, 46, 49, 52, 55, 58, 61, 64]
    fnum += [67, 70, 73, 76, 79, 82, 85, 88, 91, 96]
    fnum += [100, 103, 106, 109, 114, 117, 120, 123, 126, 129]
    img_files = [data_dir + 'obj{0:04d}_cB.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_2_sky.fits',
                            flat_frame=flat_dir + 'flat.fits')

    return
Ejemplo n.º 18
0
def reduce_FLD2():

    util.mkdir(out_dir)

    # Open Loop
    img_files = [data_dir + 'obj{0:04d}_o.fits'.format(ii) for ii in fnum_o]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=None,
                            flat_frame=None)

    # Closed
    img_files = [data_dir + 'obj{0:04d}_c.fits'.format(ii) for ii in fnum_c]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=None,
                            flat_frame=None)

    return
Ejemplo n.º 19
0
def reduce_pleiades_binned_open():
    sky_dir = root_dir + 'reduce/sky/'
    data_dir = root_dir + 'Pleiades/'
    flat_dir = root_dir + 'reduce/calib/'
    out_dir = root_dir + 'reduce/pleiades/'

    util.mkdir(out_dir)
    os.chdir(data_dir)

    fnum = [
        9, 10, 13, 14, 17, 18, 21, 22, 28, 29, 32, 33, 36, 37, 40, 41, 46, 47,
        50, 51, 54, 55, 58, 59
    ]
    img_files = ['obj_o{0:03d}.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_023.fits',
                            flat_frame=flat_dir + 'flat.fits')

    fnum = [64, 65, 68, 69, 72, 73, 76, 77, 82, 83, 86, 87, 90, 91, 94, 95, 100, 101, 104, 105, 108, 109, 112, \
            113, 118, 119, 122, 123, 126, 127, 130, 131]
    img_files = ['obj_o{0:03d}.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_025.fits',
                            flat_frame=flat_dir + 'flat.fits')

    fnum = [141, 142, 149, 150]
    img_files = ['obj_o{0:03d}.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_078.fits',
                            flat_frame=flat_dir + 'flat.fits')

    fnum = [
        179, 180, 185, 186, 193, 194, 200, 201, 206, 207, 212, 213, 218, 219
    ]
    img_files = ['obj_o{0:03d}.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_195.fits',
                            flat_frame=flat_dir + 'flat.fits')

    return
Ejemplo n.º 20
0
def reduce_fld2():

    util.mkdir(out_dir)

    ## Loop through all the different data sets and reduce them.
    #for key in ['set_name']: ## Single key setup
    for key in dict_suffix.keys():

        img = dict_images[key]
        suf = dict_suffix[key]
        sky = dict_skies[key]

        bin_num = 'bin1' if 'bin1' in key else 'bin2'  # key should contain bin info

        print('Working on: {1:s}  {0:s}'.format(key, suf))
        print('   Images: ', img)
        print('      Sky: ', sky)

        img_files = [
            data_dir + 'sta{img:03d}{suf:s}.fits'.format(img=ii, suf=suf)
            for ii in img
        ]
        scn_files = [
            data_dir + 'sta{img:03d}{suf:s}_scan.fits'.format(img=ii, suf=suf)
            for ii in img
        ]

        reduce_STA.treat_overscan(img_files)
        redu.clean_images(scn_files,
                          out_dir,
                          rebin=1,
                          sky_frame=sky_dir + sky,
                          flat_frame=flat_dir + "flat_" + bin_num +
                          ".fits")  #,
        # fix_bad_pixels=True, worry_about_edges=True)

    return
Ejemplo n.º 21
0
def reduce_FLD2():
    util.mkdir(out_dir)

    # Open Loop
    img_files = [data_dir + 'obj{0:04d}_o.fits'.format(ii) for ii in fnum_o]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_30_sky.fits',
                            flat_frame=flat_dir + "flat.fits")

    # Closed - threeWFS_LS
    img_files = [
        data_dir + 'obj{0:04d}_threeWFS_LS.fits'.format(ii)
        for ii in fnum_threeWFS_LS
    ]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_30_sky.fits',
                            flat_frame=flat_dir + "flat.fits")

    # Closed - threeWFSLS_B2_c
    img_files = [
        data_dir + 'obj{0:04d}_threeWFSLS_B2_c.fits'.format(ii)
        for ii in fnum_threeWFSLS_B2_c
    ]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_30_sky.fits',
                            flat_frame=flat_dir + "flat.fits")

    # Closed - threeWFSMean_B2_c
    img_files = [
        data_dir + 'obj{0:04d}_threeWFSMean_B2_c.fits'.format(ii)
        for ii in fnum_threeWFSMean_B2_c
    ]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_30_sky.fits',
                            flat_frame=flat_dir + "flat.fits")

    return
Ejemplo n.º 22
0
def reduce_FLD2():
    sky_dir = root_dir + 'reduce/sky/'
    data_dir = root_dir + 'FLD2/'
    flat_dir = root_dir + 'reduce/calib/'
    out_dir = root_dir + 'reduce/FLD2/'

    util.mkdir(out_dir)

    # Open Loop
    fnum = [63, 67, 71, 75, 80, 84, 88, 92, 96, 100, 104, 108, 112, 124]
    img_files = [data_dir + 'obj{0:04d}_o.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_sky.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # Closed Loop
    fnum = [64, 68, 72, 76, 77, 81, 85, 89, 93, 97, 101, 105, 109, 113]
    img_files = [data_dir + 'obj{0:04d}_c.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_sky.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # Closed A
    fnum = [65, 69, 73, 78, 82, 86, 90, 94, 98, 102, 106, 110, 114]
    img_files = [data_dir + 'obj{0:04d}_cA.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_sky.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # Closed B
    fnum = [66, 70, 74, 79, 83, 87, 91, 95, 99, 103, 107, 111, 115]
    img_files = [data_dir + 'obj{0:04d}_cB.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_sky.fits',
                            flat_frame=flat_dir + 'flat.fits')

    return
Ejemplo n.º 23
0
def reduce_pleiades_binned_closed():
    sky_dir = root_dir + 'reduce/sky/'
    data_dir = root_dir + 'Pleiades/'
    flat_dir = root_dir + 'reduce/flat/'
    out_dir = root_dir + 'reduce/pleiades/'

    os.chdir(data_dir)

    fnum1 = [
        7, 8, 12, 15, 16, 19, 20, 26, 27, 30, 31, 34, 35, 38, 39, 44, 45, 48,
        49, 52
    ]
    fnum2 = [53, 56, 57, 62, 63]
    fnum = fnum1 + fnum2
    img_files = ['obj_c{0:03d}.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_025.fits',
                            flat_frame=flat_dir + 'flat.fits')

    fnum1 = [
        66, 67, 70, 71, 74, 75, 80, 81, 84, 85, 88, 89, 92, 93, 98, 99, 102,
        103, 106
    ]
    fnum2 = [107, 110, 111, 116, 117, 120, 121, 124, 125, 128, 129]
    fnum = fnum1 + fnum2
    img_files = ['obj_c{0:03d}.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_78.fits',
                            flat_frame=flat_dir + 'flat.fits')

    fnum1 = [
        155, 156, 163, 164, 167, 168, 171, 172, 177, 178, 183, 184, 191, 192,
        198, 199
    ]
    fnum2 = [204, 205, 210, 211, 216, 217, 222, 223, 226, 227, 230, 231]
    fnum = fnum1 + fnum2
    img_files = ['obj_c{0:03d}.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_195.fits',
                            flat_frame=flat_dir + 'flat.fits')

    return
Ejemplo n.º 24
0
def reduce_FLD2():
    sky_dir = root_dir + 'reduce/sky/'
    data_dir = root_dir + 'FLD2_2/'
    flat_dir = root_dir + 'reduce/calib/'
    out_dir = root_dir + 'reduce/FLD2_2/'

    util.mkdir(out_dir)

    # Open Loop
    fnum = [14, 17, 29, 23, 26, 29, 32, 35, 38, 41, 44, 47, 50, 53, 56, 59]
    fnum += [62, 65, 68, 71, 74, 77, 80, 83, 86, 89, 92]
    img_files = [data_dir + 'obj{0:04d}_o.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_2_sky.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # Closed A
    fnum = [12, 13, 16, 19, 22, 25, 28, 31, 34, 37, 40, 43, 46, 49, 52, 55]
    fnum += [58, 61, 64, 67, 70, 73, 76, 79, 82, 85, 88, 91]
    img_files = [data_dir + 'obj{0:04d}_cA.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_2_sky.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # Closed D
    fnum = [18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57, 60, 63]
    fnum += [66, 69, 72, 75, 78, 81, 84, 87, 90, 93]
    img_files = [data_dir + 'obj{0:04d}_cB.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_2_sky.fits',
                            flat_frame=flat_dir + 'flat.fits')

    return
Ejemplo n.º 25
0
def reduce_pleiades():
    sky_dir = root_dir + 'reduce/sky/'
    data_dir = root_dir + 'Pleiades/'
    flat_dir = root_dir + 'reduce/calib/'
    out_dir = root_dir + 'reduce/pleiades/'

    util.mkdir(out_dir)

    # Open Loop
    fnum1 = [
        56, 57, 58, 65, 66, 67, 77, 78, 79, 92, 93, 94, 98, 99, 100, 104, 105,
        106
    ]
    fnum2 = [
        113, 114, 115, 126, 127, 128, 135, 136, 137, 144, 145, 146, 156, 157,
        158
    ]
    fnum3 = [
        165, 166, 167, 174, 175, 176, 186, 187, 188, 195, 196, 197, 204, 205,
        206
    ]
    fnum4 = [
        216, 217, 218, 231, 232, 233, 240, 241, 242, 252, 253, 254, 261, 262,
        263
    ]
    fnum5 = [
        270, 271, 272, 280, 281, 286, 287, 292, 293, 299, 300, 301, 302, 312,
        313
    ]
    fnum6 = [314, 321, 322, 323]
    fnum = fnum1 + fnum2 + fnum3 + fnum4 + fnum5 + fnum6
    img_files = [data_dir + 'obj_o{0:03d}.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # TTF Closed Loop
    fnum1 = [
        32, 33, 34, 38, 39, 40, 50, 51, 52, 59, 60, 61, 68, 69, 70, 80, 81, 82,
        86
    ]
    fnum2 = [
        87, 88, 95, 96, 97, 107, 108, 109, 120, 121, 122, 129, 130, 131, 138,
        139
    ]
    fnum3 = [
        140, 150, 151, 152, 159, 160, 161, 168, 169, 170, 180, 181, 182, 189,
        190
    ]
    fnum4 = [
        191, 198, 199, 200, 210, 211, 212, 219, 220, 221, 225, 226, 227, 234,
        235
    ]
    fnum5 = [
        236, 246, 247, 248, 255, 256, 257, 264, 265, 266, 276, 277, 282, 283,
        288
    ]
    fnum6 = [289, 294, 295, 306, 307, 308, 315, 316, 317]
    fnum = fnum1 + fnum2 + fnum3 + fnum4 + fnum5 + fnum6
    img_files = [data_dir + 'obj_ttf{0:03d}.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # Closed Loop
    fnum1 = [
        27, 28, 29, 30, 31, 35, 36, 37, 44, 45, 46, 47, 48, 49, 53, 54, 55, 62,
        63, 64
    ]
    fnum2 = [
        74, 75, 76, 89, 90, 91, 101, 102, 103, 110, 111, 112, 123, 124, 125,
        132, 133
    ]
    fnum3 = [
        134, 141, 142, 143, 153, 154, 155, 162, 163, 164, 171, 172, 173, 183,
        184, 185
    ]
    fnum4 = [
        192, 193, 194, 201, 202, 203, 213, 214, 215, 222, 223, 224, 228, 229,
        230, 237
    ]
    fnum5 = [
        238, 239, 249, 250, 251, 258, 259, 260, 267, 268, 269, 278, 279, 284,
        285, 290
    ]
    fnum6 = [291, 296, 297, 309, 310, 311, 318, 319, 320]
    fnum = fnum1 + fnum2 + fnum3 + fnum4 + fnum5 + fnum6
    img_files = [data_dir + 'obj_c{0:03d}.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky.fits',
                            flat_frame=flat_dir + 'flat.fits')

    return
Ejemplo n.º 26
0
def reduce_FLD2():
    util.mkdir(out_dir)

    # Open Loop - 30s
    img_files = [data_dir + 'obj{0:04d}_o.fits'.format(ii) for ii in fnum_o_30]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_30_sky.fits',
                            flat_frame=flat_dir + "flat.fits")

    # Closed - 3 WFS Small - 30s
    img_files = [
        data_dir + 'obj{0:04d}_threewfs_small_c.fits'.format(ii)
        for ii in fnum_c_3S_30
    ]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_30_sky.fits',
                            flat_frame=flat_dir + "flat.fits")

    # Closed - 3 WFS Large - 30s
    img_files = [
        data_dir + 'obj{0:04d}_threeWFS_big_c.fits'.format(ii)
        for ii in fnum_c_3L_30
    ]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_30_sky.fits',
                            flat_frame=flat_dir + "flat.fits")

    # Closed - 4 WFS - 30s
    img_files = [
        data_dir + 'obj{0:04d}_fourWFS_c.fits'.format(ii) for ii in fnum_c_4_30
    ]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_30_sky.fits',
                            flat_frame=flat_dir + "flat.fits")

    # Open Loop - 60s
    img_files = [data_dir + 'obj{0:04d}_o.fits'.format(ii) for ii in fnum_o_60]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_60_sky.fits',
                            flat_frame=flat_dir + "flat.fits")

    # Closed - 3 WFS Small - 60s
    img_files = [
        data_dir + 'obj{0:04d}_threewfs_small_c.fits'.format(ii)
        for ii in fnum_c_3S_60
    ]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_60_sky.fits',
                            flat_frame=flat_dir + "flat.fits")

    # Closed - 3 WFS Large - 60s
    img_files = [
        data_dir + 'obj{0:04d}_threeWFS_big_c.fits'.format(ii)
        for ii in fnum_c_3L_60
    ]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_60_sky.fits',
                            flat_frame=flat_dir + "flat.fits")

    # Closed - 4 WFS - 60s
    img_files = [
        data_dir + 'obj{0:04d}_fourWFS_c.fits'.format(ii) for ii in fnum_c_4_60
    ]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'FLD2_60_sky.fits',
                            flat_frame=flat_dir + "flat.fits")

    return
Ejemplo n.º 27
0
def reduce_pleiades():
    sky_dir = root_dir + 'reduce/sky/'
    data_dir = root_dir + 'Pleiades/'
    flat_dir = root_dir + 'reduce/calib/'
    out_dir = root_dir + 'reduce/pleiades/'

    util.mkdir(out_dir)

    ##########
    # R-band
    ##########

    # Open Loop 15 s
    fnum = [31, 38, 45, 52, 59, 66]
    img_files = [data_dir + 'obj{0:04d}_o.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_r_15s.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # Closed Loop - a, 15s
    fnum = [30, 37, 44, 51, 58, 65, 72]
    img_files = [data_dir + 'obj{0:04d}_ca.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_r_15s.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # Closed Loop - b, 15s
    fnum = [28, 35, 42, 49, 56, 63, 70]
    img_files = [data_dir + "obj{0:04d}_cb.fits".format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_r_15s.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # Closed Loop - c, 15s
    fnum = [27, 34, 41, 48, 55, 62, 69]
    img_files = [data_dir + "obj{0:04d}_cc.fits".format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_r_15s.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # Closed Loop - d, 15s
    fnum = [26, 33, 40, 47, 54, 61, 68]
    img_files = [data_dir + "obj{0:04d}_cd.fits".format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_r_15s.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # Closed Loop - e, 15s
    fnum = [25, 32, 39, 46, 53, 60, 67]
    img_files = [data_dir + "obj{0:04d}_ce.fits".format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_r_15s.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # TT, 15s
    fnum = [29, 36, 43, 50, 57, 64, 71]
    img_files = [data_dir + "obj{0:04d}_tt.fits".format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_r_15s.fits',
                            flat_frame=flat_dir + 'flat.fits')

    ##########
    # I-band
    ##########
    # Open Loop 15 s
    fnum = [94, 101, 108, 115, 129]
    img_files = [data_dir + 'obj{0:04d}_o.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_r_15s.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # Closed Loop - a, 15s
    fnum = [93, 100, 107, 114, 128]
    img_files = [data_dir + 'obj{0:04d}_ca.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_r_15s.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # Closed Loop - b, 15s
    fnum = [91, 98, 105, 112, 119]
    img_files = [data_dir + "obj{0:04d}_cb.fits".format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_r_15s.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # Closed Loop - c, 15s
    fnum = [90, 97, 104, 111, 118, 125]
    img_files = [data_dir + "obj{0:04d}_cc.fits".format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_r_15s.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # Closed Loop - d, 15s
    fnum = [89, 96, 103, 110, 117, 124]
    img_files = [data_dir + "obj{0:04d}_cd.fits".format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_r_15s.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # Closed Loop - e, 15s
    fnum = [88, 95, 102, 109, 116, 123]
    img_files = [data_dir + "obj{0:04d}_ce.fits".format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_r_15s.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # TT, 15s
    fnum = [92, 99, 106, 113, 120, 127]
    img_files = [data_dir + "obj{0:04d}_tt.fits".format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_r_15s.fits',
                            flat_frame=flat_dir + 'flat.fits')

    return
Ejemplo n.º 28
0
def reduce_FLD2():
    sky_dir = root_dir + 'reduce/sky/' 
    data_dir = root_dir + 'FLD2_2/'
    flat_dir = root_dir + 'reduce/calib/'
    out_dir = root_dir + 'reduce/FLD2_2/'
    
    util.mkdir(out_dir)

    
    # Open Loop
    fnum = [124, 129, 135, 141, 147, 153, 159, 165, 171, 177, 183, 189, 195]
    fnum += [201, 207, 215, 221, 227, 233, 239, 245, 251, 257, 263, 269]
    img_files = [data_dir + 'obj{0:04d}_o.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files, out_dir, rebin=1, sky_frame=sky_dir + 'FLD2_2_sky.fits', flat_frame=flat_dir + 'flat.fits')


    # Closed
    fnum = [126, 128, 134, 140, 146, 152, 158, 164, 170, 176, 182, 188, 194]
    fnum += [200, 206, 212, 214, 220, 226, 232, 238, 244, 250, 256, 262, 268]
    img_files = [data_dir + 'obj{0:04d}_c.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files, out_dir, rebin=1, sky_frame=sky_dir + 'FLD2_2_sky.fits', flat_frame = flat_dir + 'flat.fits')

    # Closed A
    fnum = [125, 127, 130, 136, 142, 148, 154, 160, 166, 172, 178, 184, 190]
    fnum += [196, 202, 208, 216, 222, 228, 234, 240, 246, 252, 258, 264, 270]
    img_files = [data_dir + 'obj{0:04d}_cA.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files, out_dir, rebin=1, sky_frame=sky_dir + 'FLD2_2_sky.fits', flat_frame = flat_dir + 'flat.fits')

    # Closed B
    fnum = [131, 137, 143, 149, 155, 161, 167, 173, 179, 185, 191, 197, 203]
    fnum += [209, 217, 223, 229, 235, 241, 247, 253, 259, 265, 271]
    img_files = [data_dir + 'obj{0:04d}_cB.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files, out_dir, rebin=1, sky_frame=sky_dir + 'FLD2_2_sky.fits', flat_frame = flat_dir + 'flat.fits')

    # Closed C
    fnum = [132, 138, 144, 150, 156, 162, 168, 174, 180, 186, 192, 198, 204]
    fnum += [210, 218, 224, 230, 236, 242, 248, 254, 260, 266, 272]
    img_files = [data_dir + 'obj{0:04d}_cC.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files, out_dir, rebin=1, sky_frame=sky_dir + 'FLD2_2_sky.fits', flat_frame = flat_dir + 'flat.fits')

    # Closed D
    fnum = [133, 139, 145, 151, 157, 163, 169, 175, 181, 187, 193, 199, 205]
    fnum += [211, 219, 225, 231, 237, 243, 249, 255, 261, 267, 273]
    img_files = [data_dir + 'obj{0:04d}_cD.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files, out_dir, rebin=1, sky_frame=sky_dir + 'FLD2_2_sky.fits', flat_frame = flat_dir + 'flat.fits')
    
    
    return
Ejemplo n.º 29
0
def reduce_pleiades():
    sky_dir = root_dir + 'reduce/sky/'
    data_dir = root_dir + 'Pleiades/'
    flat_dir = root_dir + 'reduce/calib/'
    out_dir = root_dir + 'reduce/pleiades/'

    #util.mkdir(out_dir)

    # Open Loop
    fnum = [22, 28, 34, 40, 46]
    fnum += [52, 58, 65, 72, 79, 86]
    fnum += [98, 105, 112, 119, 126, 133, 140, 147]
    fnum += [159, 166, 173, 180, 187, 195, 202, 209]
    fnum += [216, 223, 230, 237]
    img_files = [data_dir + 'obj{0:04d}_o.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # Closed Loop - a
    fnum = [27, 33, 39, 45, 51]
    fnum += [57, 64, 71, 78, 85]
    fnum += [104, 111, 118, 125, 132, 139, 146]
    fnum += [153, 165, 172, 179, 194, 201, 208]
    fnum += [215, 222, 229, 236]
    img_files = [data_dir + 'obj{0:04d}_ca.fits'.format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # Closed Loop - b
    fnum = [25, 31, 37, 43, 49]
    fnum += [55, 62, 69, 76, 83, 90]
    fnum += [102, 109, 116, 123, 130, 137, 144, 151]
    fnum += [163, 170, 177, 184, 191, 199, 206, 213]
    fnum += [220, 227, 234, 241]
    img_files = [data_dir + "obj{0:04d}_cb.fits".format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # Closed Loop - c
    fnum = [24, 30, 36, 42, 48]
    fnum += [54, 61, 68, 75, 82, 89]
    fnum += [101, 108, 115, 122, 129, 136, 143, 150]
    fnum += [162, 169, 176, 183, 190, 198, 205, 212]
    fnum += [219, 226, 233, 240]
    img_files = [data_dir + "obj{0:04d}_cc.fits".format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # Closed Loop - d
    fnum = [23, 29, 35, 41, 47]
    fnum += [53, 60, 67, 74, 81, 88]
    fnum += [100, 107, 114, 121, 128, 135, 142, 149]
    fnum += [161, 168, 175, 182, 189, 197, 204, 211]
    fnum += [218, 225, 232, 239]
    img_files = [data_dir + "obj{0:04d}_cd.fits".format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky.fits',
                            flat_frame=flat_dir + 'flat.fits')

    # Closed Loop - f
    fnum = [26, 32, 38, 44, 50]
    fnum += [56, 63, 70, 77, 84, 91, 92]
    fnum += [103, 110, 117, 124, 131, 138, 145, 152]
    fnum += [164, 171, 178, 185, 192, 200, 207, 214]
    fnum += [221, 228, 235]
    img_files = [data_dir + "obj{0:04d}_cf.fits".format(ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky.fits',
                            flat_frame=flat_dir + 'flat.fits')

    return
Ejemplo n.º 30
0
def reduce_pleiades():
    sky_dir = root_dir + 'reduce/sky/'
    data_dir = root_dir + 'Pleiades/'
    flat_dir = root_dir + 'reduce/calib/'
    out_dir = root_dir + 'reduce/pleiades/'

    util.mkdir(out_dir)

    #####
    # Open Loop First Half
    #####
    ###What to do with obj_o594-597??? look at images to see orientation
    ###obj_o640 has a 0.5s integration time...whut
    ###obj_o613.fits in log but not in data.... also 624
    fnum1 = [
        34, 35, 36, 43, 44, 45, 56, 57, 58, 59, 68, 69, 70, 71, 83, 84, 85, 86
    ]
    fnum2 = [95, 96, 97, 98, 480, 582, 583, 584, 585]
    fnum = fnum1 + fnum2
    img_files = ['{0:s}/obj_o{1:03d}.fits'.format(data_dir, ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_46.fits',
                            flat_frame=flat_dir + 'flat.fits')

    #####
    # Open Loop Second Half
    #####
    fnum1 = [609, 610, 611, 612, 622, 623, 624, 636, 637, 638, 639, 1010, 1011]
    fnum2 = [
        1012, 1013, 1022, 1023, 1024, 1025, 1034, 1035, 1036, 1037, 1049, 1052,
        1061
    ]
    fnum3 = [
        1062, 1063, 1064, 1073, 1074, 1075, 1076, 1088, 1089, 1090, 1091, 1104,
        1105
    ]
    fnum4 = [1106, 1107]
    fnum = fnum1 + fnum2 + fnum3 + fnum4
    img_files = ['{0:s}/obj_o{1:03d}.fits'.format(data_dir, ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_598.fits',
                            flat_frame=flat_dir + 'flat.fits')

    #####
    # TTF Closed Loop First Half
    #####
    ###obj_ttf541.fits in log but not data
    fnum1 = [
        37, 38, 39, 49, 50, 51, 60, 61, 62, 63, 75, 76, 77, 78, 87, 88, 89, 90
    ]
    fnum2 = [586, 587, 588, 589]
    fnum = fnum1 + fnum2
    img_files = [
        '{0:s}/obj_ttf{1:03d}.fits'.format(data_dir, ii) for ii in fnum
    ]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_46.fits',
                            flat_frame=flat_dir + 'flat.fits')

    #####
    # TTF Closed Loop Second Half
    #####
    ###obj_ttf617 not in file but in log
    fnum1 = [
        601, 602, 603, 604, 614, 615, 616, 629, 630, 631, 1014, 1015, 1016,
        1017
    ]
    fnum2 = [
        1026, 1027, 1028, 1029, 1041, 1042, 1043, 1044, 1053, 1054, 1055, 1056,
        1065
    ]
    fnum3 = [1066, 1067, 1068, 1080, 1081, 1082, 1083, 1092, 1093, 1094, 1095]
    fnum = fnum1 + fnum2 + fnum3
    img_files = [
        '{0:s}/obj_ttf{1:03d}.fits'.format(data_dir, ii) for ii in fnum
    ]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_598.fits',
                            flat_frame=flat_dir + 'flat.fits')

    #####
    # Closed Loop First Half
    #####
    #obj_c102-103, 407-416, 573-574 have 1s or 0.1s integration times... not reduced
    fnum1 = [
        31, 32, 33, 40, 41, 42, 52, 53, 54, 55, 64, 65, 66, 67, 79, 80, 81, 82,
        91, 92
    ]
    fnum2 = [
        93, 94, 417, 448, 479, 577, 578, 579, 580, 581, 590, 591, 592, 593
    ]
    fnum = fnum1 + fnum2
    img_files = ['{0:s}/obj_c{1:03d}.fits'.format(data_dir, ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_46.fits',
                            flat_frame=flat_dir + 'flat.fits')

    #####
    # Closed Loop Second Half
    #####
    ###obj_c641 has 0.5s integration time
    ###obj_c621.fits doesn't exist in file, only in log
    fnum1 = [
        605, 606, 607, 608, 618, 619, 620, 632, 633, 634, 635, 1006, 1007, 1008
    ]
    fnum2 = [
        1009, 1018, 1019, 1020, 1021, 1030, 1031, 1032, 1033, 1045, 1046, 1047,
        1048
    ]
    fnum3 = [
        1057, 1058, 1059, 1060, 1069, 1070, 1071, 1072, 1084, 1085, 1086, 1087,
        1096
    ]
    fnum4 = [1097, 1098, 1099]
    fnum = fnum1 + fnum2 + fnum3 + fnum4
    img_files = ['{0:s}/obj_c{1:03d}.fits'.format(data_dir, ii) for ii in fnum]
    reduce_fli.clean_images(img_files,
                            out_dir,
                            rebin=1,
                            sky_frame=sky_dir + 'pleiades_sky_598.fits',
                            flat_frame=flat_dir + 'flat.fits')

    return