question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

votable binary parsing appears to fail on null columns

See original GitHub issue

Example:

>>> 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.

cc @gilleslandais

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

0reactions
pllimcommented, May 24, 2019

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found