Skip to content

Shape sketches

jianyangli edited this page Jul 7, 2017 · 2 revisions

Shape module realizes a shape class and implements methods such as load and save a shape model from and to a data file with some particular format, and performs calculations that rely on the shape of an asteroid, such as its lightcurve at a particular epoch.

Calculate a photometric lightcurve of an asteroid

from sbpy.Photometry import Shape, ROLO
from sbpy.Data import Ephemerides, PhysProp
from astropy.time import Time, TimeDelta
from astropy import units as u
import numpy as np
from matplotlib import pyplot as plt

# load shape model into a shape model class Shape
eros_shape = Shape('shape_model_file')

# load physical property class, which contains the pole (RA, Dec)
phys = PhysProp.from_astorb('eros')

# initialize a disk-resolved photometric model
rolo_model = ROLO(parameters=...)

# calculate lightcurve
epoch = Time('2018-05-14', scale='utc') + TimeDelta(10*u.min)*np.linspace(0,36,20)
mag = []
for e in epoch:
    eph = Ephemerides.from_horizons('eros', '568', e)
    # calculate the total brightness at epoch ```e``` using the physical properties of the shape
    # (pole orientation) and a disk-resolved photometric model (```rolo_model``` here)
    mag_total = eros_shape.total_magnitude(eph, phys, rolo_model)
    mag.append(mag_total)

# make plot
plt.plot_date(epoch.plot_date, mag)