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.

fitsdiff table crash

See original GitHub issue

Recently I started seeing this:

% fitsdiff  test-source.fits   test-change-row1-valueLeft.fits

 fitsdiff: 1.3.dev16465
 a: data/test-source.fits
 b: data/test-change-row1-valueLeft.fits
 Maximum number of different data values to be reported: 10
 Data comparison level: 0.0

Extension HDU 1:

   Data contains differences:
Traceback (most recent call last):
  File "/Users/jmiller/anaconda/bin/fitsdiff", line 11, in <module>
    load_entry_point('astropy==1.3.dev16465', 'console_scripts', 'fitsdiff')()
  File "/Users/jmiller/anaconda/lib/python3.5/site-packages/astropy/io/fits/scripts/fitsdiff.py", line 285, in main
    diff.report(fileobj=out_file)
  File "/Users/jmiller/anaconda/lib/python3.5/site-packages/astropy/io/fits/diff.py", line 181, in report
    self._report()
  File "/Users/jmiller/anaconda/lib/python3.5/site-packages/astropy/io/fits/diff.py", line 373, in _report
    hdu_diff.report(self._fileobj, indent=self._indent + 1)
  File "/Users/jmiller/anaconda/lib/python3.5/site-packages/astropy/io/fits/diff.py", line 181, in report
    self._report()
  File "/Users/jmiller/anaconda/lib/python3.5/site-packages/astropy/io/fits/diff.py", line 488, in _report
    self.diff_data.report(self._fileobj, indent=self._indent + 1)
  File "/Users/jmiller/anaconda/lib/python3.5/site-packages/astropy/io/fits/diff.py", line 181, in report
    self._report()
  File "/Users/jmiller/anaconda/lib/python3.5/site-packages/astropy/io/fits/diff.py", line 1189, in _report
    self._writeln(u(' Column {} data differs in row {}:').format(indx))
IndexError: tuple index out of range

The table structure should be roughly:

% finfo data/test-source.fits data/test-change-row1-valueLeft.fits
--------------------------------------------------------------------------------
Filename: data/test-source.fits
No.    Name         Type      Cards   Dimensions   Format
  0  PRIMARY     PrimaryHDU       5   ()      
  1              BinTableHDU     18   9R x 5C   [5A, 5A, I, E, 18A]   

[1]:  modeUp modeDown valueLeft valueRight wordage
--------------------------------------------------------------------------------
Filename: data/test-change-row1-valueLeft.fits
No.    Name         Type      Cards   Dimensions   Format
  0  PRIMARY     PrimaryHDU       5   ()      
  1              BinTableHDU     18   9R x 5C   [5A, 5A, I, E, 18A]   

[1]:  modeUp modeDown valueLeft valueRight wordage

Test Data:

fits_crash.zip

This data supports a unit test and is several years old. I did not construct the tables, it’s possible they’re degenerate in some way because they have a limited test-only purpose.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
saimncommented, Nov 29, 2016

@bsipocz - Yes, I started to work on this, the longest is to add tests 😉.

1reaction
jaytmillercommented, Nov 30, 2016

Awesome guys, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Crash when opening binary table with column widths in Astropy
I want to open a binary table held in a FITS file. I am using Python, but I have also tried fv and...
Read more >
astropy.io.fits History
Fixed a crash when running fitsdiff on two empty (that is, zero row) tables. (#178). Fixed an issue where opening files containing random...
Read more >
astropy.io.fits History
(#176); Fixed a crash when running fitsdiff on two empty (that is, zero row) tables. (#178); Fixed an issue where opening files containing...
Read more >
astropy.io.fits.table_to_hdu unexpectedly crashes on certain ...
... import BinTableHDU, table_to_hdu from astropy.table import Table, ... is causing table_to_hdu to crash on Tables that contain that unit.
Read more >
python-astropy-2.0.3-bp150.1.3 - SUSE Package Hub -
astropy.io.fits - Fix writing the result of fitsdiff to file with --output-file. ... astropy.table - Fixed a problem when printing a table when...
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