Skip to content

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
jobe committed Nov 26, 2019
1 parent 82e5e2d commit 1d0c872
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
# suntimes
A [raspend](https://github.com/jobe3774/raspend) based application serving the times for sunrise, sun's culmination and sunset.

Start the server:
```
$ python3 suntimes.py --port 8080
```
Then you can request the sun times for a given location at a given date:

```
http://localhost:8080/cmd?name=SunTimes.calc&dateStr=2019-11-26&longitude=13.413215&latitude=52.521918&asISO=True
```
The above request delivers the sun times for Berlin on Nov. 26th 2019. All times returned are in UTC.

``` json
{
"SunTimes": {
"Sunrise": "2019-11-26T06:46:00+00:00",
"Culmination": "2019-11-26T10:54:00+00:00",
"Sunset": "2019-11-26T15:01:00+00:00"
}
}
```

The calculation is based on SunMoon.py by Michael Dalder, which in turn is a port of Arnold Barmettler's JavaScript. You can find both [here](https://lexikon.astronomie.info/java/sunmoon/).
3 changes: 2 additions & 1 deletion suntimes.pyproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
<Name>suntimes</Name>
<RootNamespace>suntimes</RootNamespace>
<LaunchProvider>Standard Python launcher</LaunchProvider>
<CommandLineArguments>--port=8084</CommandLineArguments>
<CommandLineArguments>--port=8080</CommandLineArguments>
<EnableNativeCodeDebugging>False</EnableNativeCodeDebugging>
<SuppressEnvironmentCreationPrompt>True</SuppressEnvironmentCreationPrompt>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>
Expand Down

0 comments on commit 1d0c872

Please sign in to comment.