votable binary parsing appears to fail on null columns
See original GitHub issueExample:
>>> import requests
>>> url = "http://vizier.u-strasbg.fr/viz-bin/votable/-b64?-source=V/127A/mash1&-out.max=20&-out.meta=hu2D"
>>> result = requests.get(url)
>>> with open('test.vot', 'w') as fh:
... fh.write(result.text)
>>> from astropy.table import Table
>>> tbl = Table.read('test.vot')
>>> print(tbl)
results in:
<Table masked=True length=18>
n_PNG PNG Name ... ObsDate img AssocData
... d
bytes1 bytes12 bytes13 ... int32 bytes5 bytes4
------ ------------ ------------- ... ---------- ------ ---------
T G209.1-08.2 PHR0615-0025 ... 808464672 fitsP G227
. 3-12.0 PHR06 33-1808 @X��� ... 1718187123 TG212 .2-0
4 .7 PHR0633-0 135 @X�z�G�� ... 1346843185 4.2-0 2.4
P HR0645-0217 @YP������a�P ... 858666541 06.8 PHR0
6 46-1235 @Yf� �,_��)2��n\B ... 858667296 PHR06 48-0
7 19 @Y��z�G�
R��,_�B
... 1346916912 650+0 013
@ Y������?�'�} '�|B� ... 892415280 257 @ Y��
�Q���
��r ... 892411968 Y�,_� ���#
� Q�
�Bp ... 1506109904 6��) Z+<M
^ oC; ... 744472613 �g��� �A�
A� E ... 801727228 �BD B<
�1012 fitsLG2 ... 155354624
3 fitsTG217.2 ... 4338176
E a tsTG214.6+02. ... 0 R
8 1015 fitsTG2 27.2-03.4 PHR ... 1 E 1016
fitsTG222.9- 01.1 PHR0705- ... 2452667 1017 fits
P G237.9-07.2 FP0711-2531 ... 825241912 fits TG22
6 .4-01.3 PHR0 711-1238 @Z�� ... 543582580 sLG22 5.2+
If you drop the ‘CS’ column (which is a null column), the table parses correctly, so it looks like the astropy votable is incorrectly handling the null column.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
astropy.io.votable.exceptions — Astropy v5.1.1
In order to name the columns of the Numpy record array, each FIELD element must have either an ID or name attribute to...
Read more >VOTableIssues < IVOA < TWiki
This memo discusses issues that arise from the standard representation of nulls according to the VOTable standard. [The initial version of this document...
Read more >C.3 Version History
VOTable parsing overhauled: The VOElement class has been rewritten and now ... Now copes with 'K'-format FITS binary table columns (64-bit integers).
Read more >astropy/tree.py at main - votable - GitHub
A function that looks up an element by the given attribute. ... Get the default unit format as specified in the VOTable spec....
Read more >The GAVO VOTable Library - VO related docs
There are many other libraries to parse VOTables into python programs, ... so this code will fail for many tables unless one introduces...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, did both
On Fri, May 24, 2019, 18:53 P. L. Lim notifications@github.com wrote:
There is BINARY and BINARY2 – Did you try both?
FWIW, the binary parse is here
https://github.com/astropy/astropy/blob/51db6a64ffb6140cca4e76159a94cee38e3af745/astropy/io/votable/tree.py#L2603