First Last - Midterm


In [ ]:
import numpy as np

from astropy.table import QTable
from astropy import units as u
from astropy import constants as const

In [ ]:
class SpaceRock(object):
    
    def __init__(self, name = None, ab_mag = None, albedo = None, 
                 semi_major= None, ecc = None):
        
        self.name = name
        self.ab_mag = ab_mag
        self.albedo = albedo
        self.semi_major = semi_major
        self.ecc = ecc
        
    def diameter(self):
        result = (1329.0 / np.sqrt(self.albedo)) * (10 ** (-0.2 * self.ab_mag))
        return result * u.km