Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: XMatch two Vizier catalogs then no col refs should be added #1464

Closed
bsipocz opened this issue May 21, 2019 · 1 comment · Fixed by #3168
Closed

BUG: XMatch two Vizier catalogs then no col refs should be added #1464

bsipocz opened this issue May 21, 2019 · 1 comment · Fixed by #3168

Comments

@bsipocz
Copy link
Member

bsipocz commented May 21, 2019

When matching two catalogs from Vizier no reference columns should be specified, currently we're wrongly raise an exception:

In [17]: from astropy import units as u
    ...: from astroquery.xmatch import XMatch
    ...: table = XMatch.query_async(cat1='vizier:J/A+A/331/81/table2', cat2='vizier:IV/34/epic', max_distance=5 * u.arcsec)
    ...: 
    ...: 
    ...: 
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-17-6263e825bbc7> in <module>()
      1 from astropy import units as u
      2 from astroquery.xmatch import XMatch
----> 3 table = XMatch.query_async(cat1='vizier:J/A+A/331/81/table2', cat2='vizier:IV/34/epic', max_distance=5 * u.arcsec)
      4 

~/munka/devel/astroquery/astroquery/xmatch/core.py in query_async(self, cat1, cat2, max_distance, colRA1, colDec1, colRA2, colDec2, cache, get_query_payload)
     83         kwargs = {}
     84 
---> 85         self._prepare_sending_table(1, payload, kwargs, cat1, colRA1, colDec1)
     86         self._prepare_sending_table(2, payload, kwargs, cat2, colRA2, colDec2)
     87 

~/munka/devel/astroquery/astroquery/xmatch/core.py in _prepare_sending_table(self, i, payload, kwargs, cat, colRA, colDec)
    115         if not self.is_table_available(cat):
    116             if ((colRA is None) or (colDec is None)):
--> 117                 raise ValueError('Specify the name of the RA/Dec columns in' +
    118                                  ' the input table.')
    119             # if `cat1` is not a VizieR table,

ValueError: Specify the name of the RA/Dec columns in the input table.
@ManonMarchand
Copy link
Member

This is not a bug, J/A+A/331/81/table2 is not available on the cross match server because this VizieR table has no coordinates and cannot be crossmatched.

Since the error message was confusing, the linked PR tries to make the two possible reasons for failure clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants