-
-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add jonathan's examples to the repo #1
Conversation
do it! |
@@ -0,0 +1,7 @@ | |||
import astropy.io.fits as pyfits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and anywhere else we should use the astropy
standard:
from astropy.io import fits
instead of pyfits
.
I usually use the following approach for editing a FITS file (data or header) which I think is cleaner because you don't need to keep track of data and header separately:
but that's just a personal preference 😄 If you are editing a file with multiple HDUs, it's definitely worth it, because you can do
which is quite convenient. Generally speaking, this will be a lot more convenient when editing FITS files with multiple HDUs (it's much harder to do the same with |
Totally agree @astrofrog -- I'm working on the example in my branch now, just wanted to check in what Jonathan had written so I could show @kelle the github workflow. |
Probably there's a discussion somewhere for the rational in using From my point-of-view, the vast majority of documentation about accessing FITS files that exists on the web is based on the old model of calling it pyfits. This is going to be a point of great confusion to python novices, who will try to use examples from the web and find that they just don't work (the error message for such a mistake is not immediately useful to a new user). Tom, while I agree that your method is the best for files with multiple HDUs, my experience is that people find it conceptually less straight-forward. If nothing else, everyone coming from and IDL background will be more comfortable with the procedure-like example I provide than the object-like example you list. I think the best solution is to have a series of tutorials of increasing depth/complexity. For |
I'm not sure that there was ever any debate about having Multiple levels of tutorials are fine for me, and you can interlink them (i.e. 'if you need to edit FITS files with multiple HDUs, you might want to check this out instead'). One basic question though - what form are the tutorials going to take? Do you want to have them on a website that looks like the docs? Or ipython notebooks? or another form? |
While it is good to provide guidance to IDL users (e.g., "everyone coming from an IDL background will be more comfortable with the procedure-like example"), we want to be clear that this is not necessarily the recommended approach when using Python tools. There's a balance of making them comfortable in transitioning, but not distorting Python libraries to look like IDL ones, or fostering a usage pattern along those lines. (For pyfits we've always advocated having both functional and object approaches to FITS files; the functional approach is often more convenient in interactive analysis, but for multi-extension files, the object approach is almost always better.) On Mar 22, 2013, at 2:58 PM, Jonathan Foster wrote:
|
FWIW, I agree with you guys -- @jfoster17 are you ok with me making changes? Alternatively, you could:
|
Okay, fair enough. I approve of To answer @astrofrog, I think we decided to try writing some tutorials before settling on a final format, but we were leaning towards a documentation-like website with Sphinx. |
@astrofrog @jfoster17 RE: format, that's right -- we're going to write a few tutorials first and then explore using Sphinx to auto-build the examples. |
Add tutorial for reading in a text file and plotting
Edit tutorial to consistently use fits instead of pyfits with appropriate warning about this choice. Keep discussion of extensions but move to a later paragraph.
Fits header
OK @jfoster17 -- your changes have been added to this PR... |
Add jonathan's examples to the repo
Enhancements to Quantity tutorial
Added Disqus Comments to astropy.tpl (Issue 50)
make some adjustments to the table tutorial
Copy edited new tutorials website text
Edits to celestial coords 1 tutorial
Jonathan Foster made a tutorial on editing FITS headers -- I'm adding it to the repository.