コード例 #1
0
def run_all_GLASSclusters(search_radius=0.16666,printcommand=True,catalog=None,verbose=True):
    """
    Perform cone search and generate the object region files for all 10 GLASS clusters

    --- INPUT ---
    search_radius       radius around ra and dec to search [deg]
    printcommand        Print DS9 command instead of opening the files?

    --- EXAMPLE OF USE ---
    import MUSE_AOsetup as mao
    mao.run_all_GLASSclusters(0.16666)

    """
    search_catalog     = 'Guide Star Catalog v2 1'
    cluster_dic        = mao.clusterinfo()
    if verbose: print ' - Search catalog set ('+search_catalog+') and cluster info loaded '

    if verbose: print ' - Searching for objects within '+str(search_radius)+' degrees of the cluster '
    for key in cluster_dic.keys():
        cli            = cluster_dic[key]
        if verbose: print '========================='+cli['name']+'========================='
        # -------------------- SEARCH via VO --------------------
        search_result  = mao.perform_conesearch(cli['ra'],cli['dec'],search_radius,
                                                catalog=search_catalog,verbose=verbose)
        conesearchfile = '/Users/kschmidt/work/MUSE/call_PublicDeepFied/'+\
                         cli['name']+'_conesearch_'+search_catalog.replace(' ','_')+\
                         '_Rsearch_'+str(search_radius).replace('.','p')
        mao.save_conesearch(search_result,filename=conesearchfile,verbose=verbose)
        if os.path.isfile(conesearchfile+'.txt'):
            mao.create_objectDS9reg(conesearchfile+'.txt','ra','dec',['RMag','RMag','VMag'],verbose=verbose)

        # -------------------- SEARCH GSPC --------------------
        GSPC_search_radius = 1.0 #deg
        GSPCsearchfile = '/Users/kschmidt/work/MUSE/call_PublicDeepFied/'+\
                         cli['name']+'_GSPCv2p4search_Rsearch_'+str(GSPC_search_radius).replace('.','p')+'.fits'

        mao.search_GSPCv2p4(GSPCsearchfile,cli['ra'],cli['dec'],GSPC_search_radius,clobber=False,verbose=True)
        if os.path.isfile(GSPCsearchfile):
            mao.create_objectDS9reg(GSPCsearchfile,'RAJ2000','DEJ2000',['Rmag','Rmag','Vmag'],id_name='ID')

        # -------------------- SEARCH CLASH --------------------
        if ('A370' not in key) and ('A2744' not in key):
            outputcat = mao.search_CLASHcat(key,search_radius=search_radius,verbose=True)
            mao.create_objectDS9reg(outputcat,'ra','dec',['f606w_mag','f606w_mag','f606w_mag'],
                                    id_name='id',star_name='stel')

        # -------------------- SEARCH ROMAN --------------------
        outputcat = mao.search_ROMANcat(key,search_radius=search_radius,verbose=True)
        if outputcat != None:
            mao.create_objectDS9reg(outputcat,'RA','DEC',['V606','V606','V606'],id_name='ID')

    if printcommand:
        if verbose: print '\n\n - To open the fits files use the DS9 command:'
    mao.open_fits_and_regions('all',printcommand=printcommand,verbose=verbose)
コード例 #2
0
ファイル: MUSE_AOsetup.py プロジェクト: kasperschmidt/python
def run_all_GLASSclusters(search_radius=0.16666,
                          printcommand=True,
                          catalog=None,
                          verbose=True):
    """
    Perform cone search and generate the object region files for all 10 GLASS clusters

    --- INPUT ---
    search_radius       radius around ra and dec to search [deg]
    printcommand        Print DS9 command instead of opening the files?

    --- EXAMPLE OF USE ---
    import MUSE_AOsetup as mao
    mao.run_all_GLASSclusters(0.16666)

    """
    search_catalog = 'Guide Star Catalog v2 1'
    cluster_dic = mao.clusterinfo()
    if verbose:
        print ' - Search catalog set (' + search_catalog + ') and cluster info loaded '

    if verbose:
        print ' - Searching for objects within ' + str(
            search_radius) + ' degrees of the cluster '
    for key in cluster_dic.keys():
        cli = cluster_dic[key]
        if verbose:
            print '=========================' + cli[
                'name'] + '========================='
        # -------------------- SEARCH via VO --------------------
        search_result = mao.perform_conesearch(cli['ra'],
                                               cli['dec'],
                                               search_radius,
                                               catalog=search_catalog,
                                               verbose=verbose)
        conesearchfile = '/Users/kschmidt/work/MUSE/call_PublicDeepFied/'+\
                         cli['name']+'_conesearch_'+search_catalog.replace(' ','_')+\
                         '_Rsearch_'+str(search_radius).replace('.','p')
        mao.save_conesearch(search_result,
                            filename=conesearchfile,
                            verbose=verbose)
        if os.path.isfile(conesearchfile + '.txt'):
            mao.create_objectDS9reg(conesearchfile + '.txt',
                                    'ra',
                                    'dec', ['RMag', 'RMag', 'VMag'],
                                    verbose=verbose)

        # -------------------- SEARCH GSPC --------------------
        GSPC_search_radius = 1.0  #deg
        GSPCsearchfile = '/Users/kschmidt/work/MUSE/call_PublicDeepFied/'+\
                         cli['name']+'_GSPCv2p4search_Rsearch_'+str(GSPC_search_radius).replace('.','p')+'.fits'

        mao.search_GSPCv2p4(GSPCsearchfile,
                            cli['ra'],
                            cli['dec'],
                            GSPC_search_radius,
                            clobber=False,
                            verbose=True)
        if os.path.isfile(GSPCsearchfile):
            mao.create_objectDS9reg(GSPCsearchfile,
                                    'RAJ2000',
                                    'DEJ2000', ['Rmag', 'Rmag', 'Vmag'],
                                    id_name='ID')

        # -------------------- SEARCH CLASH --------------------
        if ('A370' not in key) and ('A2744' not in key):
            outputcat = mao.search_CLASHcat(key,
                                            search_radius=search_radius,
                                            verbose=True)
            mao.create_objectDS9reg(outputcat,
                                    'ra',
                                    'dec',
                                    ['f606w_mag', 'f606w_mag', 'f606w_mag'],
                                    id_name='id',
                                    star_name='stel')

        # -------------------- SEARCH ROMAN --------------------
        outputcat = mao.search_ROMANcat(key,
                                        search_radius=search_radius,
                                        verbose=True)
        if outputcat != None:
            mao.create_objectDS9reg(outputcat,
                                    'RA',
                                    'DEC', ['V606', 'V606', 'V606'],
                                    id_name='ID')

    if printcommand:
        if verbose: print '\n\n - To open the fits files use the DS9 command:'
    mao.open_fits_and_regions('all',
                              printcommand=printcommand,
                              verbose=verbose)