[AstroPy] Tr : Re : error reading Vizier votable with atpy

Jerome Caron jerome_caron_astro at ymail.com
Thu Dec 8 14:09:35 EST 2011


Sorry
I pressed "reply" and forgot to put the list address.. See my message below.
Cheers
Jerome

----- Mail transféré -----
De : Jerome Caron <jerome_caron_astro at ymail.com>
À : Thomas Robitaille <thomas.robitaille at gmail.com> 
Envoyé le : Jeudi 8 Décembre 2011 11h57
Objet : Re : Re : [AstroPy] error reading Vizier votable with atpy


Dear Thomas,
 
I installed version 0.9.5.3, now it works fine with USNO-B1 !
But I have problems with other catalogs which were ok initially (2MASS-PSC). Do you know what is happening ? It looks like the initial field names are modified at some point, and then not recognized later.
I copy the error message below.
 
In the meantime I solved the issue with a different script that is using the vo module (I also post it) and that works fine for all cases.
 
Cheers
The error message with atpy 0.9.5.3
 
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.  Ignori
ng
out.xml:41:4: W03: Implictly generating an ID from a name '2MASS' -> '_2MASS'
out.xml:41:4: W03: Implictly generating an ID from a name '2MASS' -> '_2MASS'
out.xml:12:0: W22: The DEFINITIONS element is deprecated in VOTable 1.1.  Ignori
ng
out.xml:41:4: W03: Implictly generating an ID from a name '2MASS' -> '_2MASS'
out.xml:41:4: W03: Implictly generating an ID from a name '2MASS' -> '_2MASS'
Traceback (most recent call last):
  File "C:\Documents and Settings\jerome caron\Desktop\vizier\test5.py", line 12
, 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 106, in read
    data = table.array[colname]
  File "C:\Python26\lib\site-packages\numpy\core\records.py", line 455, in __get
item__
    obj = ndarray.__getitem__(self, indx)
ValueError: field named 2MASS not found.
Press any key to continue . . .


The script based on vo, which works fine

# -*- coding: iso_8859_1 -*-
import matplotlib.pyplot as plt
import urllib
import numpy as np
fp = urllib.urlopen("http://webviz.u-strasbg.fr/viz-bin/votable/?-source=USNO-B1&-c=M45&-c.bm=600/600&B1mag=%3C13&-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()
from vo.table import parse_single_table
votable = parse_single_table("out.xml", pedantic=False)
data = votable.arrayraw_input("done!")


Jerome
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20111208/fad97710/attachment.html>


More information about the AstroPy mailing list