astropy.cosmology ideas

14 views
Skip to first unread message

Adrian Price-Whelan

unread,
May 12, 2015, 9:40:23 AM5/12/15
to astro...@googlegroups.com
I was just reviewing a new Astropy tutorial that uses the features in
astropy.cosmology, and had a few thoughts. I don't use this subpackage
on a regular basis so I apologize if these have been discussed before
-- I have to admit I haven't paid close attention to its development!
The tutorial is in this PR:
https://github.com/astropy/astropy-tutorials/pull/85 You can see the
proposed tutorial here:
https://github.com/nhmc/astropy-tutorials/blob/cosmology_tutorial/tutorials/cosmology/Cosmology.ipynb
(thanks to the new notebook rendering on GitHub, woo!).

1) A lot of the effort in the tutorial is in getting a simple plot to
look nice with a dual x-axis (distance and redshift). This seems like
boilerplate code that anyone who makes a cosmological plot of
something vs. distance might want! Has there been any discussion of
making a matplotlib Axes subclass that automatically handles this for
the user? (maybe Axes is the wrong object to subclass, but the idea is
the same). And of course, would probably want to let the user choose
if redshift on top distance on bottom vs. flipped..

2) I know we are in the era of precision cosmology, and I also know
that uncertainty support doesn't really exist in the Astropy core, but
it would be nice to have a way to access the uncertainties on
cosmological parameters from, e.g., WMAP, Planck, etc. Or does this
already exist?

- Adrian

--
Adrian M. Price-Whelan ~ Columbia University ~ http://adrian.pw

Peter Erwin

unread,
May 12, 2015, 10:59:26 AM5/12/15
to astro...@googlegroups.com

> On May 12, 2015, at 3:40 PM, Adrian Price-Whelan <adri...@gmail.com> wrote:
>
> I was just reviewing a new Astropy tutorial that uses the features in
> astropy.cosmology, and had a few thoughts. I don't use this subpackage
> on a regular basis so I apologize if these have been discussed before
> -- I have to admit I haven't paid close attention to its development!
> The tutorial is in this PR:
> https://github.com/astropy/astropy-tutorials/pull/85 You can see the
> proposed tutorial here:
> https://github.com/nhmc/astropy-tutorials/blob/cosmology_tutorial/tutorials/cosmology/Cosmology.ipynb
> (thanks to the new notebook rendering on GitHub, woo!).
>
> 1) A lot of the effort in the tutorial is in getting a simple plot to
> look nice with a dual x-axis (distance and redshift). This seems like
> boilerplate code that anyone who makes a cosmological plot of
> something vs. distance might want! Has there been any discussion of
> making a matplotlib Axes subclass that automatically handles this for
> the user? (maybe Axes is the wrong object to subclass, but the idea is
> the same). And of course, would probably want to let the user choose
> if redshift on top distance on bottom vs. flipped..

I think the only problem is that’s such a generally desirable thing that it hardly
makes sense to limit it to cosmology. I frequently make plots where the x-axes
are radius in arc sec and radius in kpc; I can imagine plots of spectra with
wavelength and wavenumber, and there are all sorts of other possibilities.

This sounds like something better handled within matplotlib, if it isn’t already.

— Peter

=============================================================
Peter Erwin Max-Planck-Insitute for Extraterrestrial
er...@mpe.mpg.de Physics, Giessenbachstrasse
tel. +49 (0)176 2481 7713 85748 Garching, Germany
fax +49 (0)89 30000 3495 http://www.mpe.mpg.de/~erwin



Reply all
Reply to author
Forward
0 new messages