Created
January 6, 2026 09:06
-
-
Save void4/09fc3a7436d23074809ebbae52265fc7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| from starplot import MapPlot, Miller, _ | |
| from starplot.styles import PlotStyle, extensions, LineStyleEnum | |
| from starplot.models import Camera | |
| optic = Camera(sensor_width=36, sensor_height=24, lens_focal_length=2939, rotation=0) | |
| style = PlotStyle().extend( | |
| extensions.BLUE_DARK, | |
| extensions.MAP, | |
| ) | |
| polygonstyle = { | |
| "alpha": 1.0, | |
| "edge_color": "#ffff00", | |
| "line_style": LineStyleEnum.SOLID, | |
| } | |
| def plot_observations(observations): | |
| p = MapPlot( | |
| projection=Miller(), | |
| ra_min=0, | |
| ra_max=360, | |
| dec_min=-80, | |
| dec_max=80, | |
| style=style, | |
| resolution=6000, | |
| # since this map has a very large extent, let's scale everything down | |
| scale=0.8, | |
| ) | |
| p.gridlines() | |
| p.constellations() | |
| p.stars(where=[_.magnitude < 6], where_labels=[_.magnitude < 2.1]) | |
| p.constellation_labels(style__font_size=28) | |
| p.milky_way() | |
| p.ecliptic() | |
| p.celestial_equator() | |
| for observation in observations: | |
| p.optic_fov(ra=observation[0], dec=observation[1], optic=optic, style=polygonstyle) | |
| p.export("map_big.png", padding=0.5) | |
| if __name__ == "__main__": | |
| with open("observations.json") as f: | |
| observations = json.loads(f.read()) | |
| plot_observations(observations) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment