SNOPO/SNOPO

134 lines
5.1 KiB
Python
Executable File

#!/usr/bin/env python3
"""
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/>.
"""
import graphviz
g = graphviz.Digraph(
name="SatNOGS Optical",
comment="Process Graph",
filename="SNOPO",
directory="tmp",
engine="dot",
renderer="cairo",
formatter="cairo",
graph_attr="",
node_attr="",
edge_attr="",
)
g.attr(rankdir="LR")
g.attr(bgcolor='white:white', label='DRAFT SatNOGS Optical Process Overview DRAFT', fontcolor='black')
with g.subgraph(name="cluster_hardware") as a:
a.attr(style="filled", color="lightgrey")
a.node_attr.update(style="filled", color="pink", shape="rectangle")
with a.subgraph(name="cluster_video") as b:
b.attr(style="filled", color="lightgreen", label="Motion Video Cameras")
b.edge("UVC", "Video")
b.edge("OpenCV", "Video")
b.edge("Raspberry Pi", "Video")
b.edge("ZWO ASI", "Video")
with a.subgraph(name="cluster_camera") as c:
c.attr(style="filled", color="lightgreen", label="Still Cameras")
c.edge("gphoto2", "Camera")
c.edge("Canon DSLR", "Camera")
c.edge("Nikon DSLR", "Camera")
c.edge("INDI", "Camera")
a.attr(label="Hardware\nChoose One")
with g.subgraph(name="cluster_repository") as a:
a.attr(style="filled", color="lightgreen", label="foooo")
with a.subgraph(name="cluster_camera_software") as b:
b.attr(color="lightblue")
b.node_attr["style"] = "filled"
b.edge("Video", "stvid")
b.edge("Camera", "stphot")
b.attr(label="Development\nPython")
with a.subgraph(name="cluster_c_software") as c:
c.attr(color="tan")
c.node_attr["style"] = "filled"
c.edge("Video", "sattools")
c.edge("Camera", "sattools")
c.attr(label="Legacy\nC")
a.attr(label="Software\nRepository\nChoose One")
with g.subgraph(name="cluster_acquire") as a:
a.attr(style="filled", color="pink", label="foooo")
with a.subgraph(name="cluster_camera_acquire") as b:
b.attr(color="lightblue")
b.node_attr["style"] = "filled"
b.edge("sattools", "sattools/scripts/get.sh")
b.edge("stphot", "stphot/acquire.py")
b.attr(label="Camera\nSample")
with a.subgraph(name="cluster_video_acquire") as c:
c.attr(color="tan")
c.node_attr["style"] = "filled"
c.edge("stvid", "stvid/acquire.py")
c.edge("sattools", "sattools/UNKNOWN-vid-get.sh")
c.attr(label="Video\nSample")
a.attr(label="Acquire Sample")
with g.subgraph(name="cluster_platesolver") as a:
a.attr(style="filled", color="tan", label="foooo")
with a.subgraph(name="cluster_camera_plate_solver") as b:
b.attr(color="lightblue")
b.node_attr["style"] = "filled"
b.edge("sattools/scripts/get.sh", "sattools/scripts/find.sh")
b.edge("stphot/acquire.py", "stphot/UNKNOWN-find.py")
b.attr(label="Camera\nPlate Solver")
with a.subgraph(name="cluster_video_platesolver") as c:
c.attr(color="pink")
c.node_attr["style"] = "filled"
c.edge("sattools/UNKNOWN-vid-get.sh", "sattools/UNKNOWN-vid-find.sh")
c.edge("stvid/acquire.py", "stvid/UNKNOWN-find.py")
c.attr(label="Video\nPlate Solver")
a.attr(label="Plate Solver")
with g.subgraph(name="cluster_satid") as a:
a.attr(style="filled", color="lightblue", label="satid")
with a.subgraph(name="cluster_camera_satid") as b:
b.attr(color="tan")
b.node_attr["style"] = "filled"
b.edge("sattools/scripts/find.sh", "sattools/scripts/id.sh")
b.edge("stphot/UNKNOWN-find.py", "stphot/UNKNOWN-id.py")
b.attr(label="Camera\nID Satellite")
with a.subgraph(name="cluster_video_satid") as c:
c.attr(color="tan")
c.node_attr["style"] = "filled"
c.edge("sattools/UNKNOWN-vid-find.sh", "sattools/UNKNOWN-vid-id.sh")
c.edge("stvid/UNKNOWN-find.py", "stvid/UNKNOWN-id.py")
c.attr(label="Video\nID Satellite")
a.attr(label="Identify Satellites")
g.attr("node", shape="doublecircle", style="filled", color="orange")
g.edge("Start\nHere", "INDI")
g.edge("Start\nHere", "gphoto2")
g.edge("Start\nHere", "Canon DSLR")
g.edge("Start\nHere", "Nikon DSLR")
g.edge("Start\nHere", "ZWO ASI")
g.edge("Start\nHere", "Raspberry Pi")
g.edge("Start\nHere", "OpenCV")
g.edge("Start\nHere", "UVC")
g.attr("node", shape="rectangle", style="filled", color="grey")
g.render(view=False, format="png")