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.

Table ignores FITS fill value

See original GitHub issue

Is this a bug or a feature?

>>> import astropy
>>> from astropy.io import fits
>>> from astropy.table import Table
>>> astropy.__version__
'1.3.dev16038'
>>> with fits.open('mytable.fits') as pf:
...     hdr = pf[1].header
...     dat = pf[1].data
...     tab = Table.read(pf[1], format='fits')
>>> hdr
XTENSION= 'BINTABLE'           / binary table extension                         
BITPIX  =                    8 / array data type                                
NAXIS   =                    2 / number of array dimensions                     
NAXIS1  =                   12 / length of dimension 1                          
NAXIS2  =                    2 / length of dimension 2                          
PCOUNT  =                    0 / number of group parameters                     
GCOUNT  =                    1 / number of groups                               
TFIELDS =                    2 / number of table fields                         
TTYPE1  = 'a       '                                                            
TFORM1  = 'J       '                                                            
TTYPE2  = 'b       '                                                            
TFORM2  = 'K       '                                                            
TUNIT1  = 'm       '                                                            
TNULL1  =               999999                                                  
TUNIT2  = 's       '                                                            
TNULL2  =               999999                    
>>> dat  # Has fill value
FITS_rec([(1, 3), (999999, 4)], 
      dtype=(numpy.record, [('a', '>i4'), ('b', '>i8')]))
>>> tab  # No fill value
<Table masked=True length=2>
  a     b  
  m     s  
int32 int64
----- -----
    1     3
   --     4

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
pllimcommented, May 15, 2018

I haven’t complained since 2016, so I will just close this. I think from the answers, it is pretty clear that this is a feature and not a bug. 😄

0reactions
saimncommented, May 15, 2018

@pllim - With the other fill_value/TNULL issues, I found this one. The behavior seems correct to me, what do you mean by “why it is not filled by default” ? The read table is masked, so the masked value is hidden but it’s value is 999999.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Table overflowing outside of div
You can prevent tables from expanding beyond their parent div by using table-layout:fixed . The CSS below will make your tables expand to...
Read more >
table-layout - CSS: Cascading Style Sheets - MDN Web Docs
The table-layout CSS property sets the algorithm used to lay out cells, rows, and columns.
Read more >
Fixed Table Layouts | CSS-Tricks
Things get a lot sturdier and more predictable with property/value in place. The layout is fixed based on the first row. Set the...
Read more >
Table Layouts - W3C
In the separated borders model ('border-collapse' is 'separate'), if the value of their 'empty-cells' property is 'hide' these "empty" cells are transparent ...
Read more >
Table Layout - Tailwind CSS
Use table-auto to allow the table to automatically size columns to fit the contents of the cell. Song, Artist, Year. The Sliding Mr....
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