Skip to content

sun_position: no sunrise/sunset or solar-noon helper for chronolocation workflows #8

Description

@cognis-digital

Summary

geolens.core.sun_position(lat, lon, when) gives the instantaneous azimuth/elevation/declination, and estimate_latitude_from_shadow assumes the observation is at (or near) local solar noon. But there is no way to find solar noon (or sunrise/sunset) for a location and date — so the analyst has to guess the noon instant, which is the single biggest error source in the shadow-stick method.

Motivation

Two very common OSINT/verification questions have no direct API today:

  1. "When was local solar noon here on this date?" — needed to time-align a shadow-stick measurement (the method degrades quickly away from true noon).
  2. "Was the sun even up when the photo claims it was taken?" — currently you have to sample sun_position across the day and look for the elevation sign change (see demos/08_sun_track_day.py, which does exactly this by hand).

Proposed addition (additive, std-lib only)

def solar_noon(lat, lon, date) -> datetime          # UTC instant of max elevation
def sunrise_sunset(lat, lon, date) -> dict           # {"sunrise": dt|None, "sunset": dt|None, "polar_day"/"polar_night": bool}

Both are derivable from the existing NOAA eq_time / hour-angle math already in sun_position — solar noon is 12:00 - eq_time/60 - lon/15 (UTC); sunrise/sunset from the standard hour-angle at the -0.833 deg horizon, with explicit None for polar day/night. No new dependency.

This would let estimate_latitude_from_shadow optionally snap to computed solar noon instead of trusting assume_local_noon, and give the verification demos a first-class daylight check.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions