5 - Creating a Basic Optic Plot


Tutorial - Map Plot

Starplot also has optic plots, which simulate what you'll see through an optic (e.g. binoculars, telescope, camera) at a specific time and location. The simulated view will show you the true field of view for the optic, and it will even orient the stars based on the location you specify and the most logical position of your optic.

Optic plots work very similar to map plots, with a few key differences: they always require a date/time and location, and they also require an optic.

For example, here's how you'd create an optic plot of the Beehive Star Cluster (M44), viewed through 10x binoculars at 9pm PT on April 8, 2024 from Palomar Mountain:

from datetime import datetime
from pytz import timezone
from starplot import OpticPlot
from starplot.optics import Binoculars
from starplot.styles import PlotStyle, extensions

dt = datetime.now(timezone("US/Pacific")).replace(2024, 4, 8, 21, 0, 0)

style = PlotStyle().extend(
    extensions.GRAYSCALE_DARK,
    extensions.OPTIC,
    {"star": {"marker": {"size": 58}}},  # make the stars bigger
)

p = OpticPlot(
    # target location - M44
    ra=8.667,
    dec=19.67,
    # observer location - Palomar Mountain
    lat=33.363484,
    lon=-116.836394,
    # define the optic - 10x binoculars with a 65 degree field of view
    optic=Binoculars(
        magnification=10,
        fov=65,
    ),
    dt=dt,
    style=style,
    resolution=1600,
)
p.stars(mag=12, catalog="big-sky-mag11", bayer_labels=True)

p.export("tutorial_05.png", padding=0.1, transparent=True)

The first 13 lines should look familiar from the other plots we've created in this tutorial.

Line 15 is where we create the instance of an OpticPlot. Most of the kwargs are the same as the map plot's kwargs, except for the following:

  • ra: Right ascension of the target
  • dec: Declination of the target
  • optic: An instance of an optic. This example uses binoculars, but Starplot also supports refractor/reflector telescopes, generic scopes, and cameras.

The ra/dec you specify for the target will be the center of the plot.

On line 31, we plot stars down to magnitude 14, but we also specify the star catalog to use. By default, Starplot uses the Hipparcos catalog, but it also has the Big Sky Catalog built-in which has many more stars.

In the next section, we'll learn how to be more selective of objects to plot...