[AstroPy] error reading Vizier votable with atpy
Thomas Robitaille
thomas.robitaille at gmail.com
Wed Dec 7 18:28:15 EST 2011
Hi Jerome,
What version of ATpy are you using? Do you get the same error with the
latest developer version of ATpy? You can get it with:
git clone git://github.com/atpy/atpy.git
cd atpy
python setup.py install
Let me know if it still fails with this version.
Cheers,
Tom
On 7 December 2011 23:07, Jerome Caron <jerome_caron_astro at ymail.com> wrote:
> 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!")
>
>
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy
>
More information about the AstroPy
mailing list