Login
You're viewing the assemblag.es public feed.

Replies

  • Sep 28, 2026, 9:52 PM

    Background: I was in the backcountry, far away from any cell tower. I know approximately when sunrise is these days, but it would have been nice to know it exactly, so I can set my alarm accordingly and start paddling with the first sun light. (Please don't tell me you're using some great app for that. I have written many myself. That's not the point.)

    💬 0🔄 0⭐ 5
  • Sep 28, 2026, 11:30 PM

    @hannorein

    Don't know anything about coding or iphones, but gut feeling is that that's a difficult question.

    Doesn't it depend on knowing not just the gps-coördinates, but data to correlate that with sun position, the time of the year, and if daylight savings are in effect. Does Iphone store all that locally?

    💬 3🔄 0⭐ 0
  • 💬 2🔄 0⭐ 0
  • Sep 29, 2026, 12:17 AM

    @hannorein @iju the problem is probably the map to determine which time zone entry to use based on gps location. It should offer to give you local solar time, that’s just a calculation.

    💬 0🔄 0⭐ 1
  • 💬 1🔄 0⭐ 0
  • 💬 1🔄 0⭐ 0
  • 💬 0🔄 0⭐ 0
  • 💬 0🔄 0⭐ 0
  • Sep 29, 2026, 12:14 AM

    @iju @hannorein I haven’t tried in a while but an iPhone used to be able to receive gps signal (eventually) with no other network. And that should have everything needed to give you your correct local time. That’s probably way too complicated for Siri to figure out 😂

    💬 1🔄 0⭐ 0
  • Sep 29, 2026, 12:21 AM

    @acsawdey @hannorein

    What I was aiming at was that knowing what time (inc. month and year) and place (longitude/lattitude) doesn't alone inform when sun rises. What they are is just the prerequirements to look it up based on historical (I assume) data.

    You can probably do some simplification on the data needed by assuming that sun always rises at the same time (remembering date)on the same longitude, but ofc If you want to be precise you must be informed on surrounding mountains as well.

    💬 1🔄 0⭐ 0
  • Sep 29, 2026, 12:24 AM

    @iju @hannorein Time and position would be enough to know when the sun rises if the earth were a sphere with no topography though. It's just a geometry problem. If it doesn't bother you that you don't see the sun over that mountain until 15 minutes after "sunrise" then the answer is probably good enough. I'm not sure the iPhone takes topography into account unless you use an app like TPE.

    💬 1🔄 0⭐ 0
  • Sep 29, 2026, 12:28 AM

    @acsawdey @hannorein

    I did say it was enough to look it up, and probably you might preload the calculations to do so as well, but doesn't seem simple.

    And it's not 15 minutes later. When I lived in Jyväskylä (which isn't //that// north, nor //that// hilly) you couldn't see sunrise around December at all. Even If you should have, in theory.

    💬 0🔄 0⭐ 0
  • Sep 29, 2026, 1:36 AM

    @iju @hannorein If you make a few assumptions (horizon is flat, you're at mean sea level, no leap seconds since the last clock synchronization), the whole calculation for the UTC time of sunrise can be made from just the GPS coordinate and the date (it's some trigonometry, plus some Gregorian Calendar math to figure out the date relative to the solstice). Those assumptions only really make a few seconds of difference, so it would probably be good enough for most purposes.
    Converting the UTC time to a local time zone accurately is more complicated, requiring a database of time zone locations and daylight savings rules. The daylight savings rules are usually built in to the phone's operating system, and in most cases you could just use the time zone the phone is set to (usually the time zone where you were last connected to a cell tower).

    I think it boils down to that the math is a bit complicated, and someone had already done it on a website somewhere, so they just used that instead of calculating it themselves.

    💬 0🔄 0⭐ 1
  • Sep 29, 2026, 2:22 AM

    @ZahmbieND @iju I feel mansplained to. Do you understand that you’re replying to an astronomy professor who has written astronomy iPhone applications for almost 20 years?

    💬 0🔄 0⭐ 3
  • Sep 29, 2026, 1:41 PM

    @hannorein Do you understand that I wasn't replying directly to you? If you look at the message I replied to, you'll see my comment was addressed to @iju, who did ask a question.

    I was trying to provide some context on what is involved in the calculation, to a member of the conversation who, from their question, clearly doesn't have the experience of writing astronomy applications for 20 years, from someone who does have at least some experience dealing with GPS and time calculations. I was also trying to back up your point that this calculation can be done locally, without simply asserting it's "five lines of code", but instead explaining a bit of what's in that code and that the "sun position, the time of the year, and if daylight savings are in effect" which they asked about are already included in the time logic of the phone or well-known calculations.
    As a software engineer, I am acutely aware that every line of code comes with a long list of assumptions you're making about the systems making that code operate (including external libraries, operating system, networking, compiler, etc.), so I built into my comment a few notes on the bigger assumptions being made in a "five lines" type of implementation. My final note was simply making the point that sometimes the assumption that internet access is available and that someone with 20+ years of experience in astronomy has a website handling all the important edge cases for you is simpler than what's involved in making all the calculations yourself.

    💬 0🔄 0⭐ 0
  • 💬 0🔄 0⭐ 0