quicksat 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. quicksat/__init__.py +36 -0
  2. quicksat/__main__.py +77 -0
  3. quicksat/agility/__init__.py +9 -0
  4. quicksat/agility/budget.py +872 -0
  5. quicksat/agility/report.py +135 -0
  6. quicksat/data/coastlines.json +1 -0
  7. quicksat/dataflow/__init__.py +5 -0
  8. quicksat/dataflow/budget.py +355 -0
  9. quicksat/dataflow/report.py +229 -0
  10. quicksat/delta_v/__init__.py +5 -0
  11. quicksat/delta_v/budget.py +633 -0
  12. quicksat/delta_v/report.py +231 -0
  13. quicksat/editor/__init__.py +12 -0
  14. quicksat/editor/__main__.py +107 -0
  15. quicksat/editor/editor.py +607 -0
  16. quicksat/editor/server.py +539 -0
  17. quicksat/editor/sizing.py +175 -0
  18. quicksat/editor/templates/scenario/checks.js +178 -0
  19. quicksat/editor/templates/scenario/editor.html +140 -0
  20. quicksat/editor/templates/scenario/project.js +463 -0
  21. quicksat/editor/templates/scenario/run.js +182 -0
  22. quicksat/editor/templates/scenario/sections.js +634 -0
  23. quicksat/editor/templates/scenario/view3d.js +348 -0
  24. quicksat/editor/templates/scenario/views.js +208 -0
  25. quicksat/editor/templates/scenario/write.js +228 -0
  26. quicksat/editor/templates/shared/base.js +218 -0
  27. quicksat/editor/templates/shared/editor.css +338 -0
  28. quicksat/editor/templates/shared/files.js +152 -0
  29. quicksat/editor/templates/shared/frame.js +730 -0
  30. quicksat/editor/templates/shared/open.js +375 -0
  31. quicksat/editor/templates/sizing/checks.js +137 -0
  32. quicksat/editor/templates/sizing/editor.html +63 -0
  33. quicksat/editor/templates/sizing/project.js +376 -0
  34. quicksat/editor/templates/sizing/sections.js +395 -0
  35. quicksat/editor/templates/sizing/views.js +137 -0
  36. quicksat/editor/templates/sizing/write.js +142 -0
  37. quicksat/mass/__init__.py +5 -0
  38. quicksat/mass/budget.py +815 -0
  39. quicksat/mass/equipment.py +93 -0
  40. quicksat/mass/report.py +345 -0
  41. quicksat/orbit/__init__.py +5 -0
  42. quicksat/orbit/attitude.py +430 -0
  43. quicksat/orbit/ccsds.py +77 -0
  44. quicksat/orbit/ecsv_trajectory.py +294 -0
  45. quicksat/orbit/geometry.py +496 -0
  46. quicksat/orbit/oem_trajectory.py +646 -0
  47. quicksat/orbit/omm.py +360 -0
  48. quicksat/orbit/sso.py +284 -0
  49. quicksat/orbit/tle.py +299 -0
  50. quicksat/orbit/trajectory.py +625 -0
  51. quicksat/orbit/trajectory_files.py +88 -0
  52. quicksat/power/__init__.py +17 -0
  53. quicksat/power/__main__.py +121 -0
  54. quicksat/power/budget.py +491 -0
  55. quicksat/power/config.py +501 -0
  56. quicksat/power/consumption.py +460 -0
  57. quicksat/power/generation.py +651 -0
  58. quicksat/power/orbits.py +145 -0
  59. quicksat/power/plots.py +424 -0
  60. quicksat/power/shadowing.py +308 -0
  61. quicksat/power/viewer.py +290 -0
  62. quicksat/sample.py +192 -0
  63. quicksat/scenario/__init__.py +14 -0
  64. quicksat/scenario/__main__.py +53 -0
  65. quicksat/scenario/articulation.py +216 -0
  66. quicksat/scenario/attitude.py +556 -0
  67. quicksat/scenario/attitude_files.py +307 -0
  68. quicksat/scenario/config.py +1647 -0
  69. quicksat/scenario/plots.py +375 -0
  70. quicksat/scenario/rates.py +169 -0
  71. quicksat/scenario/run.py +973 -0
  72. quicksat/scenario/spacecraft.py +400 -0
  73. quicksat/scenario/templates/vendor/build_vendor.sh +53 -0
  74. quicksat/scenario/templates/vendor/js-yaml.LICENSE +21 -0
  75. quicksat/scenario/templates/vendor/js-yaml.min.js +2 -0
  76. quicksat/scenario/templates/vendor/three.LICENSE +23 -0
  77. quicksat/scenario/templates/vendor/three.min.js +4622 -0
  78. quicksat/scenario/templates/vendor/three_entry.js +38 -0
  79. quicksat/scenario/templates/vendor/uPlot.LICENSE +23 -0
  80. quicksat/scenario/templates/vendor/uPlot.iife.min.js +2 -0
  81. quicksat/scenario/templates/vendor/uPlot.min.css +1 -0
  82. quicksat/scenario/templates/viewer.html +2915 -0
  83. quicksat/scenario/templates/viewer_logic.js +202 -0
  84. quicksat/scenario/viewer.py +548 -0
  85. quicksat/utils/__init__.py +5 -0
  86. quicksat/utils/intervals.py +229 -0
  87. quicksat/utils/mission.py +160 -0
  88. quicksat/utils/parser_helpers.py +272 -0
  89. quicksat/utils/plot_helpers.py +178 -0
  90. quicksat-0.1.0.dist-info/METADATA +150 -0
  91. quicksat-0.1.0.dist-info/RECORD +93 -0
  92. quicksat-0.1.0.dist-info/WHEEL +4 -0
  93. quicksat-0.1.0.dist-info/licenses/LICENSE.md +675 -0
quicksat/__init__.py ADDED
@@ -0,0 +1,36 @@
1
+ # quicksat Basic satellite sizing tool
2
+ #
3
+ # Copyright (C) Egemen Imre
4
+ #
5
+ # Licensed under GNU GPL v3.0. See LICENSE.md for more info.
6
+ """
7
+ Basic satellite sizing tool.
8
+
9
+ """
10
+
11
+ __version__ = "0.1.0"
12
+
13
+ from astropy import constants
14
+ from astropy import units as u
15
+ from astropy.units import Quantity
16
+
17
+ __all__ = ["MU_EARTH", "Q_", "R_EARTH", "u"]
18
+
19
+ Q_ = Quantity
20
+ """Shorthand for astropy's `Quantity`, exported the way opticks exports it.
21
+
22
+ The package builds quantities with the constructor, `Q_(123, "m")`, and parses
23
+ text with `Q_("123 m")`. The notebooks write `123 * u.m` instead.
24
+ """
25
+
26
+ # astropy.constants creates its constants at import, so pyright cannot see them
27
+ R_EARTH = constants.R_earth # pyright: ignore[reportAttributeAccessIssue]
28
+ """Earth equatorial radius: astropy's default, the IAU 2015 nominal 6378.1 km."""
29
+
30
+ MU_EARTH = constants.GM_earth # pyright: ignore[reportAttributeAccessIssue]
31
+ """Earth gravitational parameter: astropy's default, the IAU 2015 nominal GM.
32
+
33
+ A GM rather than G times astropy's `M_earth`. GM is the measured quantity, known
34
+ to about nine significant figures, and G is known to about five. astropy itself
35
+ derives `M_earth` from the two.
36
+ """
quicksat/__main__.py ADDED
@@ -0,0 +1,77 @@
1
+ # quicksat Basic satellite sizing tool
2
+ #
3
+ # Copyright (C) Egemen Imre
4
+ #
5
+ # Licensed under GNU GPL v3.0. See LICENSE.md for more info.
6
+ """
7
+ Copy quicksat's sample into a folder, from the command line:
8
+
9
+ python -m quicksat init my_satellite
10
+
11
+ The sample comes from GitHub, for the installed version, with its data, its
12
+ notebooks, and the viewers and editor pages written from them. `--from` takes a
13
+ local copy of the repository instead, as a folder or as its zip. The folder must
14
+ be empty, so nothing is overwritten. See `quicksat.sample`.
15
+
16
+ """
17
+
18
+ import argparse
19
+ from pathlib import Path
20
+
21
+ from quicksat.sample import copy_sample
22
+
23
+
24
+ def main(argv: list[str] | None = None) -> None:
25
+ """
26
+ Copy the sample, and print what to do next.
27
+
28
+ Parameters
29
+ ----------
30
+ argv : list of str, optional
31
+ The arguments, the command line's by default
32
+ """
33
+ parser = argparse.ArgumentParser(
34
+ prog="python -m quicksat",
35
+ description="Copy quicksat's sample into a folder.",
36
+ )
37
+ commands = parser.add_subparsers(dest="command", required=True)
38
+ init = commands.add_parser(
39
+ "init",
40
+ help="copy the sample into a folder",
41
+ description="Copy quicksat's sample, from GitHub, into an empty folder.",
42
+ )
43
+ init.add_argument("folder", help="the folder to copy into, made if missing")
44
+ init.add_argument(
45
+ "--from",
46
+ dest="source",
47
+ metavar="PATH",
48
+ help="a local copy of the repository, as a folder or as its zip",
49
+ )
50
+ args = parser.parse_args(argv)
51
+ try:
52
+ files, warnings = copy_sample(args.folder, args.source)
53
+ except (OSError, ValueError) as error:
54
+ parser.exit(1, f"error: {error}\n")
55
+ for warning in warnings:
56
+ print(f"warning: {warning}")
57
+ print(f"Copied {len(files)} files into {args.folder}.")
58
+ print(_next_steps(Path(args.folder)))
59
+
60
+
61
+ def _next_steps(folder: Path) -> str:
62
+ """What to do with the copied sample, with its own paths."""
63
+ power = folder / "power"
64
+ sizing = folder / "sizing"
65
+ return f"""
66
+ Next:
67
+ Open the power sample in the Scenario Editor, served from this computer:
68
+ python -m quicksat.editor serve {power / "data"} {power / "output"}
69
+ Or double-click a page written already, such as
70
+ {power / "output" / "power_viewer.html"}
71
+ {sizing / "editor" / "editor.html"}
72
+ The notebooks in {sizing}, {folder / "scenario"} and {power} are the worked
73
+ examples, for Jupyter."""
74
+
75
+
76
+ if __name__ == "__main__":
77
+ main()
@@ -0,0 +1,9 @@
1
+ # quicksat Basic satellite sizing tool
2
+ #
3
+ # Copyright (C) Egemen Imre
4
+ #
5
+ # Licensed under GNU GPL v3.0. See LICENSE.md for more info.
6
+ """
7
+ Attitude agility: how long a rest-to-rest slew takes, and whether it fits.
8
+
9
+ """