Skip to content

votable binary parsing appears to fail on null columns #8737

Closed

Description

@keflavich

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

Activity

  1. astrofrog commented on May 20, 2019

    @astrofrog
    Member

    What do you mean by a null column? It looks like CS should be a string column and it doesn't look any different to say Morph? (in terms of type). Are all the cells empty?

  2. keflavich commented on May 20, 2019

    @keflavich
    ContributorAuthor

    Yes, the cells are empty.

  3. pllim commented on May 20, 2019

    @pllim
    Member

    @tomdonaldson or @tboch , since you expressed interest in maintaining io.votable, perhaps you'll be interested to take a look?

  4. pllim commented on May 24, 2019

    @pllim
    Member

    Is it possible to have a version of this table in a non-binary format and see if you have the same problem parsing it? That would let us see if the bug is in binary-specific parser or not... 🤷‍♀

  5. keflavich commented on May 24, 2019

    @keflavich
    ContributorAuthor
  6. pllim commented on May 24, 2019

    @pllim
    Member

    There is BINARY and BINARY2 -- Did you try both?

    FWIW, the binary parse is here

    def _parse_binary(self, mode, iterator, colnumbers, fields, config, pos):

  7. keflavich commented on May 24, 2019

    @keflavich
    ContributorAuthor
  8. self-assigned this
    on Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions