SNOPO/SNOPO

193 lines
7.3 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="seashell2:seashell",
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="cornsilk", label="Motion Video Cameras")
b.node_attr.update(style="filled", color="darkkhaki", shape="tripleoctagon")
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="lightskyblue",
label="Still Cameras",
fontcolor="black",
)
c.node_attr.update(
style="filled",
color="midnightblue",
shape="doubleoctagon",
fontcolor="white",
)
c.edge("gphoto2", "Camera")
c.edge("Canon DSLR", "Camera")
c.edge("Nikon DSLR", "Camera")
c.edge("INDI", "Camera")
with a.subgraph(name="cluster_allsky") as d:
d.attr(
style="filled", color="slateblue", label="Allsky Cameras", fontcolor="white"
)
d.node_attr.update(
style="filled", color="peru", shape="octagon", fontcolor="black"
)
d.edge("ZWO ASI Allsky", "Allsky")
d.edge("Starlight Xpress Oculus", "Allsky")
d.edge("INDI Allsky", "Allsky")
a.attr(label="Hardware\nChoose One")
with g.subgraph(name="cluster_repository") as a:
a.attr(style="filled", color="lightgreen", label="Repository")
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.edge("Allsky", "asm")
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="Acquire")
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\ngphoto2\njpg2fits")
b.edge("stphot", "stphot/acquire.py")
b.edge("asm", "asm/capture")
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("sattools", "sattools/UNKNOWN-vid-get.sh")
c.edge("stvid", "stvid/acquire.py")
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="Plate Solver")
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\ngphoto2\njpg2fits",
"sattools/scripts/find.sh\nsource-extractor",
)
b.edge("stphot/acquire.py", "stphot/UNKNOWN-find.py")
b.edge("asm/capture", "asm/UNKNOWN-find")
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/process.py")
c.attr(label="Video\nPlate Solver")
a.attr(label="Plate Solver")
with g.subgraph(name="cluster_satdetect") as a:
a.attr(style="filled", color="lightblue", label="satdetect")
with a.subgraph(name="cluster_camera_satdetect") as b:
b.attr(color="tan")
b.node_attr["style"] = "filled"
b.edge(
"sattools/scripts/find.sh\nsource-extractor",
"sattools/scripts/id.sh\naddwcs\nsatid\nDetect",
)
b.edge("stphot/UNKNOWN-find.py", "stphot/UNKNOWN-id.py\nDetect")
b.edge("asm/UNKNOWN-find", "asm/UNKNOWN-id\nDetect")
b.attr(label="Camera\nDetect Satellites")
with a.subgraph(name="cluster_video_satdetect") as c:
c.attr(color="tan")
c.node_attr["style"] = "filled"
c.edge("sattools/UNKNOWN-vid-find.sh", "sattools/UNKNOWN-vid-id.sh\nDetect")
c.edge("stvid/process.py", "stvid/process.py\nDetect")
c.attr(label="Video\nDetect Satellites")
a.attr(label="Detect Satellites")
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/id.sh\naddwcs\nsatid\nDetect",
"sattools/scripts/id.sh\naddwcs\nsatid\nID",
)
b.edge("stphot/UNKNOWN-id.py\nDetect", "stphot/UNKNOWN-id.py\nID")
b.edge("asm/UNKNOWN-id\nDetect", "asm/UNKNOWN-id\nID")
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-id.sh\nDetect", "sattools/UNKNOWN-vid-id.sh\nID")
c.edge("stvid/process.py\nDetect", "stvid/process.py\nID")
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.edge("Start\nHere", "INDI Allsky")
g.edge("Start\nHere", "ZWO ASI Allsky")
g.edge("Start\nHere", "Starlight Xpress Oculus")
g.attr("node", shape="rectangle", style="filled", color="grey")
g.render(view=False, format="png")