Repository navigation
Mention Table interface in "Creating a New Table File" in FITS docs - #5893
Conversation
MSeifert04
left a comment
There was a problem hiding this comment.
LGTM modulo two minor comments
|
|
||
| .. note:: | ||
|
|
||
| If you want to create a simple binary FITS table with no other HDUs, |
There was a problem hiding this comment.
I'm not exactly sure but this is only for binary tables so it would make sense to highlight **binary** here, right?
There was a problem hiding this comment.
Does anyone use ASCII table in FITS? 😝 (Sure, I can highlight it.)
There was a problem hiding this comment.
Can I skip ci on this change, or let it run? Not sure how thrifty we should be regarding taking CI resources.
There was a problem hiding this comment.
Do skip on this, we shouldn't kill trees for changes like these (on the other hand I think binary FITS table is like a proper noun, never heard referring it in another way. But I'm sure there are weird FITS files out there that may fall into another category.)
There was a problem hiding this comment.
hm, I was thinking about ascii fits tables, not sure if we should differentiate between them. Is it possible to write ascii-fits-tables with Table.write?
There was a problem hiding this comment.
ascii fits? do you have an example somewhere, I think I've never seen any.
There was a problem hiding this comment.
There is a class for it: TableHDU (FITS ASCII table extension HDU class.) vs. BinTableHDU
There was a problem hiding this comment.
If you want to see examples of ASCII FITS tables, it's an option when downloading a table from Vizier
There was a problem hiding this comment.
I am guessing this is just intellectual discussion that does not affect PR approval?
| >>> t = Table([[1, 2], [4, 5], [7, 8]], names=('a', 'b', 'c')) | ||
| >>> t.write('table.fits', format='fits') | ||
|
|
||
| The equivalent codes using ``astropy.io.fits`` would look like this: |
There was a problem hiding this comment.
is codes correct? I would have used the singular code.
There was a problem hiding this comment.
Yes, your suggestion makes sense. p.s. English grammar is so confusing.
There was a problem hiding this comment.
Well, I'm not sure either. But it sounded just wrong.
See also: "StackOverflow"
|
Travis test failures look like false positives. Except documentation there is probably nothing that could fail anyway given that these doctests are skipped 😄 |
|
Okay, since I got 2 different approvals, I am merging my own PR here. Thanks! |
|
|
||
| >>> from astropy.table import Table | ||
| >>> t = Table([[1, 2], [4, 5], [7, 8]], names=('a', 'b', 'c')) | ||
| >>> t.write('table.fits', format='fits') |
| >>> c2 = fits.Column(name='b', array=np.array([4, 5]), format='K') | ||
| >>> c3 = fits.Column(name='c', array=np.array([7, 8]), format='K') | ||
| >>> t = fits.BinTableHDU.from_columns([c1, c2, c3]) | ||
| >>> t.writeto('table.fits') |
| It is not necessary to create :class:`Column` object explicitly | ||
| if the data is stored in a | ||
| `structured array <https://docs.scipy.org/doc/numpy/user/basics.rec.html>`_. | ||
|
|
There was a problem hiding this comment.
This is screaming for an example. I feel like there is one somewhere but I forget where....
There was a problem hiding this comment.
This PR is already merged but if you remember where it is, I can open another one to add it.
Fix #3552
Close #3558
Precursor for #3782 that is to come.
Screenshot of rendered doc:
