Pet Project: Sunsetter

At home I have a nice view of the Fujisan to the south-west. I often take pictures of it in winter when the skies are so clear.

Many times I’ve told myself it would be nice to take a picture with the sun setting right behind the mountain. I’ve searched the internet for an app that would tell me when this happens but all I could find were apps that tell you where the sun sets on a particular day, not the other way around. So I decided to build it…

Sunsetter is a simple python web app running on Heroku. It’s based on the brilliant pysolar library for the hardcore astronomical calculations and binds it all to Google Maps with a dash of Ajax and JavaScript.

The app still needs polish but the data it gives out should be pretty accurate and reliable at normal altitudes (standing on top of a very tall mountain overlooking a wide plain will change the distance of the horizon and screw with the calculations a bit).

If this app was useful to you or you have suggestions, I’d love to hear from you in the comments.

Update (2012-06-03): I’ve open sourced the code on Github.


Comments

6 responses to “Pet Project: Sunsetter”

  1. it looks like a very cool project, unfortunately i am only getting an error message, what ever angle i try

  2. Note: the app was returning an error last night. I believe I have fixed the issue (unexpected error on memcached failure) and it is now working again.

  3. Roman Avatar

    Hi, Thx for posting the app on github. I am having problems with runnung your app locally.

    After making sure that I have all required tools installed I am starting the the app with foreman start -f Procfile.dev

    I am getting the following error

    17:40:37 coffee.1 | started with pid 52488
    17:40:37 memcache.1 | started with pid 52487
    17:40:37 web.1 | started with pid 52486
    17:40:37 web.1 | /usr/local/foreman/lib/foreman/process.rb:65: warning: Insecure world writable dir /Users/roman/DT-PROJECTS/CAAS/HEROKU/w00kie-sunsetter-dc71638/venv in PATH, mode 040777
    17:40:38 web.1 | Traceback (most recent call last):
    17:40:38 web.1 | File “app.py”, line 3, in
    17:40:38 web.1 | import pylibmc
    17:40:38 web.1 | File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pylibmc/__init__.py”, line 70, in
    17:40:38 web.1 | import _pylibmc
    17:40:38 web.1 | ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/_pylibmc.so, 2): Symbol not found: _sasl_done
    17:40:38 web.1 | Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/_pylibmc.so
    17:40:38 web.1 | Expected in: dynamic lookup
    17:40:38 web.1 |

    By the way I am using a Mac. Any ideas?

    Thx
    Roman

  4. Hello Roman,
    I think you’re missing a virtual environment and the pre-requisites installation. I advise you to read this document first: https://devcenter.heroku.com/articles/python

    Basically what you should do is first install the venv in the folder and activate it:

    virtualenv venv --distribute
    source venv/bin/activate

    It should change your prompt confirming your are in the virtual environment and any library you install is done so locally instead of system-wide.
    Then you can install the requirements with this command:

    pip install -r requirements.txt

Leave a Reply

Your email address will not be published. Required fields are marked *