[AstroPy] error reading Vizier votable with atpy
Jerome Caron
jerome_caron_astro at ymail.com
Wed Dec 7 17:07:38 EST 2011
Dear list,
I am trying to write a simple script to send queries to Vizier and retrieve star positions and magnitudes.
At the moment my script works well for all catalogs except for USNO-B1.
I get the following error message:
numpy.dtype size changed, may indicate binary incompatibility
numpy.dtype size changed, may indicate binary incompatibility
out.xml:12:0: W22: The DEFINITIONS element is deprecated in VOTable 1.1. Ignoring
out.xml:12:0: W22: The DEFINITIONS element is deprecated in VOTable 1.1. Ignoring
Traceback (most recent call last):
File "C:\Documents and Settings\jerome caron\Desktop\test4.py", line 17, in <module>
data = atpy.Table(op.name,type='vo',pedantic=False)
File "C:\Python26\lib\site-packages\atpy\basetable.py", line 167, in __init__
self.read(*args, **kwargs)
File "C:\Python26\lib\site-packages\atpy\basetable.py", line 213, in read
atpy._readers[table_type](self, *args, **kwargs)
File "C:\Python26\lib\site-packages\atpy\votable.py", line 115, in read
self.add_column(colname, table.array[colname], \
File "C:\Python26\lib\site-packages\numpy\core\records.py", line 455, in __getitem__
obj = ndarray.__getitem__(self, indx)
ValueError: field named USNO_B1_0 not found.
Press any key to continue . . .
Can anyone give some help ?
My script is at the end of the email, and the votable attached.
Thank very much !
Cheers
Jerome Caron
-----------------------------------
The script:
# -*- coding: iso_8859_1 -*-
import atpy, urllib
fp = urllib.urlopen("http://webviz.u-strasbg.fr/viz-bin/votable/?-source=2MASS-PSC&-c=IC458&-c.rm=5&-out.max=unlimited")
op = open("out.xml", "wb")
while 1:
s = fp.read(8192)
if not s:
break
op.write(s)
fp.close()
op.close()
data = atpy.Table(op.name,type='vo',pedantic=False)
print data.describe()
print data.columns
raw_input("done!")
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20111207/01a3e590/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: usno-b1.vot
Type: application/octet-stream
Size: 26260 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/astropy/attachments/20111207/01a3e590/attachment.obj>
More information about the AstroPy
mailing list