From 1a474af74f7373fd0340d5bc6af714b739453978 Mon Sep 17 00:00:00 2001 From: Mark Wieczorek Date: Wed, 9 Oct 2024 11:55:55 +0200 Subject: [PATCH] Add bullets to parameters defined in __str__ --- boule/_ellipsoid.py | 23 ++++++++++++---------- boule/_realizations.py | 39 ++++++++++++++++++++++++------------- boule/_sphere.py | 19 ++++++++++-------- boule/_triaxialellipsoid.py | 31 ++++++++++++++++------------- 4 files changed, 67 insertions(+), 45 deletions(-) diff --git a/boule/_ellipsoid.py b/boule/_ellipsoid.py index 2186f540..7d38721b 100644 --- a/boule/_ellipsoid.py +++ b/boule/_ellipsoid.py @@ -89,10 +89,10 @@ class Ellipsoid: >>> print(ellipsoid) # doctest: +ELLIPSIS WGS84 - World Geodetic System 1984 Oblate ellipsoid: - Semimajor axis: 6378137 m - Flattening: 0.0033528106647474805 - GM: 398600441800000.0 m³/s² - Angular velocity: 7.292115e-05 rad/s + • Semimajor axis: 6378137 m + • Flattening: 0.0033528106647474805 + • GM: 398600441800000.0 m³/s² + • Angular velocity: 7.292115e-05 rad/s Source: Hofmann-Wellenhof & Moritz (2006) Comments: @@ -406,20 +406,23 @@ def gravity_pole(self): def __str__(self): s = self.name + " - " + self.long_name + "\n" s += "Oblate ellipsoid:\n" - s += f" Semimajor axis: {self.semimajor_axis} m\n" - s += f" Flattening: {self.flattening}\n" - s += f" GM: {self.geocentric_grav_const} m³/s²\n" - s += f" Angular velocity: {self.angular_velocity} rad/s" + s += f" • Semimajor axis: {self.semimajor_axis} m\n" + s += f" • Flattening: {self.flattening}\n" + s += f" • GM: {self.geocentric_grav_const} m³/s²\n" + s += f" • Angular velocity: {self.angular_velocity} rad/s" if self.reference is not None: s += "\nSource:" for ref in self.reference.splitlines(): s += "\n" + textwrap.fill( - ref, width=72, initial_indent=" ", subsequent_indent=" " + ref, width=72, initial_indent=2 * " ", subsequent_indent=4 * " " ) if self.comments is not None: s += "\nComments:\n" s += textwrap.fill( - self.comments, width=72, initial_indent=" ", subsequent_indent=" " + self.comments, + width=72, + initial_indent=2 * " ", + subsequent_indent=2 * " ", ) return s diff --git a/boule/_realizations.py b/boule/_realizations.py index ef3d947f..614b4281 100644 --- a/boule/_realizations.py +++ b/boule/_realizations.py @@ -35,7 +35,8 @@ angular_velocity=1.2400141739494342e-06, reference=( "Radius: Maia, J. (2024). Spherical harmonic models of the shape of " - "Mercury [Data set]. Zenodo. https://doi.org/10.5281/zenodo.10809345\n" + "Mercury [Data set]. Zenodo. https://doi.org/10.5281/zenodo.10809345" + "\n" "GM, angular velocity: Mazarico, E., et al. (2014), The gravity field, " "orientation, and ephemeris of Mercury from MESSENGER observations " "after three years in orbit, J. Geophys. Res. Planets, 119, " @@ -135,7 +136,8 @@ reference=( "Semimajor axis, flattening: Park, R. S., et al. (2019). High-resolution " "shape model of Ceres from stereophotoclinometry using Dawn Imaging Data. " - "Icarus, 319, 812–827. https://doi.org/10.1016/j.icarus.2018.10.024\n" + "Icarus, 319, 812–827. https://doi.org/10.1016/j.icarus.2018.10.024" + "\n" "GM, angular velocity: Konopliv, A. S., et al. (2018). The Ceres gravity " "field, spin pole, rotation period and orbit from the Dawn radiometric " "tracking and optical data. Icarus, 299, 411–429. " @@ -189,10 +191,12 @@ reference=( "Semi-axis: Thomas, P. C., et al. (1998). The Shape of Io from Galileo " "Limb Measurements. Icarus, 135(1), 175–180. " - "https://doi.org/10.1006/icar.1998.5987\n" + "https://doi.org/10.1006/icar.1998.5987" + "\n" "GM: Anderson, J. D., et al. (2001). Io's gravity field and interior " "structure. J. Geophys. Res., 106, 32963–32969. " - "https://doi.org/10.1029/2000JE001367\n" + "https://doi.org/10.1029/2000JE001367" + "\n" "Angular velocity: R. A. Jacobson (2021), The Orbits of the Regular " "Jovian Satellites and the Orientation of the Pole of Jupiter, personal " "communication to Horizons/NAIF. Accessed via JPL Solar System " @@ -212,10 +216,12 @@ reference=( "Semi-axis: Nimmo, F., et al. (2007). The global shape of Europa: " "Constraints on lateral shell thickness variations. Icarus, 191(1), " - "183–192. https://doi.org/10.1016/j.icarus.2007.04.021\n" + "183–192. https://doi.org/10.1016/j.icarus.2007.04.021" + "\n" "GM: Anderson, J. D., et al. (1998). Europa's differentiated internal " "structure: Inferences from four Galileo encounters. Science, 281, " - "2019–2022. https://doi.org/10.1126/science.281.5385.2019\n" + "2019–2022. https://doi.org/10.1126/science.281.5385.2019" + "\n" "Angular velocity: R. A. Jacobson (2021), The Orbits of the Regular " "Jovian Satellites and the Orientation of the Pole of Jupiter, personal " "communication to Horizons/NAIF. Accessed via JPL Solar System " @@ -235,10 +241,12 @@ reference=( "Semi-axis: Zubarev, A., et al. (2015). New Ganymede control point " "network and global shape model. Planetary and Space Science, 117, " - "246–249. https://doi.org/10.1016/j.pss.2015.06.022\n" + "246–249. https://doi.org/10.1016/j.pss.2015.06.022" + "\n" "GM: Gomez Casajus, L., et al. (2022). Gravity Field of Ganymede After " "the Juno Extended Mission. Geophysical Research Letters, 49(24), " - "e2022GL099475. https://doi.org/doi:10.1029/2022GL099475\n" + "e2022GL099475. https://doi.org/doi:10.1029/2022GL099475" + "\n" "Angular velocity: R. A. Jacobson (2021), The Orbits of the Regular " "Jovian Satellites and the Orientation of the Pole of Jupiter, personal " "communication to Horizons/NAIF. Accessed via JPL Solar System " @@ -256,7 +264,8 @@ reference=( "Radius, GM: Anderson, J. D., et al. (2001). Shape, mean radius, gravity " "field, and interior structure of Callisto. Icarus, 153(1), 157–161. " - "https://doi.org/10.1006/icar.2001.6664\n" + "https://doi.org/10.1006/icar.2001.6664" + "\n" "Angular velocity: Satellites and the Orientation of the Pole of Jupiter, " "personal communication to Horizons/NAIF. Accessed via JPL Solar " "System Dynamics, https://ssd.jpl.nasa.gov, JUP365." @@ -289,10 +298,12 @@ reference=( "Semi-axis: Corlies, P., et al. (2017). Titan’s Topography and Shape at " "the End of the Cassini Mission. Geophysical Research Letters, 44(23), " - "11,754-11,761. https://doi.org/10.1002/2017GL075518\n" + "11,754-11,761. https://doi.org/10.1002/2017GL075518" + "\n" "GM: Durante, D., et al. (2019). Titan’s gravity field and interior " "structure after Cassini. Icarus, 326, 123–132. " - "https://doi.org/10.1016/j.icarus.2019.03.003\n" + "https://doi.org/10.1016/j.icarus.2019.03.003" + "\n" "Angular velocity: Jacobson, R. (2022). The Orbits of the Main Saturnian " "Satellites, the Saturnian System Gravity Field, and the Orientation " "of Saturn's Pole. The Astronomical Journal, 164, 199. " @@ -312,7 +323,8 @@ reference=( "Radius: Nimmo, et al. (2017). Mean radius and shape of Pluto and Charon " "from New Horizons images. Icarus, 287, 12–29. " - "https://doi.org/10.1016/j.icarus.2016.06.027\n" + "https://doi.org/10.1016/j.icarus.2016.06.027" + "\n" "GM, angular velocity: Brozović, M., et al. (2015). The orbits and masses of " "satellites of Pluto. Icarus, 246, 317–329. " "https://doi.org/10.1016/j.icarus.2014.03.015" @@ -328,7 +340,8 @@ reference=( "Radius: Nimmo, et al. (2017). Mean radius and shape of Pluto and Charon " "from New Horizons images. Icarus, 287, 12–29. " - "https://doi.org/10.1016/j.icarus.2016.06.027\n" + "https://doi.org/10.1016/j.icarus.2016.06.027" + "\n" "GM, angular velocity: Brozović, M., et al. (2015). The orbits and masses of " "satellites of Pluto. Icarus, 246, 317–329. " "https://doi.org/10.1016/j.icarus.2014.03.015" diff --git a/boule/_sphere.py b/boule/_sphere.py index ba9774ad..eaf1a979 100644 --- a/boule/_sphere.py +++ b/boule/_sphere.py @@ -86,9 +86,9 @@ class Sphere: >>> print(sphere) # doctest: +ELLIPSIS Moon - Moon Spheroid Spheroid: - Radius: 1737151 m - GM: 4902800070000.0 m³/s² - Angular velocity: 2.6617073e-06 rad/s + • Radius: 1737151 m + • GM: 4902800070000.0 m³/s² + • Angular velocity: 2.6617073e-06 rad/s Source: Wieczorek (2015) Comments: @@ -294,19 +294,22 @@ def reference_normal_gravitational_potential(self): def __str__(self): s = self.name + " - " + self.long_name + "\n" s += "Spheroid:\n" - s += f" Radius: {self.radius} m\n" - s += f" GM: {self.geocentric_grav_const} m³/s²\n" - s += f" Angular velocity: {self.angular_velocity} rad/s" + s += f" • Radius: {self.radius} m\n" + s += f" • GM: {self.geocentric_grav_const} m³/s²\n" + s += f" • Angular velocity: {self.angular_velocity} rad/s" if self.reference is not None: s += "\nSource:" for ref in self.reference.splitlines(): s += "\n" + textwrap.fill( - ref, width=72, initial_indent=" ", subsequent_indent=" " + ref, width=72, initial_indent=2 * " ", subsequent_indent=4 * " " ) if self.comments is not None: s += "\nComments:\n" s += textwrap.fill( - self.comments, width=72, initial_indent=" ", subsequent_indent=" " + self.comments, + width=72, + initial_indent=2 * " ", + subsequent_indent=2 * " ", ) return s diff --git a/boule/_triaxialellipsoid.py b/boule/_triaxialellipsoid.py index 928d5381..35c1a377 100644 --- a/boule/_triaxialellipsoid.py +++ b/boule/_triaxialellipsoid.py @@ -99,12 +99,12 @@ class TriaxialEllipsoid: >>> print(ellipsoid) # doctest: +ELLIPSIS Vesta - Vesta Triaxial Ellipsoid Triaxial ellipsoid: - Semimajor axis: 280413 m - Semimedium axis: 274572 m - Semiminor axis: 231253 m - Semimajor axis longitude: 8.29° - GM: 17288000000.0 m³/s² - Angular velocity: 0.0003267 rad/s + • Semimajor axis: 280413 m + • Semimedium axis: 274572 m + • Semiminor axis: 231253 m + • Semimajor axis longitude: 8.29° + • GM: 17288000000.0 m³/s² + • Angular velocity: 0.0003267 rad/s Source: Karimi et al. (2017) Comments: @@ -338,22 +338,25 @@ def meridional_flattening(self): def __str__(self): s = self.name + " - " + self.long_name + "\n" s += "Triaxial ellipsoid:\n" - s += f" Semimajor axis: {self.semimajor_axis} m\n" - s += f" Semimedium axis: {self.semimedium_axis} m\n" - s += f" Semiminor axis: {self.semiminor_axis} m\n" - s += f" Semimajor axis longitude: {self.semimajor_axis_longitude}°\n" - s += f" GM: {self.geocentric_grav_const} m³/s²\n" - s += f" Angular velocity: {self.angular_velocity} rad/s" + s += f" • Semimajor axis: {self.semimajor_axis} m\n" + s += f" • Semimedium axis: {self.semimedium_axis} m\n" + s += f" • Semiminor axis: {self.semiminor_axis} m\n" + s += f" • Semimajor axis longitude: {self.semimajor_axis_longitude}°\n" + s += f" • GM: {self.geocentric_grav_const} m³/s²\n" + s += f" • Angular velocity: {self.angular_velocity} rad/s" if self.reference is not None: s += "\nSource:" for ref in self.reference.splitlines(): s += "\n" + textwrap.fill( - ref, width=72, initial_indent=" ", subsequent_indent=" " + ref, width=72, initial_indent=2 * " ", subsequent_indent=4 * " " ) if self.comments is not None: s += "\nComments:\n" s += textwrap.fill( - self.comments, width=72, initial_indent=" ", subsequent_indent=" " + self.comments, + width=72, + initial_indent=2 * " ", + subsequent_indent=2 * " ", ) return s