@@ -55,6 +55,9 @@ See :ref:`astropy-coordinates-create-geodetic` for more details.
5555Updates to `~astropy.cosmology `
5656===============================
5757
58+ Writing to LaTeX
59+ ----------------
60+
5861The :class: `~astropy.cosmology.Cosmology ` class in :mod: `~astropy.cosmology ` now
5962supports the latex format in its :attr: `~astropy.cosmology.Cosmology.write() `
6063method, allowing users to export a cosmology object to a LaTeX table.::
@@ -65,6 +68,37 @@ method, allowing users to export a cosmology object to a LaTeX table.::
6568This will write the cosmology object to a file in LaTeX format,
6669with appropriate formatting of units and table alignment.
6770
71+ Renaming fields in I/O
72+ ----------------------
73+
74+ Most I/O methods in :mod: `~astropy.cosmology ` (accessed by
75+ :meth: `~astropy.cosmology.Cosmology.read `,
76+ :meth: `~astropy.cosmology.Cosmology.write `,
77+ :meth: `~astropy.cosmology.Cosmology.from_format `,
78+ :meth: `~astropy.cosmology.Cosmology.to_format `) now support
79+ :ref: `renaming fields<cosmology_io_renaming_fields> `.
80+
81+ For example, to rename the ``H0 `` field to ``Hubble `` when converting to a table
82+ format::
83+
84+ >>> from astropy.cosmology import Planck18
85+ >>> Planck18.to_format("astropy.table") # No renaming
86+ <QTable length=1>
87+ name H0 Om0 Tcmb0 Neff m_nu Ob0
88+ km / (Mpc s) K eV
89+ str8 float64 float64 float64 float64 float64[3] float64
90+ -------- ------------ ------- ------- ------- ----------- -------
91+ Planck18 67.66 0.30966 2.7255 3.046 0.0 .. 0.06 0.04897
92+
93+ >>> Planck18.to_format("astropy.table", rename={"H0": "Hubble"})
94+ <QTable length=1>
95+ name Hubble Om0 Tcmb0 Neff m_nu Ob0
96+ km / (Mpc s) K eV
97+ str8 float64 float64 float64 float64 float64[3] float64
98+ -------- ------------ ------- ------- ------- ----------- -------
99+ Planck18 67.66 0.30966 2.7255 3.046 0.0 .. 0.06 0.04897
100+
101+
68102Full change log
69103===============
70104
0 commit comments