Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
darioizzo committed Jul 12, 2016
1 parent 39116ad commit 192ff96
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions PyKEP/planet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down
6 changes: 3 additions & 3 deletions PyKEP/planet/planet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,17 +193,17 @@ BOOST_PYTHON_MODULE(_planet) {
planet_wrapper<planet::j2>("j2","An object with an orbit perturbed by J2, derives from :py:class:`PyKEP.planet._base`")
.def(init<optional<const epoch&, const array6D&, double, double, double , double, double, const std::string &> >())
.def(init<const epoch&, const array3D&, const array3D&, double, double, double, double, double, optional<const std::string &> >())
.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"
Expand Down
6 changes: 3 additions & 3 deletions src/planet/j2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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: "<<std::endl;
s << "Ephemerides type: J2" << "\n\n";
s << "Orbital elements at epoch: "<<std::endl;
s << "Semi major axis (AU): " << boost::lexical_cast<std::string>(m_keplerian_elements[0] / ASTRO_AU) << std::endl;
s << "Eccentricity: " << boost::lexical_cast<std::string>(m_keplerian_elements[1]) << std::endl;
s << "Inclination (deg.): " << boost::lexical_cast<std::string>(m_keplerian_elements[2] * ASTRO_RAD2DEG) << std::endl;
s << "Big Omega (deg.): " << boost::lexical_cast<std::string>(m_keplerian_elements[3] * ASTRO_RAD2DEG) << std::endl;
s << "Small omega (deg.): " << boost::lexical_cast<std::string>(m_keplerian_elements[4] * ASTRO_RAD2DEG) << std::endl;
s << "Mean anomaly (deg.): " << boost::lexical_cast<std::string>(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<std::string>(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();
Expand Down

0 comments on commit 192ff96

Please sign in to comment.