Skip to content

Simbad query_region() fails when radius is set to small values. #369

@rickyegeland

Description

@rickyegeland

Example:

>>> result = astroquery.simbad.Simbad.query_region(coord.ICRS("00h00m0.0s 00h00m0.0s"), radius=1.0 * u.marcsec, equinox=2000.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/egeland/Code/sunstardb/lib/python2.7/site-packages/astroquery-0.2.dev1928-py2.7.egg/astroquery/simbad/core.py", line 440, in query_region
    equinox=equinox, epoch=epoch)
  File "/Users/egeland/Code/sunstardb/lib/python2.7/site-packages/astroquery-0.2.dev1928-py2.7.egg/astroquery/simbad/core.py", line 470, in query_region_async
    caller='query_region_async')
  File "/Users/egeland/Code/sunstardb/lib/python2.7/site-packages/astroquery-0.2.dev1928-py2.7.egg/astroquery/simbad/core.py", line 44, in wrapper
    return func(*args, **kwargs)
  File "/Users/egeland/Code/sunstardb/lib/python2.7/site-packages/astroquery-0.2.dev1928-py2.7.egg/astroquery/simbad/core.py", line 60, in wrapper
    return func(*args, **kwargs)
  File "/Users/egeland/Code/sunstardb/lib/python2.7/site-packages/astroquery-0.2.dev1928-py2.7.egg/astroquery/simbad/core.py", line 681, in _args_to_payload
    kwargs['radius'] = _parse_radius(kwargs['radius'])
  File "/Users/egeland/Code/sunstardb/lib/python2.7/site-packages/astroquery-0.2.dev1928-py2.7.egg/astroquery/simbad/core.py", line 765, in _parse_radius
    index = min([i for (i,val) in enumerate(angle.dms) if int(val) > 0])
ValueError: min() arg is an empty sequence
>>> result = astroquery.simbad.Simbad.query_region(coord.ICRS("00h00m0.0s 00h00m0.0s"), radius=1.0 * u.marcsec, equinox=2000.0, epoch='J2000')

I was deliberately trying to make a query that returns no results, in order to make a test case. It seems something falls apart in this case. u is astropy.units.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions