Skip to content

Mention Table interface in "Creating a New Table File" in FITS docs - #5893

Merged
pllim merged 3 commits into
astropy:masterfrom
pllim:clean-3558
Mar 22, 2017
Merged

pllim merged 3 commits into
astropy:masterfrom
pllim:clean-3558

Conversation

@pllim

@pllim pllim commented Mar 21, 2017

Copy link
Copy Markdown
Member

Fix #3552

Close #3558

Precursor for #3782 that is to come.

Screenshot of rendered doc:
untitled

@MSeifert04 MSeifert04 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo two minor comments

Comment thread docs/io/fits/index.rst Outdated

.. note::

If you want to create a simple binary FITS table with no other HDUs,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not exactly sure but this is only for binary tables so it would make sense to highlight **binary** here, right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does anyone use ASCII table in FITS? 😝 (Sure, I can highlight it.)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I skip ci on this change, or let it run? Not sure how thrifty we should be regarding taking CI resources.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ascii fits? do you have an example somewhere, I think I've never seen any.

@MSeifert04 MSeifert04 Mar 21, 2017 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a class for it: TableHDU (FITS ASCII table extension HDU class.) vs. BinTableHDU

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to see examples of ASCII FITS tables, it's an option when downloading a table from Vizier

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am guessing this is just intellectual discussion that does not affect PR approval?

Comment thread docs/io/fits/index.rst Outdated
>>> 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:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is codes correct? I would have used the singular code.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, your suggestion makes sense. p.s. English grammar is so confusing.

@MSeifert04 MSeifert04 Mar 21, 2017 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I'm not sure either. But it sounded just wrong.

See also: "StackOverflow"

@MSeifert04

MSeifert04 commented Mar 21, 2017 •

Copy link
Copy Markdown
Contributor

Travis test failures look like false positives. Except documentation there is probably nothing that could fail anyway given that these doctests are skipped 😄

@mhvk mhvk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@pllim

pllim commented Mar 22, 2017

Copy link
Copy Markdown
Member Author

Okay, since I got 2 different approvals, I am merging my own PR here. Thanks!

@pllim
pllim merged commit 59d34a5 into astropy:master Mar 22, 2017
@pllim
pllim deleted the clean-3558 branch March 22, 2017 17:38

@embray embray left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment thread docs/io/fits/index.rst

>>> from astropy.table import Table
>>> t = Table([[1, 2], [4, 5], [7, 8]], names=('a', 'b', 'c'))
>>> t.write('table.fits', format='fits')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread docs/io/fits/index.rst
>>> 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')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread docs/io/fits/index.rst
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>`_.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is screaming for an example. I feel like there is one somewhere but I forget where....

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is already merged but if you remember where it is, I can open another one to add it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants