Close

Weather prediction is hard

A project log for ATLAS

Built the tricorder I actually wanted in the field: one that warns, not just measures.

apollo-timbersApollo Timbers 07/11/2025 at 14:270 Comments

I realized the weather prediction model I was using wasn’t cutting it, it just looked at raw sensor trends and didn’t have any real context. Now, I’ve worked out a better way that’s still totally doable on a handheld device.

Here’s the new plan:
Instead of guessing based only on sensors, I’m building a folder of JSON or CSV files covering 3–5 years of weather data for all major US cities (plus a few international spots), including sunrise and sunset times. The handheld uses GPS to figure out where you are and picks the nearest city’s file. Then it compares live sensor readings to real historical patterns for your region and season, so if conditions match “classic cold front” or “afternoon thunderstorm,” it can actually say so, not just guess from the numbers.

Having sunrise and sunset in the mix is a game-changer too. The device will know exactly when it should be light or dark at your location, so it can spot clouds or weird events more reliably. If it’s supposed to be bright and it’s not, you know there’s real cloud cover or something interesting going on.

Another big plus:
It now gives you sunrise and sunset times accurate to 1-2 minutes, anywhere on Earth, based on GPS math. For expeditions and camping, that means you always know how much daylight you have left, no surprises when you need to set up camp or plan your day.

Why this is better:

Sample Code Snippets

Find the closest city:

def find_nearest_city(lat, lon, city_db):
    return min(city_db, key=lambda c: (lat-c['lat'])**2 + (lon-c['lon'])**2)


# Example usage:
city_db = [
    {'name': 'St. Louis', 'lat': 38.6270, 'lon': -90.1994},
    {'name': 'Chicago', 'lat': 41.8781, 'lon': -87.6298},
    # ... more cities ...
]
current_lat, current_lon = 38.62, -90.21
nearest = find_nearest_city(current_lat, current_lon, city_db)

 Get sunrise/sunset for your spot:

solar = SunriseSunsetCalculator()
solar.set_location(current_lat, current_lon, timezone_offset)
solar_times = solar.get_current_solar_times()
print(f"Sunrise: {solar_times['sunrise']}, Sunset: {solar_times['sunset']}")

So with just a handheld, you get real pattern-based storm warnings, context-aware daylight info, and pro-grade predictions—completely offline.

It’s basically a field meteorologist in your pocket.

Discussions