ShadowFinder is a tool used for geolocation by estimating points on the Earth's surface where a shadow of a specific length (or sun angle) could occur at a given date and time.
Important Requirement: Shadow length must be measured at right angles to the object. If the image has perspective distortion, you must correct it before using these measurements.
To use the tool, you can provide either:
- Object and shadow measurements: An
object_height and a shadow_length (measured in arbitrary units, as long as they are consistent). - Sun elevation angle: The
sun_altitude_angle directly in degrees.
You must also provide the date and time. The time_type can be set to either utc or local.
from shadowfinder import ShadowFinder
import datetime
# Setup date and time
date_time = datetime.datetime(2024, 2, 29, 12, 0, 0)
finder = ShadowFinder()
# Configure the scenario
finder.set_details(
date_time=date_time,
object_height=10,
shadow_length=8,
time_format="utc",
sun_altitude_angle=None
)
# Execute search and visualize
finder.find_shadows()
fig = finder.plot_shadows()