diff --git a/PyKEP/planet/__init__.py b/PyKEP/planet/__init__.py index 2b2fd7d3..6a88358f 100644 --- a/PyKEP/planet/__init__.py +++ b/PyKEP/planet/__init__.py @@ -49,12 +49,12 @@ def _j2_ctor(self, *args): - mu_self: gravity parameter of the planet (SI units, i.e. m^2/s^3) - radius: body radius (SI units, i.e. meters) - safe_radius: mimimual radius that is safe during a fly-by of the planet (SI units, i.e. m) -- J2RG2: the product of J2 and the mean radius of the oblate primary +- J2RG2: the product of J2 and the mean radius of the oblate primary squared (SI units, i.e. m^2) - name: body name Example:: - deb1 = planet.j2(epoch(54000,"mjd"),(7000000, 1.67e-02, 78.23 * DEG2RAD, 175. * DEG2RAD, 287. * DEG2RAD, 257 * DEG2RAD), MU_EARTH, 1, 1, 1, J2*EARTH_RADIUS**2 'deb1')" + deb1 = planet.j2(epoch(54000,"mjd"),(7000000, 1.67e-02, 78.23 * DEG2RAD, 175. * DEG2RAD, 287. * DEG2RAD, 257 * DEG2RAD), MU_EARTH, 1, 1, 1, EARTH_J2*EARTH_RADIUS**2, 'deb1') """ self._orig_init(*args) j2._orig_init = j2.__init__ diff --git a/PyKEP/planet/planet.cpp b/PyKEP/planet/planet.cpp index 7f32f6b2..146da201 100644 --- a/PyKEP/planet/planet.cpp +++ b/PyKEP/planet/planet.cpp @@ -193,17 +193,17 @@ BOOST_PYTHON_MODULE(_planet) { planet_wrapper("j2","An object with an orbit perturbed by J2, derives from :py:class:`PyKEP.planet._base`") .def(init >()) .def(init >()) - .add_property("orbital_elements", &planet::keplerian::get_elements, &planet::keplerian::set_elements, + .add_property("orbital_elements", &planet::j2::get_elements, &planet::j2::set_elements, "The keplerian, osculating, elements of the orbit at the reference epoch\n\n" "Example::\n\n" " el = deb1.orbital_elements" ) - .add_property("ref_epoch", &planet::keplerian::get_ref_epoch, &planet::keplerian::set_ref_epoch, + .add_property("ref_epoch", &planet::j2::get_ref_epoch, &planet::j2::set_ref_epoch, "The reference epoch at which the elements are given\n\n" "Example::\n\n" " el = deb1.ref_epoch" ) - .add_property("ref_mjd2000", &planet::keplerian::get_ref_mjd2000, &planet::keplerian::set_ref_mjd2000, + .add_property("ref_mjd2000", &planet::j2::get_ref_mjd2000, &planet::j2::set_ref_mjd2000, "The reference epoch at which the elements are given\n\n" "Example::\n\n" " el = deb1.ref_mjd2000" diff --git a/src/planet/j2.cpp b/src/planet/j2.cpp index 29b47c11..26a41858 100644 --- a/src/planet/j2.cpp +++ b/src/planet/j2.cpp @@ -161,16 +161,16 @@ void j2::set_ref_mjd2000(const double &when) { /// Extra informations streamed in humar readable format std::string j2::human_readable_extra() const { std::ostringstream s; - s << "J2 planet elements: "<(m_keplerian_elements[0] / ASTRO_AU) << std::endl; s << "Eccentricity: " << boost::lexical_cast(m_keplerian_elements[1]) << std::endl; s << "Inclination (deg.): " << boost::lexical_cast(m_keplerian_elements[2] * ASTRO_RAD2DEG) << std::endl; s << "Big Omega (deg.): " << boost::lexical_cast(m_keplerian_elements[3] * ASTRO_RAD2DEG) << std::endl; s << "Small omega (deg.): " << boost::lexical_cast(m_keplerian_elements[4] * ASTRO_RAD2DEG) << std::endl; s << "Mean anomaly (deg.): " << boost::lexical_cast(m_keplerian_elements[5] * ASTRO_RAD2DEG) << std::endl; - s << "Elements reference epoch: " << epoch(m_ref_mjd2000) << std::endl; + s << "Elements reference epoch: " << epoch(m_ref_mjd2000) << "\n\n"; s << "J2 RG^2: " << boost::lexical_cast(m_J2RG2) << std::endl; - s << "Ephemerides type: J2" << std::endl; s << "m_r" << m_r << std::endl; s << "m_v" << m_v << std::endl; return s.str();