Pyephem: 'Titan' object has no attribute 'mag'

249 views Asked by At

I tried to determine the magnitude of Titan, but the result is this error message: AttributeError: 'Titan' object has no attribute 'mag'

>>> import ephem
>>> t = ephem.Titan()
>>> t.compute()
>>> t.ra
15:55:10.52
>>> t.mag
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'Titan' object has no attribute 'mag'

Doesn't Titan have the attribute magnitude? Why? I can determine the magnitude for Uranus, or the Moon, but not for Titan. At least not with the 'mag' attribute. What would be the way?

edit: With versions 3.7.5.3 and 3.7.5.1 of ephem.

1

There are 1 answers

1
Joel Johnson On

According to the PyEphem Homepage Docs

The ephem.Body type is the only type with a .mag attribute

Titan is classified as a ephem.PlanetMoon object and so does not have a .mag attribute

The current list of ephem.Body objects are: Jupiter,Mars,Mercury,Moon,Neptune,Pluto,Saturn,Sun,Uranus,Venus.

I am not aware of any way in ephem to calculate the .mag of an ephem.PlanetMoon object