StreamingHDU issue
See original GitHub issueHi,
I’m running Debian unstable on 64 bit machines (and hence this is version 1.3 of astropy) and have come across an issue with StreamingHDU on 2 out of the 3 machines!
This is the test program:
#!/usr/bin/env python
import numpy as np
import astropy.io.fits as fits
n1 = 2048
n2 = 2048
n3 = 50
hdu = fits.PrimaryHDU()
hdr = hdu.header
hdr['NAXIS'] = (3, 'its a movie')
hdr['NAXIS1'] = (n1, 'number of n1 samples')
hdr['NAXIS2'] = (n2, 'number of n2 samples')
hdr['NAXIS3'] = (n3, 'number of frames in movie')
hdr['BITPIX'] = (-32, 'np.float32')
print hdr
shdu = fits.StreamingHDU('test_shdu.fits', hdr)
data = np.zeros((n1, n2), np.float32)
for f in xrange(n3):
data[:,:] = f
print 'Doing frame', f, data.nbytes
shdu.write(data)
shdu.close()
On two of the machines, it fails with:
Doing frame 25 16777216
Traceback (most recent call last):
File "./test_stream_fits.py", line 26, in <module>
shdu.write(data)
File "/usr/lib/python2.7/dist-packages/astropy/io/fits/hdu/streaming.py", line 174, in write
raise IOError('Attempt to write more data to the stream than the '
IOError: Attempt to write more data to the stream than the header specified.
If I look at the output (using ds9) when the program fails, then every odd numbered frame is filled with zero, and the even frames are 1,2,3,…24. So it seems to be writing an additional empty image out before it writes the actual data. I suspect its incidental, but the two machines it fails on are both Intel, and the one it does work on is AMD.
Any suggestions, or is it a real bug?
Thanks,
Matt
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
6 steps to solving your streaming video problems - TechHive
6 steps to solving your streaming video problems · Step 1: Restart everything · Step 2: Know your internet speed · Step 3:...
Read more >Troubleshoot video streaming issues - YouTube TV Help
If you're experiencing issues with video streaming on YouTube TV, try these troubleshooting tips. On a mobile device Restart your device Hold down...
Read more >Solve video streaming problems - Which Computing Helpdesk
1. Is your internet slow? One of the main reasons for video streaming problems is slow internet. · 2. Who else is online?...
Read more >How to Stop Buffering When Streaming | SatelliteInternet.com
5 quick fixes for buffering while streaming · Lower the video quality to standard definition (SD). · Disconnect all other devices in the...
Read more >How to Troubleshoot Live Streaming Issues with Broadcasting
10 Ways to Troubleshoot live streaming Issues · 1. Check Encoder Settings · 2. Confirm Bandwidth Availability · 3. Compare Upload Speed &...
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 Free
Top 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
It seems this was the last bug labeled “Python 2”, and since it works with Python 3 I guess we can close!
This has never really been a well supported or tested feature in the first place.