VOTable binary2 file reads back in with only one row
See original GitHub issueI have encountered a case where a VOTableFile that writes out correctly in tabledata format, apparently writes only one row in binary2 format. Furthermore, validate
reports that the binary2 file is fine. The STILTS votlint
checker from Starlink finds the 1-row problem.
To reproduce:
from astropy.utils.data import download_file
from astropy.io.votable import parse, validate
tabledata_file = download_file('http://web.ipac.caltech.edu/staff/shupe' +
'/firefly_testdata/tabledata-wide.xml',
cache=True)
print('validating downloaded file:')
validate(tabledata_file)
votablefile = parse(tabledata_file)
print('tabledata format: shape is ', votablefile.get_first_table().array.shape)
intermediate_name = 'tabledata-wide.xml'
votablefile.to_xml(intermediate_name, tabledata_format='tabledata')
print('validating the table when written as tabledata format:')
validate(intermediate_name)
int_votablefile = parse(intermediate_name)
print('tabledata format: shape is ', int_votablefile.get_first_table().array.shape)
outname = 'binary2-wide.xml'
int_votablefile.to_xml(outname, tabledata_format='binary2')
print('validating binary2 output:')
validate(outname)
vobinary2 = parse(outname)
print('binary2 format: shape is ', vobinary2.get_first_table().array.shape)
STILTS votlint
passes the tabledata versions. For the binary2 file it reports:
ERROR (l.4047, c.314415): Stream ended during data read; done 2/4
ERROR (l.4047, c.314415): End of stream while reading 1134821376 elements (probable stream corruption)
ERROR (l.4047, c.314415): Streaming error java.io.EOFException
ERROR (l.4055, c.11): Row count (1) not equal to nrows attribute (49)
EDIT: Syntax highlighting
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
VOTable XML Handling (astropy.io.votable) — Astropy v5.2
Given an Table object, return a VOTableFile file structure containing just that single table. is_votable (source). Reads the header of a file to...
Read more >VOTable XML handling (astropy.io.votable) — Astropy v0.4.2
File reads will be moderately faster if the TABLE element includes an nrows attribute. If the number of rows is not specified, the...
Read more >IVOA Documents - VOTable Format Definition
The data part in a VOTable may be represented using one of three different formats: TABLEDATA, FITS and BINARY. TABLEDATA is a pure...
Read more >Introduction to vo.table - stsdas
vo.table is a Python package to read and write VOTable files into Numpy record arrays. Standard compliance¶. vo.table supports ...
Read more >VOTable: A Proposed XML Format for Astronomical Tables
In this context, a table is an unordered set of rows, each of a uniform format, ... Given a FITS file that represents...
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
@stargaser , okay. I’ll tack on your metadata problem onto #7759. Thank you!
Indeed metadata is not well supported in the unified I/O interface. I am not sure if I have time to look into this. But I am of the opinion that if we were to spend time fixing this issue up, the effort is better spent on implementing metadata support than figuring out why
votable.parse
etc did not behave the same as unified I/O. If LSST would like to provide resource to implement metadata support, I would be happy to help with the onboarding process!