Esempio n. 1
0
def perform_conesearch(ra, dec, search_radius, catalog=None, verbose=True):
    """
    Perform a conesearch using astropy's VO capabilities

    --- INPUT ---
    ra                  richt ascension [deg]
    dec                 declination     [deg]
    search_radius       radius around ra and dec to search [deg]
    catalo              name of catalog to search; set to None to get option printed
    --- EXAMPLE OF USE ---
    import MUSE_AOsetup as mao
    catalog         = 'guide*star'
    catalog         = 'Guide Star Catalog v2 1'
    search_result   = mao.perform_conesearch(177.3992,22.39885,0.05,catalog=catalog)
    """

    if catalog == None:
        print ' - No catalog selected, please choose from the following list (wildcards ok, e.g., "guide*star":'
        for cat in conesearch.list_catalogs():
            print '  ', cat
        return None
    else:
        if verbose:            print ' - Performing cone search in radius ',search_radius,\
    ' deg around (ra,dec) = (',ra,',',dec,')'

    cat_list = conesearch.list_catalogs(pattern=catalog)

    obj_coord = ICRS(ra=ra * units.deg, dec=dec * units.deg)

    search_result = conesearch.search_all(obj_coord,
                                          search_radius * units.deg,
                                          catalog_db=cat_list)

    if verbose:
        print ' - Searched ', len(
            search_result
        ), ' catalogs. Each catalog contains the following number of entries:'
        print ' '
        for url, tab in search_result.items():
            print '   CatUrl: ', url
            print '   TabCol: ', tab.nrows
            print '   Nrows : ', tab.array.data.dtype.names
            print ' '

    return search_result
Esempio n. 2
0
def perform_conesearch(ra,dec,search_radius,catalog=None,verbose=True):
    """
    Perform a conesearch using astropy's VO capabilities

    --- INPUT ---
    ra                  richt ascension [deg]
    dec                 declination     [deg]
    search_radius       radius around ra and dec to search [deg]
    catalo              name of catalog to search; set to None to get option printed
    --- EXAMPLE OF USE ---
    import MUSE_AOsetup as mao
    catalog         = 'guide*star'
    catalog         = 'Guide Star Catalog v2 1'
    search_result   = mao.perform_conesearch(177.3992,22.39885,0.05,catalog=catalog)
    """

    if catalog == None:
        print ' - No catalog selected, please choose from the following list (wildcards ok, e.g., "guide*star":'
        for cat in conesearch.list_catalogs(): print '  ',cat
        return None
    else:
        if verbose: print ' - Performing cone search in radius ',search_radius,\
            ' deg around (ra,dec) = (',ra,',',dec,')'

    cat_list = conesearch.list_catalogs(pattern=catalog)

    obj_coord = ICRS(ra=ra*units.deg, dec=dec*units.deg)

    search_result = conesearch.search_all(obj_coord, search_radius*units.deg, catalog_db=cat_list)

    if verbose:
        print ' - Searched ',len(search_result),' catalogs. Each catalog contains the following number of entries:'
        print ' '
        for url, tab in search_result.items():
            print '   CatUrl: ',url
            print '   TabCol: ',tab.nrows
            print '   Nrows : ',tab.array.data.dtype.names
            print ' '

    return search_result
Esempio n. 3
0
 def get_catalogs(self):
     return conesearch.list_catalogs()
Esempio n. 4
0
 def get_catalogs(self):
     return conesearch.list_catalogs()