Sun/moon rise/set time, direction and cloud free path calculator

When and where should one be able to see (and photograph) the sun set, the sun rise, the moon set end the moon rise without clouds being between the observer and object on the sky?

In order to build a successful “Sun/moon rise/set time, direction and cloud free path calculator” I suggest the following steps:

Step 1.

Add Sun/moon rise/set times to the graphs.

Step 2.

A) Add the (sun day/) night shadow as animation to the map.

B) Same for the moon.

Step 3.

Add lines showing the direction to the sun and moon on the map.

Step 4.

A) Get map data for elivation (hight above sea level) .

B) Projekt the elivation onto the "direktion-to-the-sun/moon-lines.

C) Use the above steps and the curvature of the earth to calculate the distance to the point that the sun/moon will set/rise behind.

D) Use the above and an approximate thickness of troposphere (or better yet, if available, weather data for hights for clouds) to calculate the amount of clouds that the light from the sun/moon have to travel through to get to the observer.

I’ve seen other apps do Step 2 and 3.
(For example, step 3 is done by
and .)

What would be really cool is to see step 1 combined with a weather graph!

And then to see step 2, 3 and 4 be combined with a weather map.

Best of wishes!


Sunrise/set and Moonrise/set/phase has been on the to-do list for a long time. It was very close to the top once but other features took priority. I still want to do this since it’s quite a cool feature.

Steps 2 and 3 are what I plan to to do. Instead of step 1, I planned to add the sun/moon paths to the map with times on the left/right of the map showing the rise/set times.

Step 4, at first glance, looks quite complex and a bit of work. It’s also not clear it’s going to give you exactly what you expect. What application are you wanting this for? There might be a better approach.

Cheers, Duane.


OMG! I struggle with that thing of the sun setting northward then southward. I just want to know where the shade is going to be! To see the latitude of the sun’s path as I check Flowx, that would help. It’s beyond me why typical sunrise/sunset graphs exist; just tell me the time of solar noon along with sunrise/sunset. So… maybe, a big sun icon for solar noon on the map would actually make the information invaluable. That’s some tasty spacial info. Ooh. Hungry!


Awesome Duane!

I look forward to seeing any progress on any of the steps.

Regarding the Step 4:
The application would be to make it more possible to predict where would be a good spot for seeing for example sunsets, meaning how far away one must travel from the locations of forecasted clouds for them to be behind the horizon.

For example by having the line pointing at the sun having this length on the map.

A more simple approach would be to calculate a global distance to where clouds would be under the horizon, asumim horisontal light paths.

So a single fairly simple geometric calculation based on the (mean) curvature of the earth and the normally maximum heights for clouds.

(I could help work on the math on this one, after I’ve gotten some sleep…)

Step 1, would be really helpful not only for taking pictures of the sunset, but also it would really
make it easier and faster to find out when one can have daylights without clouds. Good for planing outdoor activities, walks, exercises or just sun bathing.

Keep up the great work!

1 Like

Again regarding step 4:

“Cumulonimbus cloud… … the maximum possible distance to the top of the cloud is 450 km.”

“Clouds do get higher up. Noctilucent clouds can be found higher up at 85 km. This means they could be seen from up to 1,000 km away”

“typical, run-of-the-mill, non-storm Cumulus cloud? Those can normally be found below 2,000 meters and are less than 160 km away”

So if the lines pointing in the direction of the sun and moon are always made to be 1,000 km, with a mark at 450 km and on 160 km on the map, this would give a good first approximation to answer if the forecasted clouds would block the sun/moon or not.


1 Like

The sun/moon won’t move north to south, it’ll appear in the east (right of the screen) and set in the west (left of the screen). It can show a time for the solar noon. You can also show shadow lines like in photography apps.

1 Like

@Ohan, can you code in Python? or anything else?

Maths is one part of the solution, the other is programming, the last part is getting it into the app.

I mentioned in another post that I’m reluctant to make predictions as part of Flowx. It’s a difficult aspect of meteorology, one I’m careful not to get into. Instead we need a way to get third party predictions into Flowx. In other words, if you can do the Math and we can create a script to generate predictions on the server, then Flowx can pull them in as “Ohan’s Awesome Sunset Predictions” data source :slight_smile:

This is quite a cool approach since it keeps Flowx separate from the prediction source, i.e., just the messenger.


I have mostly written scripts in bash (and in Matlab/octave) on Linux systems and been piping in results from other Linux/Unix programs.
I’m fairly fluent in regex and sed.

Python is perhaps the next language I should learn, but I have not gotten properly started with it, so I’ve kept my personal programming projects in bash.

If your server side is running Linux/Unix then I could be fairly useful… :grin::+1:

1 Like

Shux, Bourne again shell, wow!! And Octave. Those bring back memories. Did my Masters using Octave. I used to be the Science Grimoire maintainer for Sourcemage, a Linux distribution based on Bash.

All my systems are Linux.

Python is pretty much like Octave, just different syntax.

1 Like

Obviously, the Flowx weather map shows conditions hour by hour.
Overlays on this map allow a selection of graphical info presented.
Sunrise/sunset are hourly values (repeat for the Moon, maybe).
Imagine if; the weather map transitions to a dimmed state, for evening, and undimmed for daytime. Expand on the idea, to possibly reflect the actual location of the sun (and/or moon) by having less dimmed areas/corners in/at the location of the (moon?..) So that means “more undimmed” areas/corners in/at the location of the sun. All graphical data (KISS) with maybe, addable text vales for sunrise/sunset (if the center text area becomes configurable).

Why I like it: I simply get lost scrolling time in Flowx. Thumbs aren’t precise, and the indicators for time are the text time value, and the bar under my thumb; these are all that indicate if I’m scrolling time in the same day or not… leaving me, processing both text data and visible data, at the same time. A dimming weather map can simplify this, to a simple mental count: 1 day, 2 days, 3 days, … And “to” mention… It makes night weather different from daytime weather, at a glance. We all likely care about one more than the other, so why not “soft” filter it via an map overlay!?
This could be epic, even in it’s simplest implementation.

1 Like

Interesting. There is so much you can do. I do plan to have a dimming overlay for dark areas, but I hadn’t thought about the moon. You could add lightness based on the moon phase.

The background colour of the days is supposed to indicate the day. I was thinking of adding another row of 24 hours to highlight the hour of the day.

BTW, I assume you know about the swiping up/down for slower change in days. One map width up/down = 1 day change.

Cheers, Duane

1 Like

[quote=“duane, post:11, topic:106”]
I do plan to have a dimming overlay for dark areas, but I hadn’t thought about the moon. You could add lightness based on the moon phase.

I’m not clear on “dimming overlay for dark areas” and don’t likely need to be (As you are obviously Greek… Or are speaking it). But I thought I would revert to modern day cave drawings to conclude my thoughts, which go with these points (and grunts).

1 Like

And for sun movement.

1 Like

Wow. “Lightness based on the moon phase” Wow. Come on!! I mean, WOW!

1 Like

I’ve started a little to look into the possibility of using the power of (or
I’ve contacted regarding output as json, since I did not find it on the page as if now.

In another project of mine I’ve used since it does output a json, than can easily be parsed for further use. However does not output the sun’s altitude and azimuth, but I have reached out to them asking if they could add it.

We’ll see what happens.

1 Like

I’ve looked at suncalc before. The plan is to port the library to Java or Kotlin since it’s an analytic calculation as opposed to a simulation. This mean we don’t have to download data, it’ll be calculated on the phone. It’ll also include altitude and azimuth.

I was thinking about what you are wanting and there is UV data and other radiation data which is effectively how much sunshine reaches the ground. This is what they use to calculate evaporation rates.

I am reluctant to add new data and features without knowing how much people will want it and use it. When I started Flowx (WeatherBomb), I added most features users wanted and ended up in a right mess. I had more code to maintain and more data to store.

I used to have UV data but hardly anyone used it. So I removed it and no one complained.

Cheers, Duane.


I use this app (UV Mate), which is a pretty simple yet impressive app, as they adjust the ongoing radiation according to cloud cover (though the forecast doesn’t take that into account). It’d be great if Flowx could show that curve too (in the monkey’s wedding chart, along with the lunar/solar tide cycle).


Hi @andrelevy

I’m trying to find:

Did you mean, and do you have the paid version of it, or could you send a link to that app?

1 Like

This one, @Ohan.


Thanks for the link @andrelevy!

Unfortunately the app is not available in my country, and thats why I couldn’t find it via search.

It seams to be olny for Australia.

Thanks anyway!