From 47e0276f0cb8f9762668ea19073a47dd77743e32 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Fri, 26 Sep 2025 19:23:12 -0700 Subject: [PATCH] howtall returns height of something you give a shadow by using sun angle --- README.md | 1 + modules/space.py | 6 +++--- modules/system.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index afcc81a..d2050dd 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,7 @@ git clone https://github.com/spudgunman/meshing-around | `satpass` | returns the pass info from API for defined NORAD ID in config or Example: `satpass 25544,33591`| | | `wiki:` | Searches Wikipedia and returns the first few sentences of the first result if a match. Example: `wiki: lora radio` | | `howfar` | returns the distance you have traveled since your last HowFar. `howfar reset` to start over | ✅ | +| `howtall` | returns height of something you give a shadow by using sun angle | ✅ | ### CheckList | Command | Description | | diff --git a/modules/space.py b/modules/space.py index 3bc6f5c..cd94d88 100644 --- a/modules/space.py +++ b/modules/space.py @@ -237,16 +237,16 @@ def measureHeight(lat=0, lon=0, shadow=0): sun.compute(obs) sun_altitude = sun.alt * 180 / ephem.pi if sun_altitude <= 0: - return NO_ALERTS + return "☀️Sun is below horizon, I dont belive your shadow measurement" try: if use_metric: height = float(shadow) * (1 / math.tan(sun.alt)) - return f"Object Height: {height:.2f} m (Shadow: {shadow} m, Sun Alt: {sun_altitude:.2f}°)" + return f"📏Object Height: {height:.2f} m (Shadow: {shadow} m, 📐Sun Alt: {sun_altitude:.2f}°)" else: # Assume shadow is in feet if imperial, otherwise convert from meters to feet shadow_ft = float(shadow) height_ft = shadow_ft * (1 / math.tan(sun.alt)) - return f"Object Height: {height_ft:.2f} ft (Shadow: {shadow_ft} ft, Sun Alt: {sun_altitude:.2f}°)" + return f"📏Object Height: {height_ft:.2f} ft (Shadow: {shadow_ft} ft, 📐Sun Alt: {sun_altitude:.2f}°)" except Exception as e: logger.error(f"Space: Error calculating height: {e}") return NO_ALERTS \ No newline at end of file diff --git a/modules/system.py b/modules/system.py index 68b4ab0..5aeff01 100644 --- a/modules/system.py +++ b/modules/system.py @@ -59,7 +59,7 @@ if whoami_enabled: if solar_conditions_enabled: from modules.space import * # from the spudgunman/meshing-around repo trap_list = trap_list + trap_list_solarconditions # items hfcond, solar, sun, moon - help_message = help_message + ", sun, hfcond, solar, moon" + help_message = help_message + ", sun, hfcond, solar, moon, howtall" if n2yoAPIKey != "": help_message = help_message + ", satpass" else: