SNOPO/SNOPO

258 lines
12 KiB
Plaintext
Raw Permalink Normal View History

2022-08-13 18:49:21 -06:00
#!/usr/bin/env python3
2022-08-13 19:40:03 -06:00
"""
SNOPO
Create diagram of SatNOGS Optical Process Overview.
Copyright (C) 2022, Jeff Moe
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
2022-08-13 18:49:21 -06:00
import graphviz
2022-08-14 16:09:33 -06:00
good_color = "green"
ok_color = "yellow"
bad_color = "red"
vid_shape = "rect"
cam_shape = "egg"
py_shape = "circle"
2022-08-14 17:54:29 -06:00
header_font = "helvetica bold"
header_font_size = "20"
header_font = "helvetica bold"
header_font_size = "20"
sub_font = "helvetica italic"
sub_font_size = "14"
start_font = "helvetica"
start_font_size = "18"
node_font = "ariel"
node_font_size = "14"
code_font = "courier"
code_font_size = "14"
2022-08-14 15:28:30 -06:00
2022-08-13 18:49:21 -06:00
g = graphviz.Digraph(
name="SatNOGS Optical",
comment="Process Graph",
2022-08-13 18:53:57 -06:00
filename="SNOPO",
2022-08-13 18:49:21 -06:00
directory="tmp",
engine="dot",
renderer="cairo",
formatter="cairo",
graph_attr="",
node_attr="",
edge_attr="",
)
g.attr(rankdir="LR")
2022-08-14 14:04:00 -06:00
g.attr(
bgcolor="seashell2:seashell",
2022-08-14 17:21:22 -06:00
label="SatNOGS Optical Process Overview",
2022-08-14 14:04:00 -06:00
fontcolor="black",
2022-08-14 17:54:29 -06:00
fontname=header_font,
fontsize=header_font_size
2022-08-14 14:04:00 -06:00
)
2022-08-13 18:49:21 -06:00
2022-08-13 18:49:21 -06:00
with g.subgraph(name="cluster_hardware") as a:
a.attr(style="filled", color="lightgrey")
2022-08-14 17:54:29 -06:00
a.attr(label="Hardware")
2022-08-13 18:49:21 -06:00
with a.subgraph(name="cluster_video") as b:
2022-08-14 17:54:29 -06:00
b.attr(style="filled", color="cornsilk", label="Motion Video Cameras", fontname=sub_font, fontsize=sub_font_size)
b.node_attr.update(style="filled", color="darkkhaki", shape="rect", fontname=node_font, fontsize=node_font_size)
2022-08-16 09:54:05 -06:00
b.node("n_uvc", label="UVC/V4L2")
b.node("n_cv", label="OpenCV")
2022-08-14 20:39:33 -06:00
b.node("n_pi", label="Raspberry Pi")
2022-08-16 09:54:05 -06:00
b.node("n_tis", label="The Imaging Source")
b.node("n_asi", label="ZWO ASI")
2022-08-14 15:28:30 -06:00
b.edge("n_uvc", "n_video", color=good_color)
b.edge("n_cv", "n_video", color=good_color)
b.edge("n_pi", "n_video", color=good_color)
2022-08-19 11:18:34 -06:00
b.edge("n_tis", "n_video", color=good_color)
2022-08-14 15:28:30 -06:00
b.edge("n_asi", "n_video", color=good_color)
2022-08-13 18:49:21 -06:00
with a.subgraph(name="cluster_camera") as c:
2022-08-14 14:04:00 -06:00
c.attr(
style="filled",
color="lightskyblue",
label="Still Cameras",
fontcolor="black",
2022-08-14 17:54:29 -06:00
fontname=sub_font,
fontsize=sub_font_size,
2022-08-14 14:04:00 -06:00
)
c.node_attr.update(
style="filled",
color="midnightblue",
2022-08-14 16:29:53 -06:00
shape="rect",
2022-08-14 14:04:00 -06:00
fontcolor="white",
2022-08-14 17:54:29 -06:00
fontname=node_font, fontsize=node_font_size
2022-08-14 14:04:00 -06:00
)
c.node("n_gphoto", label="gphoto2")
c.node("n_canon", label="Canon DSLR")
c.node("n_nikon", label="Nikon DSLR")
2022-08-14 20:35:31 -06:00
c.node("n_telescope", label="Telescope")
c.node("n_indi", label="INDI")
2022-08-14 15:28:30 -06:00
c.edge("n_gphoto", "n_camera", color=good_color)
c.edge("n_canon", "n_camera", color=good_color)
c.edge("n_nikon", "n_camera", color=good_color)
2022-08-14 20:35:31 -06:00
c.edge("n_telescope", "n_camera", color=bad_color)
2022-08-14 18:05:23 -06:00
c.edge("n_indi", "n_camera", color=bad_color)
2022-08-13 19:52:09 -06:00
with a.subgraph(name="cluster_allsky") as d:
2022-08-14 14:04:00 -06:00
d.attr(
2022-08-14 17:54:29 -06:00
style="filled", color="plum2", label="Allsky Cameras", fontcolor="black", fontname=sub_font, fontsize=sub_font_size
2022-08-14 14:04:00 -06:00
)
d.node_attr.update(
2022-08-14 17:54:29 -06:00
style="filled", color="seashell2", shape="rect", fontcolor="black", fontname=node_font, fontsize=node_font_size
2022-08-14 14:04:00 -06:00
)
2022-08-14 20:39:33 -06:00
d.node("n_asi_allsky", label="ZWO ASI Allsky")
d.node("n_oculus", label="Starlight Xpress Oculus")
d.node("n_indi_allsky", label="INDI Allsky")
2022-08-14 15:28:30 -06:00
d.edge("n_asi_allsky", "n_allsky", color=good_color)
2022-08-14 18:05:23 -06:00
d.edge("n_oculus", "n_allsky", color=bad_color)
d.edge("n_indi_allsky", "n_allsky", color=bad_color)
2022-08-13 18:49:21 -06:00
with g.subgraph(name="cluster_repository") as a:
a.attr(style="filled", color="palegreen4", label="Repository")
2022-08-14 17:54:29 -06:00
a.attr(label="Software\nRepository")
2022-08-13 18:49:21 -06:00
with a.subgraph(name="cluster_camera_software") as b:
b.attr(color="lightblue")
2022-08-14 17:54:29 -06:00
b.node_attr.update(style="filled", color="lightgoldenrodyellow", shape="rect", fontname=node_font, fontsize=node_font_size)
b.node("n_video", label="Video")
b.node("n_camera", label="Camera")
b.node("n_allsky", label="Allsky")
b.node("n_stvid", label="stvid")
b.node("n_stphot", label="stphot")
b.node("n_asm", label="asm")
2022-08-14 15:28:30 -06:00
b.edge("n_video", "n_stvid", color=good_color)
b.edge("n_camera", "n_stphot", color=good_color)
b.edge("n_allsky", "n_asm", color=good_color)
2022-08-14 17:54:29 -06:00
b.attr(label="Development\nPython", fontname=sub_font, fontsize=sub_font_size)
2022-08-13 18:49:21 -06:00
with a.subgraph(name="cluster_c_software") as c:
2022-08-14 16:29:53 -06:00
c.attr(color="palevioletred4")
2022-08-14 17:54:29 -06:00
c.node_attr.update(style="filled", color="lightsteelblue1", shape="rect", fontname=node_font, fontsize=node_font_size)
2022-08-13 18:49:21 -06:00
c.node_attr["style"] = "filled"
c.node("n_sattools", label="sattools")
2022-08-14 15:28:30 -06:00
c.edge("n_video", "n_sattools", color=good_color)
c.edge("n_camera", "n_sattools", color=good_color)
2022-08-14 17:54:29 -06:00
c.attr(label="Legacy\nC", fontname=sub_font, fontsize=sub_font_size)
2022-08-13 18:49:21 -06:00
with g.subgraph(name="cluster_acquire") as a:
2022-08-13 19:52:09 -06:00
a.attr(style="filled", color="pink", label="Acquire")
a.attr(label="Acquire Sample")
2022-08-13 18:49:21 -06:00
with a.subgraph(name="cluster_camera_acquire") as b:
b.attr(color="lightblue")
2022-08-14 17:54:29 -06:00
b.node_attr.update(style="filled", color="wheat3", shape="rect", fontname=node_font, fontsize=node_font_size)
b.node(
2022-08-14 16:29:53 -06:00
"n_sattools_cacquire", label="sattools\nget.sh\ngphoto2\njpg2fits"
)
2022-08-14 16:29:53 -06:00
b.node("n_stphot_acquire", label="stphot\nacquire.py")
b.node("n_asm_acquire", label="asm\ncapture")
2022-08-14 15:28:30 -06:00
b.edge("n_sattools", "n_sattools_cacquire", color=good_color)
b.edge("n_stphot", "n_stphot_acquire", color=good_color)
b.edge("n_asm", "n_asm_acquire", color=good_color)
2022-08-14 18:22:59 -06:00
b.attr(label="Camera", fontname=sub_font, fontsize=sub_font_size)
2022-08-13 18:49:21 -06:00
with a.subgraph(name="cluster_video_acquire") as c:
2022-08-14 16:29:53 -06:00
c.attr(color="olivedrab3")
2022-08-14 17:54:29 -06:00
c.node_attr.update(style="filled", color="plum", shape="rect", fontname=node_font, fontsize=node_font_size)
2022-08-14 16:29:53 -06:00
c.node("n_sattools_vacquire", label="sattools\nUNKNOWN")
c.node("n_stvid_acquire", label="stvid\nacquire.py")
2022-08-14 15:35:57 -06:00
c.edge("n_sattools", "n_sattools_vacquire", color=ok_color)
2022-08-14 15:28:30 -06:00
c.edge("n_stvid", "n_stvid_acquire", color=good_color)
2022-08-14 18:22:59 -06:00
c.attr(label="Video", fontname=sub_font, fontsize=sub_font_size)
2022-08-13 18:49:21 -06:00
with g.subgraph(name="cluster_platesolver") as a:
2022-08-13 19:52:09 -06:00
a.attr(style="filled", color="tan", label="Plate Solver")
a.attr(label="Plate Solver")
2022-08-13 18:49:21 -06:00
with a.subgraph(name="cluster_camera_plate_solver") as b:
b.attr(color="lightblue")
2022-08-14 17:54:29 -06:00
b.node_attr.update(style="filled", color="silver", shape="rect", fontname=node_font, fontsize=node_font_size)
2022-08-14 16:29:53 -06:00
b.node("n_sattools_cplate", label="sattools\nfind.sh\nsource-extractor")
2022-08-14 17:18:03 -06:00
b.node("n_stphot_plate", label="stphot\nUse sattools")
2022-08-14 17:04:38 -06:00
b.node("n_asm_plate", label="asm\nNONE")
2022-08-14 15:28:30 -06:00
b.edge("n_sattools_cacquire", "n_sattools_cplate", color=good_color)
2022-08-14 17:18:03 -06:00
b.edge("n_stphot_acquire", "n_sattools_cplate", color=good_color)
2022-08-14 15:35:57 -06:00
b.edge("n_stphot_acquire", "n_stphot_plate", color=bad_color)
b.edge("n_asm_acquire", "n_asm_plate", color=bad_color)
2022-08-14 18:22:59 -06:00
b.attr(label="Camera", fontname=sub_font, fontsize=sub_font_size)
2022-08-13 18:49:21 -06:00
with a.subgraph(name="cluster_video_platesolver") as c:
2022-08-14 16:29:53 -06:00
c.attr(color="goldenrod3")
2022-08-14 17:54:29 -06:00
c.node_attr.update(style="filled", color="paleturquoise3", shape="rect", fontname=node_font, fontsize=node_font_size)
2022-08-14 16:29:53 -06:00
c.node("n_sattools_vplate", label="sattools\nUNKNOWN")
c.node("n_stvid_plate", label="stvid\nprocess.py")
2022-08-14 15:35:57 -06:00
c.edge("n_sattools_vacquire", "n_sattools_vplate", color=ok_color)
2022-08-14 15:28:30 -06:00
c.edge("n_stvid_acquire", "n_stvid_plate", color=good_color)
2022-08-14 18:22:59 -06:00
c.attr(label="Video", fontname=sub_font, fontsize=sub_font_size)
2022-08-13 18:49:21 -06:00
2022-08-14 13:17:01 -06:00
with g.subgraph(name="cluster_satdetect") as a:
a.attr(style="filled", color="lightblue", label="satdetect")
a.attr(label="Detect Satellites")
2022-08-14 13:17:01 -06:00
with a.subgraph(name="cluster_camera_satdetect") as b:
2022-08-14 16:29:53 -06:00
b.attr(color="khaki2")
2022-08-14 17:54:29 -06:00
b.node_attr.update(style="filled", color="olivedrab3", shape="rect", fontname=node_font, fontsize=node_font_size)
2022-08-14 16:29:53 -06:00
b.node("n_sattools_cdetect", label="sattools\nid.sh\naddwcs\nsatid")
2022-08-14 17:18:03 -06:00
b.node("n_stphot_detect", label="stphot\nNONE")
2022-08-14 17:04:38 -06:00
b.node("n_asm_detect", label="asm\nNONE")
2022-08-14 15:28:30 -06:00
b.edge("n_sattools_cplate", "n_sattools_cdetect", color=good_color)
2022-08-14 15:35:57 -06:00
b.edge("n_stphot_plate", "n_stphot_detect", color=bad_color)
b.edge("n_asm_plate", "n_asm_detect", color=bad_color)
2022-08-14 18:22:59 -06:00
b.attr(label="Camera", fontname=sub_font, fontsize=sub_font_size)
2022-08-14 13:17:01 -06:00
with a.subgraph(name="cluster_video_satdetect") as c:
2022-08-14 16:29:53 -06:00
c.attr(color="aquamarine4")
2022-08-14 17:54:29 -06:00
c.node_attr.update(style="filled", color="ivory2", shape="rect", fontname=node_font, fontsize=node_font_size)
2022-08-14 16:29:53 -06:00
c.node("n_sattools_vdetect", label="sattools\nUNKNOWN")
c.node("n_stvid_detect", label="stvid\nprocess.py")
2022-08-14 15:35:57 -06:00
c.edge("n_sattools_vplate", "n_sattools_vdetect", color=ok_color)
2022-08-14 15:28:30 -06:00
c.edge("n_stvid_plate", "n_stvid_detect", color=good_color)
2022-08-14 18:22:59 -06:00
c.attr(label="Video", fontname=sub_font, fontsize=sub_font_size)
2022-08-14 13:17:01 -06:00
2022-08-13 18:49:21 -06:00
with g.subgraph(name="cluster_satid") as a:
2022-08-14 16:29:53 -06:00
a.attr(style="filled", color="darkseagreen4", label="satid")
a.attr(label="Identify Satellites")
2022-08-13 18:49:21 -06:00
with a.subgraph(name="cluster_camera_satid") as b:
2022-08-14 16:29:53 -06:00
b.attr(color="yellow3")
2022-08-14 17:54:29 -06:00
b.node_attr.update(style="filled", color="darkseagreen3", shape="rect", fontname=node_font, fontsize=node_font_size)
2022-08-14 16:29:53 -06:00
b.node("n_sattools_cid", label="sattools\nid.sh\naddwcs\nsatid")
2022-08-14 17:18:03 -06:00
b.node("n_stphot_id", label="stphot\nNONE")
2022-08-14 17:04:38 -06:00
b.node("n_asm_id", label="asm\nNONE")
2022-08-14 15:28:30 -06:00
b.edge("n_sattools_cdetect", "n_sattools_cid", color=good_color)
2022-08-14 15:35:57 -06:00
b.edge("n_stphot_detect", "n_stphot_id", color=bad_color)
b.edge("n_asm_detect", "n_asm_id", color=bad_color)
2022-08-14 18:22:59 -06:00
b.attr(label="Camera", fontname=sub_font, fontsize=sub_font_size)
2022-08-13 19:12:59 -06:00
with a.subgraph(name="cluster_video_satid") as c:
2022-08-14 16:29:53 -06:00
c.attr(color="thistle")
2022-08-14 17:54:29 -06:00
c.node_attr.update(style="filled", color="steelblue", shape="rect", fontname=node_font, fontsize=node_font_size)
2022-08-14 16:29:53 -06:00
c.node("n_sattools_vid", label="sattools\nUNKNOWN")
c.node("n_stvid_id", label="stvid\nprocess.py")
2022-08-14 15:35:57 -06:00
c.edge("n_sattools_vdetect", "n_sattools_vid", color=ok_color)
2022-08-14 15:28:30 -06:00
c.edge("n_stvid_detect", "n_stvid_id", color=good_color)
2022-08-14 18:22:59 -06:00
c.attr(label="Video", fontname=sub_font, fontsize=sub_font_size)
2022-08-13 18:49:21 -06:00
g.attr("node", shape="doublecircle", style="filled", color="orange")
2022-08-14 17:54:29 -06:00
g.node("n_start", label="Start\nHere", fontname=start_font, fontsize=start_font_size)
2022-08-14 15:28:30 -06:00
g.edge("n_start", "n_indi", color=good_color)
g.edge("n_start", "n_gphoto", color=good_color)
g.edge("n_start", "n_canon", color=good_color)
g.edge("n_start", "n_nikon", color=good_color)
2022-08-14 20:36:07 -06:00
g.edge("n_start", "n_telescope", color=good_color)
2022-08-14 15:28:30 -06:00
g.edge("n_start", "n_asi", color=good_color)
g.edge("n_start", "n_pi", color=good_color)
2022-08-16 09:54:05 -06:00
g.edge("n_start", "n_tis", color=good_color)
2022-08-14 15:28:30 -06:00
g.edge("n_start", "n_cv", color=good_color)
g.edge("n_start", "n_uvc", color=good_color)
g.edge("n_start", "n_indi_allsky", color=good_color)
g.edge("n_start", "n_asi_allsky", color=good_color)
g.edge("n_start", "n_oculus", color=good_color)
2022-08-13 18:49:21 -06:00
g.attr("node", shape="rectangle", style="filled", color="grey")
g.render(view=False, format="png")