Closed cdeil closed 11 years ago
I can't reproduce the first error that you reported above. Using the module hosted in this repo, I get the following:
In [21]: import nedpy
In [32]: nedpy.query_ned_basic_posn('M32').names[:5]
Out[32]:
('pos_ref',
'pos_ra_equ_B1950_d',
'pos_dec_equ_B1950_d',
'pos_ra_equ_B1950_s',
'pos_dec_equ_B1950_s')
As to the second, I've added some basic error-catching routines to each of the routines in this module; this looks to see if the data returned from the NED server is a formatted XML file and if any results were found for the query. There are still queries which return ill-formatted Tables that result in errors (which cdeil mentioned in another issue). Either we take these examples to NED and ask them about the output format or we have to find a way to read in the string and fix it within the module. I'm open to either, but would like more data on which queries are still making this break.
Can you try with astroquery
?
I still only get default, not the actual, column names:
In [1]: from astroquery import ned
WARNING: ConfigurationDefaultMissingWarning: Requested default configuration file /Users/deil/Library/Python/2.7/lib/python/site-packages/astroquery-0.0.dev270-py2.7.egg/astroquery/astroquery.cfg is not a file. Cannot install default profile. If you are importing from source, this is expected. [astroquery]
In [2]: ned.query_ned_basic_posn('M32').colnames[:5]
WARNING: W42: /var/folders/sb/4qv5j4m90pz1rw7m70rj1b1r0000gn/T/tmphqq6fC:2:0: W42: No XML namespace specified [astropy.io.votable.exceptions]
WARNING: W22: /var/folders/sb/4qv5j4m90pz1rw7m70rj1b1r0000gn/T/tmphqq6fC:3:0: W22: The DEFINITIONS element is deprecated in VOTable 1.1. Ignoring [astropy.io.votable.exceptions]
WARNING: W04: /var/folders/sb/4qv5j4m90pz1rw7m70rj1b1r0000gn/T/tmphqq6fC:18:0: W04: content-type 'char' must be a valid MIME content type [astropy.io.votable.exceptions]
WARNING: W50: /var/folders/sb/4qv5j4m90pz1rw7m70rj1b1r0000gn/T/tmphqq6fC:26:0: W50: Invalid unit string 'degrees' [astropy.io.votable.exceptions]
WARNING: W50: /var/folders/sb/4qv5j4m90pz1rw7m70rj1b1r0000gn/T/tmphqq6fC:29:0: W50: Invalid unit string 'degrees' [astropy.io.votable.exceptions]
WARNING: W50: /var/folders/sb/4qv5j4m90pz1rw7m70rj1b1r0000gn/T/tmphqq6fC:38:0: W50: Invalid unit string 'arcseconds' [astropy.io.votable.exceptions]
WARNING: W50: /var/folders/sb/4qv5j4m90pz1rw7m70rj1b1r0000gn/T/tmphqq6fC:41:0: W50: Invalid unit string 'arcseconds' [astropy.io.votable.exceptions]
WARNING: W50: /var/folders/sb/4qv5j4m90pz1rw7m70rj1b1r0000gn/T/tmphqq6fC:44:0: W50: Invalid unit string 'arcseconds' [astropy.io.votable.exceptions]
WARNING: W50: /var/folders/sb/4qv5j4m90pz1rw7m70rj1b1r0000gn/T/tmphqq6fC:47:0: W50: Invalid unit string 'degrees' [astropy.io.votable.exceptions]
WARNING: W50: /var/folders/sb/4qv5j4m90pz1rw7m70rj1b1r0000gn/T/tmphqq6fC:50:0: W50: Invalid unit string 'degrees' [astropy.io.votable.exceptions]
WARNING: W50: /var/folders/sb/4qv5j4m90pz1rw7m70rj1b1r0000gn/T/tmphqq6fC:59:0: W50: Invalid unit string 'arcseconds' [astropy.io.votable.exceptions]
WARNING: W50: /var/folders/sb/4qv5j4m90pz1rw7m70rj1b1r0000gn/T/tmphqq6fC:62:0: W50: Invalid unit string 'arcseconds' [astropy.io.votable.exceptions]
WARNING: W50: /var/folders/sb/4qv5j4m90pz1rw7m70rj1b1r0000gn/T/tmphqq6fC:65:0: W50: Invalid unit string 'arcseconds' (suppressing further warnings of this type...) [astropy.io.votable.exceptions]
Out[2]: ['posn_col1', 'posn_col2', 'posn_col3', 'posn_col4', 'posn_col5']
refactor has corrected this, I hope
The docstring of
ned.query_ned_basic_posn
says this:But actually the column names are not set to meaningful names as advertised in the docstring:
Also, is this the expected error when a query is made for an unknown name (I would have expected a more explicit error)?