2

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.

Inaki
  • 71
  • 5
  • As far as I can see, Titan should have a magnitude. Reference: https://github.com/brandon-rhodes/pyephem/blob/master/libastro-3.7.6/satmoon.c – Nayuki Jun 08 '15 at 15:31

1 Answers1

4

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

xnx
  • 24,509
  • 11
  • 70
  • 109
Joel Johnson
  • 186
  • 7
  • Thanks. I will try to calculate Titan's magnitude depending on Saturn's magnitude. I hoped to obtain it directly but apparently it is not possible... Thanks anyway! – Inaki Jun 10 '15 at 07:52