TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/skyrobot804/node_v1/llms.txt
Use this file to discover all available pages before exploring further.
geolocation module auto-detects the observatory’s latitude and longitude from the machine’s public IP address (via ip-api.com), populating observatory.latitude/longitude and safety.observer.latitude/longitude in the config if not already set. This lets a node become schedulable immediately after installation without requiring the operator to look up and enter precise coordinates — especially useful for portable setups or first-time deployments.
detect_location()
GET request to http://ip-api.com/json/ using the requests library. The response JSON is expected to contain status: "success" along with lat and lon float fields.
Returns None in any of the following cases:
- The
requestslibrary is not installed (logged atWARNINGlevel). - The HTTP response status code is not
200(logged atDEBUGlevel). - The response JSON contains
statusother than"success"(logged atDEBUGlevel with themessagefield if present). - Any other network or parsing exception is raised (logged at
DEBUGlevel).
INFO level with the city, country, and rounded coordinates for easy confirmation in node logs.
Service details: ip-api.com free tier — no API key required, rate-limited to 45 requests per minute. The node calls this function at most once per startup (see enrich_config_with_location() below), so rate limiting is not a concern in normal operation.
enrich_config_with_location()
config is None (treated as an empty dict).
Priority chain:
- Explicit config values — if both
config["observatory"]["latitude"]andconfig["observatory"]["longitude"]are present and non-zero, detection is skipped entirely and the config is returned unchanged. - Auto-detect from IP — if either coordinate is absent or zero,
detect_location()is called. On success, bothobservatory.latitude,observatory.longitude,safety.observer.latitude, andsafety.observer.longitudeare written into the config. - Leave unchanged — if detection returns
None, the config is returned as-is (coordinates remain at0.0or whatever was previously set).
observatory and safety.observer sub-dicts are created if they do not already exist.
geolocation.py
ip-api.com returns city-level precision (approximately ±5–20 km depending on ISP and region). This is sufficient for airmass calculations, altitude-constraint enforcement, and dawn/dusk parking azimuth estimation, but is not suitable for high-precision astrometric plate-solving or parallax work. If sub-arcsecond astrometry is required, set
observatory.latitude and observatory.longitude explicitly in config.yaml using GPS-quality coordinates.