예제 #1
0
def align_year_pos(year, filt, pos):
    """
    Align a set of starlists for the specified year and mosaic position into
    a common reference frame. Do this iteratively until we get good positions 
    and uncertainties.
    """
    year = str(year)

    # All codes will be run in the work directory. 
    # The data directory is relative to the work directory.
    suffix = '_' + pos

    images = imgs[year][filt][pos]
    N_images = len(images)

    
    # First pass runs with the reference simply being the first image.
    red.xym2mat('ref0', year, filt, dir_suffix=suffix,
                mag='m-11,-9', clobber=True)
    red.xym2bar('ref0', year, filt, dir_suffix=suffix,
                Nepochs=N_images, clobber=True)
    
    # Second pass uses the matchup file as the reference.
    red.xym2mat('ref1', year, filt, dir_suffix=suffix,
                ref='MATCHUP.XYMEEE.ref0', ref_camera='c0', 
                ref_mag='m-11.5,-6', mag='m-11.5,-6', radius_key=[22, 24])
    red.xym2bar('ref1', year, filt, dir_suffix=suffix,
                Nepochs=N_images, make_lnk=True)

    

    return
예제 #2
0
def xym_acswfc_pass2():
    """
    Re-do the alignment with the new positive master file. Edit IN.xym2mat to 
    change 00 epoch to use the generated matchup file with f5, c0 
    (MATCHUP.XYMEEE.01.all.positive). Make sure to remove all the old MAT.* and 
    TRANS.xym2mat files because there is a big shift in the transformation from 
    the first time we ran it.
    """
    year = '2010'
    filt = 'F814W'

    xym_dir = '{0}_{1}/01.XYM/'.format(year, filt)

    flystar.xym2mat('ref2',
                    year,
                    filt,
                    camera='f5 c5',
                    mag='m-14,-13',
                    ref='MATCHUP.XYMEEE.ref1.positive',
                    ref_mag='m-14,-13',
                    ref_camera='f5 c0',
                    clobber=True)
    flystar.xym2bar('ref2',
                    year,
                    filt,
                    Nepochs=6,
                    zeropoint='',
                    camera='f5 c5',
                    clobber=True)
예제 #3
0
def align_year(year, filt, recopy=False):
    """
    Align all the MATCHUP starlists (produced from align_year_pos()) for a given
    epoch. Do this iteratively. In the first pass, align to an F814W image. On the 
    second and third pass, align to the results from the first pass.
    """
    year = str(year)

    dir_work = year + '_' + filt
    dir_xym = year + '_' + filt + '/01.XYM/'

    all_pos = ['pos1', 'pos2', 'pos3', 'pos4']

    # Make directories
    if not os.path.exists(dir_work):
        os.makedirs(dir_work)
        os.makedirs(dir_xym)

    # Copy over files.
    if recopy:
        dir_xym_old = '../' + year + '_' + filt + '/01.XYM/'
        
        for pos in all_pos:
            for image in imgs[year][filt][pos]:
                shutil.copy(dir_xym_old + image + '_flt.xym', dir_xym)

        # Copy over the F814 file
        shutil.copy('MATCHUP.XYMEEE.f814w', dir_xym)


    # Stars must be detected in all the frames in one pointing.
    N_images = len(imgs[year][filt]['pos1'])

    # First pass runs with the reference simply being the first image.
    red.xym2mat('ref0', year, filt, mag='m-99,-13', radius_key=[10], 
                ref='MATCHUP.XYMEEE.f814w', ref_camera='f5 c0', ref_mag='m-99,-17',
                clobber=True)
    red.xym2mat('ref1', year, filt, mag='m-99,-13', radius_key=[10], 
                ref='MATCHUP.XYMEEE.f814w', ref_camera='f5 c0', ref_mag='m-99,-17')
    red.xym2mat('ref2', year, filt, mag='m-99,-10', radius_key=[10], 
                ref='MATCHUP.XYMEEE.f814w', ref_camera='f5 c0', ref_mag='m-99,-13')
    red.xym2mat('ref3', year, filt, mag='m-99,-08', radius_key=[10, 17], 
                ref='MATCHUP.XYMEEE.f814w', ref_camera='f5 c0', ref_mag='m-99,-10')

    red.xym2bar('ref3', year, filt, Nepochs=N_images, clobber=True)
    
    # Next-to-last pass uses the matchup file as the reference.
    red.xym2mat('ref4', year, filt, ref='MATCHUP.XYMEEE.ref3', ref_camera='c0', 
                ref_mag='m-11.5,-6', mag='m-11.5,-6', radius_key=[22, 24])
    red.xym2bar('ref4', year, filt, Nepochs=N_images, make_lnk=True)
    
    return
예제 #4
0
def xym_acswfc_pass1():
    """
    Match and align all of the exposures. Make a new star list (requiring 6 out of
    7 images). Also make sure the new starlist has only positive pxel values.
    """
    year = '2010'
    filt = 'F814W'

    flystar.xym2mat('ref1', year, filt, camera='f5 c5', mag='m-18,-14', clobber=True)
    flystar.xym2bar('ref1', year, filt, camera='f5 c5', Nepochs=6, clobber=True)

    xym_dir = '{0}/2010_F814W/01.XYM/'.format(workDir)
    starlists.make_matchup_positive(xym_dir + 'MATCHUP.XYMEEE.ref1')
예제 #5
0
def xym_acswfc_pass3():
    """
    Re-do the alignment with the new positive master file. Edit IN.xym2mat to 
    change 00 epoch to use the generated matchup file with f5, c0 
    (MATCHUP.XYMEEE.01.all.positive). Make sure to remove all the old MAT.* and 
    TRANS.xym2mat files because there is a big shift in the transformation from 
    the first time we ran it.
    """
    year = '2010'
    filt = 'F814W'

    xym_dir = '{0}_{1}/01.XYM/'.format(year, filt)

    flystar.xym2mat('ref3', year, filt, camera='f5 c5', mag='m-14,-11',
                    ref='MATCHUP.XYMEEE.ref1.positive', ref_mag='m-14,-11',
                    ref_camera='f5 c0', clobber=True)
    flystar.xym2bar('ref3', year, filt, Nepochs=6, zeropoint='', 
                    camera='f5 c5', clobber=True)
예제 #6
0
def xym_acswfc_pass1():
    """
    Match and align all of the exposures. Make a new star list (requiring 6 out of
    7 images). Also make sure the new starlist has only positive pxel values.
    """
    year = '2010'
    filt = 'F814W'

    flystar.xym2mat('ref1',
                    year,
                    filt,
                    camera='f5 c5',
                    mag='m-18,-14',
                    clobber=True)
    flystar.xym2bar('ref1',
                    year,
                    filt,
                    camera='f5 c5',
                    Nepochs=6,
                    clobber=True)

    xym_dir = '{0}/2010_F814W/01.XYM/'.format(workDir)
    starlists.make_matchup_positive(xym_dir + 'MATCHUP.XYMEEE.ref1')