summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/simple/realwallpaper/get_constellations.py
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2023-09-09 19:42:08 +0200
committermakefu <github@syntax-fehler.de>2023-09-09 19:42:08 +0200
commit29d72c898d674d2c18fc0f4a76b5e623de0c3dfe (patch)
treefc4b0695c986a1cda6f1fbbbcbe716e203c54fa3 /krebs/5pkgs/simple/realwallpaper/get_constellations.py
parente157ffa72856e4378aa23b096b2efff233f3cb3d (diff)
parent083229d0211096daec08673f743ccc45b1d8a0ac (diff)
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'krebs/5pkgs/simple/realwallpaper/get_constellations.py')
-rw-r--r--krebs/5pkgs/simple/realwallpaper/get_constellations.py29
1 files changed, 17 insertions, 12 deletions
diff --git a/krebs/5pkgs/simple/realwallpaper/get_constellations.py b/krebs/5pkgs/simple/realwallpaper/get_constellations.py
index 5d8d3df5..4ba766f6 100644
--- a/krebs/5pkgs/simple/realwallpaper/get_constellations.py
+++ b/krebs/5pkgs/simple/realwallpaper/get_constellations.py
@@ -18,19 +18,24 @@ def points_to_lines(points):
return lines
-with open(sys.argv[1]) as f:
- constellations = json.load(f)['features']
+def main():
+ with open(sys.argv[1]) as f:
+ constellations = json.load(f)['features']
-output = []
+ output = []
-for const in constellations:
- for line in const['geometry']['coordinates']:
- transformed_line = []
- for point in line:
- transformed_line.append(convert_to_itrs(point))
+ for const in constellations:
+ for line in const['geometry']['coordinates']:
+ transformed_line = []
+ for point in line:
+ transformed_line.append(convert_to_itrs(point))
- line_combined = points_to_lines(transformed_line)
- for l in line_combined: # noqa
- output.append(f'{l[0][0]} {l[0][1]} {l[1][0]} {l[1][1]} # {const["id"]}') # noqa
+ line_combined = points_to_lines(transformed_line)
+ for l in line_combined: # noqa
+ output.append(f'{l[0][0]} {l[0][1]} {l[1][0]} {l[1][1]} # {const["id"]}') # noqa
-print('\n'.join(output))
+ print('\n'.join(output))
+
+
+if __name__ == "__main__":
+ main()