Cosmology tutorial showing how to plot something vs both redshift and universe age#85
Conversation
|
@nhmc -- looks good! There were a couple missing imports (numpy, astropy.units), a few typos, and I think matplotlib now handles astropy units. I put a rendered version of comments at http://nbviewer.ipython.org/gist/mwcraig/40f416ad4b53d6afc4ed My comments are in the markdown cells in red. |
|
Thanks. I think I fixed everything, here's the new version. |
|
The meta data of the notebook needs to be updated...in particular, the link_name, author, and date fields. The link name should be the title of the tutorial which will appear in the list of tutorials. I suggest "Making a plot with both redshift and universe age axes". |
|
Thanks, I've updated this. |
|
I fixed a couple more typos - hopefully this should now be ready to merge. |
|
@nhmc Sorry for the delay -- I'll have a look at this today or tomorrow! |
|
I'm happy with this! Could you add these lines above any matplotlib imports to make the plot styles consistent with other tutorials? |
|
Ok, done. The new github ipython notebook rendering is pretty awesome :) |
|
I agree -- this makes reviewing tutorials so much easier! |
|
Hmm, some thoughts just occurred to me. Right now, the bulk of the code in the tutorial is really just getting the plot to look nice. Maybe we should consider adding a For this tutorial though, maybe you could add one more demo of a cosmology feature? For example (doesn't have to be this, but one idea), also load the |
|
Also, this is just a personal preference, but I tend to put semi-colons at the end of the last line of cells that make plots or assign the output to a variable so you don't end up seeing the output like: |
|
I added semi-colons and included your suggestion of overplotting the Planck 2013 cosmology for comparison. And yes, I agree the boilerplate code needed for two axes is a pain. That's part of the motivation for this tutorial. |
|
Nope. Green light to publish from me! We can always polish and improve it On Wed, May 13, 2015 at 8:59 AM, Adrian Price-Whelan <
Kelle Cruz, PhD — http://kellecruz.com/ |
|
Thanks @nhmc |
Cosmology tutorial showing how to plot something vs both redshift and universe age
|
Ah, I just realised I introduced a mistake by comparing to the two cosmologies. The conversion from redshift to age is different for them both, so we actually need another set of age axes for the Planck 2013 cosmology. This seems a little complicated, so I think it's best just to remove the comparison with Planck for now. |
|
@nhmc - hmm, I see your point on this, but I wonder if this is a good learning opportunity? That is, you can leave what's in there now, but then add another cell that says "oh wait, but that's wrong, and here's why:". For me, at least, "gotchas" like that often stick in my memory better than simple "here's how to do a thing" sort of tutorials. Alternatively, perhaps some other kind of plot should be added that compares two cosmologies? I really like the fact that right now the tutorial shows how easy it is to use cosmologies via the same interface. Also, this is super minor, but, @nhmc, I wonder if the tutorial directory/file should be renamed "redshift_plot" or something? It seems a bit restricted in content to be called "Cosmology". Also, @adrn, it looks like this isn't on the web site - did you run the deploy script? If not, perhaps we should wait until @nhmc finishes those updates? |
Often people want to plot versus redshift and the corresponding age of the universe. This tutorial shows how to do this using
astropy.cosmologyand matplotlib.You can view the notebook here.