#!/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 . """ import graphviz good_color = "green" ok_color = "yellow" bad_color = "red" vid_shape = "rect" cam_shape = "egg" py_shape = "circle" 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.attr(label="Hardware\nChoose One") 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="rect") b.node("n_uvc", label="UVC") b.node("n_cv", label="OpenCV") b.node("n_pi", label="Raspberry\nPi") b.node("n_asi", label="ZWO ASI") 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) b.edge("n_asi", "n_video", color=good_color) 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="rect", fontcolor="white", ) c.node("n_gphoto", label="gphoto2") c.node("n_canon", label="Canon DSLR") c.node("n_nikon", label="Nikon DSLR") c.node("n_indi", label="INDI") 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) c.edge("n_indi", "n_camera", color=good_color) with a.subgraph(name="cluster_allsky") as d: d.attr( style="filled", color="plum2", label="Allsky Cameras", fontcolor="black" ) d.node_attr.update( style="filled", color="seashell2", shape="rect", fontcolor="black" ) d.node("n_asi_allsky", label="ZWO ASI\nAllsky") d.node("n_oculus", label="Starlight\nXpress\nOculus") d.node("n_indi_allsky", label="INDI Allsky") d.edge("n_asi_allsky", "n_allsky", color=good_color) d.edge("n_oculus", "n_allsky", color=good_color) d.edge("n_indi_allsky", "n_allsky", color=good_color) with g.subgraph(name="cluster_repository") as a: a.attr(style="filled", color="palegreen4", label="Repository") a.attr(label="Software\nRepository\nChoose One") with a.subgraph(name="cluster_camera_software") as b: b.attr(color="lightblue") b.node_attr.update(style="filled", color="lightgoldenrodyellow", shape="rect") 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") 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) b.attr(label="Development\nPython") with a.subgraph(name="cluster_c_software") as c: c.attr(color="palevioletred4") c.node_attr.update(style="filled", color="lightsteelblue1", shape="rect") c.node_attr["style"] = "filled" c.node("n_sattools", label="sattools") c.edge("n_video", "n_sattools", color=good_color) c.edge("n_camera", "n_sattools", color=good_color) c.attr(label="Legacy\nC") with g.subgraph(name="cluster_acquire") as a: a.attr(style="filled", color="pink", label="Acquire") a.attr(label="Acquire Sample") with a.subgraph(name="cluster_camera_acquire") as b: b.attr(color="lightblue") b.node_attr.update(style="filled", color="wheat3", shape="rect") b.node( "n_sattools_cacquire", label="sattools\nget.sh\ngphoto2\njpg2fits" ) b.node("n_stphot_acquire", label="stphot\nacquire.py") b.node("n_asm_acquire", label="asm\ncapture") 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) b.attr(label="Camera\nSample") with a.subgraph(name="cluster_video_acquire") as c: c.attr(color="olivedrab3") c.node_attr.update(style="filled", color="plum", shape="rect") c.node("n_sattools_vacquire", label="sattools\nUNKNOWN") c.node("n_stvid_acquire", label="stvid\nacquire.py") c.edge("n_sattools", "n_sattools_vacquire", color=ok_color) c.edge("n_stvid", "n_stvid_acquire", color=good_color) c.attr(label="Video\nSample") with g.subgraph(name="cluster_platesolver") as a: a.attr(style="filled", color="tan", label="Plate Solver") a.attr(label="Plate Solver") with a.subgraph(name="cluster_camera_plate_solver") as b: b.attr(color="lightblue") b.node_attr.update(style="filled", color="silver", shape="rect") b.node("n_sattools_cplate", label="sattools\nfind.sh\nsource-extractor") b.node("n_stphot_plate", label="stphot\nUNKNOWN") b.node("n_asm_plate", label="asm\nUNKNOWN") b.edge("n_sattools_cacquire", "n_sattools_cplate", color=good_color) b.edge("n_stphot_acquire", "n_stphot_plate", color=bad_color) b.edge("n_asm_acquire", "n_asm_plate", color=bad_color) b.attr(label="Camera\nPlate Solver") with a.subgraph(name="cluster_video_platesolver") as c: c.attr(color="goldenrod3") c.node_attr.update(style="filled", color="paleturquoise3", shape="rect") c.node("n_sattools_vplate", label="sattools\nUNKNOWN") c.node("n_stvid_plate", label="stvid\nprocess.py") c.edge("n_sattools_vacquire", "n_sattools_vplate", color=ok_color) c.edge("n_stvid_acquire", "n_stvid_plate", color=good_color) c.attr(label="Video\nPlate Solver") with g.subgraph(name="cluster_satdetect") as a: a.attr(style="filled", color="lightblue", label="satdetect") a.attr(label="Detect Satellites") with a.subgraph(name="cluster_camera_satdetect") as b: b.attr(color="khaki2") b.node_attr.update(style="filled", color="olivedrab3", shape="rect") b.node("n_sattools_cdetect", label="sattools\nid.sh\naddwcs\nsatid") b.node("n_stphot_detect", label="stphot\nUNKNOWN") b.node("n_asm_detect", label="asm\nUNKNOWN") b.edge("n_sattools_cplate", "n_sattools_cdetect", color=good_color) b.edge("n_stphot_plate", "n_stphot_detect", color=bad_color) b.edge("n_asm_plate", "n_asm_detect", color=bad_color) b.attr(label="Camera\nDetect Satellites") with a.subgraph(name="cluster_video_satdetect") as c: c.attr(color="aquamarine4") c.node_attr.update(style="filled", color="ivory2", shape="rect") c.node("n_sattools_vdetect", label="sattools\nUNKNOWN") c.node("n_stvid_detect", label="stvid\nprocess.py") c.edge("n_sattools_vplate", "n_sattools_vdetect", color=ok_color) c.edge("n_stvid_plate", "n_stvid_detect", color=good_color) c.attr(label="Video\nDetect Satellites") with g.subgraph(name="cluster_satid") as a: a.attr(style="filled", color="darkseagreen4", label="satid") a.attr(label="Identify Satellites") with a.subgraph(name="cluster_camera_satid") as b: b.attr(color="yellow3") b.node_attr.update(style="filled", color="darkseagreen3", shape="rect") b.node("n_sattools_cid", label="sattools\nid.sh\naddwcs\nsatid") b.node("n_stphot_id", label="stphot\nUNKNOWN") b.node("n_asm_id", label="asm\nUNKNOWN") b.edge("n_sattools_cdetect", "n_sattools_cid", color=good_color) b.edge("n_stphot_detect", "n_stphot_id", color=bad_color) b.edge("n_asm_detect", "n_asm_id", color=bad_color) b.attr(label="Camera\nID Satellite") with a.subgraph(name="cluster_video_satid") as c: c.attr(color="thistle") c.node_attr.update(style="filled", color="steelblue", shape="rect") c.node("n_sattools_vid", label="sattools\nUNKNOWN") c.node("n_stvid_id", label="stvid\nprocess.py") c.edge("n_sattools_vdetect", "n_sattools_vid", color=ok_color) c.edge("n_stvid_detect", "n_stvid_id", color=good_color) c.attr(label="Video\nID Satellite") g.attr("node", shape="doublecircle", style="filled", color="orange") g.node("n_start", label="Start\nHere") 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) g.edge("n_start", "n_asi", color=good_color) g.edge("n_start", "n_pi", color=good_color) 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) g.attr("node", shape="rectangle", style="filled", color="grey") g.render(view=False, format="png")