如何使用PyVO查询USNO目录?

时间:2017-02-24 11:14:34

标签: python astronomy astropy

我尝试使用PyVO使用简单的锥形搜索使用USNO目录查询给定位置(Ra,Dec in degrees)。输入参数pyvo.dal.scs.search查询采用的是:查询网址,位置元组,搜索半径和详细程度。

问题出现在查询网址上。根据USNO website,查询网址应采用以下形式:

http://www.nofs.navy.mil/cgi-bin/vo_cone.cgi?CAT=USNO-B1&RA=1.0&DEC=-10.0&SR=0.1&VERB=1

但是如果我输入

http://www.nofs.navy.mil/cgi-bin/vo_cone.cgi?CAT=USNO-B1&

作为查询网址,我得到以下输出:

---------------------------------------------------------------------------
DALFormatError                            Traceback (most recent call last)
<ipython-input-133-450dcb39a4d8> in <module>()
----> 1 uobjs_0 = vo.dal.scs.search('http://www.nofs.navy.mil/cgi-bin/vo_cone.cgi?CAT=USNO-B1&', (ra[0],dec[0]), 0.25)

/usr/local/lib/python2.7/dist-packages/pyvo-0.4.1-py2.7.egg/pyvo/dal/scs.pyc in search(url, pos, radius, verbosity)
     73     """
     74     service = SCSService(url)
---> 75     return service.search(pos, radius, verbosity)
     76 
     77 class SCSService(query.DALService):

/usr/local/lib/python2.7/dist-packages/pyvo-0.4.1-py2.7.egg/pyvo/dal/scs.pyc in search(self, pos, radius, verbosity)
    134         """
    135         q = self.create_query(pos, radius, verbosity)
--> 136         return q.execute()
    137 
    138     def create_query(self, pos=None, radius=None, verbosity=None):

/usr/local/lib/python2.7/dist-packages/pyvo-0.4.1-py2.7.egg/pyvo/dal/scs.pyc in execute(self)
    341         pyvo.dal.query.DALQueryError
    342         """
--> 343         return SCSResults(self.execute_votable(), self.getqueryurl(True))
    344 
    345     def execute_votable(self):

/usr/local/lib/python2.7/dist-packages/pyvo-0.4.1-py2.7.egg/pyvo/dal/scs.pyc in execute_votable(self)
    369                                        "deprecated DEFINITIONS element")
    370         except Exception as e:
--> 371             raise query.DALFormatError(e, self.getqueryurl())
    372 
    373     def getqueryurl(self, lax=False):

DALFormatError: BadStatusLine: BadStatusLine

我也试过

http://www.nofs.navy.mil/cgi-bin/vo_cone.cgi?

类似于工作的SDSS查询url;但是,由于目录名称不包含在上述输入参数列表中,因此显然会出现错误。有没有办法可以使用PyVO成功查询USNO目录?

0 个答案:

没有答案