Cannot sample orbits around the Moon
See original GitHub issueCode to reproduce:
In [1]: from poliastro.bodies import Moon
In [2]: from poliastro.twobody import Orbit
In [3]: from astropy import units as u
In [4]: o1 = Orbit.circular(Moon, 100 * u.km)
In [5]: o1.sample()
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
~/Development/poliastro/poliastro-library/src/poliastro/frames.py in get_frame(attractor, plane, obstime)
254 try:
--> 255 frames = _FRAME_MAPPING[attractor]
256 except KeyError:
KeyError: Moon (☾)
During handling of the above exception, another exception occurred:
NotImplementedError Traceback (most recent call last)
<ipython-input-6-5515a447cc0b> in <module>
----> 1 o1.sample()
~/Development/poliastro/poliastro-library/src/poliastro/twobody/orbit.py in sample(self, values, min_anomaly, max_anomaly, method)
1042
1043 time_values = self._generate_time_values(nu_values)
-> 1044 return propagate(self, time.TimeDelta(time_values), method=method)
1045
1046 def _generate_time_values(self, nu_vals):
~/Development/poliastro/poliastro-library/src/poliastro/twobody/propagation.py in propagate(orbit, time_of_flight, method, rtol, **kwargs)
225 # If the frame supports obstime, set the time values
226 kwargs = {}
--> 227 if "obstime" in orbit.frame.frame_attributes:
228 kwargs["obstime"] = orbit.epoch + time_of_flight
229 else:
~/Development/poliastro/poliastro-library/src/poliastro/twobody/orbit.py in frame(self)
99 """
100 if self._frame is None:
--> 101 self._frame = get_frame(self.attractor, self._plane, self.epoch)
102
103 return self._frame
~/Development/poliastro/poliastro-library/src/poliastro/frames.py in get_frame(attractor, plane, obstime)
256 except KeyError:
257 raise NotImplementedError(
--> 258 "Frames for orbits around custom bodies are not yet supported"
259 )
260
NotImplementedError: Frames for orbits around custom bodies are not yet supported
Perhaps instead of being so strict, we could raise a warning and “just” return the CartesianCoordinates
. And in that case, perhaps poliastro.twobody.propagation.propagate
should ignore the frame, and just produce coordinates:
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Bizarre Lunar Orbits | Science Mission Directorate
"If the Moon were a uniform sphere, you could have an orbit that was perfect ellipse or circle," Konopliv explained. "The Moon has...
Read more >Orbit of the Moon - Wikipedia
The Moon orbits Earth in the prograde direction and completes one revolution relative to the Vernal Equinox and the stars in about 27.32...
Read more >Can moons have moons? (Intermediate) - Ask an Astronomer
The only problem is that the sub-satellite cannot stay in orbit around the Moon indefinitely because of tides.
Read more >Orbit - TuHS Physics
New Quantities; Formulae; General Problem Solving Strategy; Example ... and a mass of 7.36(10 22 )kg, how high above the Moon's surface is...
Read more >Why Doesn't the Moon Fall Down? - PBS LearningMedia
Astronomer Doris Daou explains how the forces of speed and gravity keep the Moon in a constant orbit around Earth in this animated...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
nice is fixe !
(See #797)