FlyerTalk Forums - View Single Post - Website showing when it will be light during a flight
Old Jul 21, 2013 | 8:23 pm
  #14  
sunflight
 
Join Date: Mar 2013
Posts: 6
Originally Posted by Sigwx
@sunflight

Great app! Does it compensate for altitude? A Middle Eastern version improvement could include Imsak and Iftar timings for Ramadan? Very simple and handy site, I like it.

For those bored of AVOD etc who wish to exercise their grey matter, a CX Captain came up with the following (que requests for graph paper) http://www.andytracy.net/sunrise.htm
Hi Sigwx, thanks for the feedback.

That's a good question in regards to the sunset. According to my research, sunset/sunrise is when the Sun is less than 12 degrees in the sky. The library Sunflight uses (PySolar) to calculate the sun altitude based on sea level, so I use 6 degrees to factor in the altitude (a guess) of the flight. Night time is determined when the Sun is less than 0 degrees.

I'll check into whether PySolar can give me a sun altitude calculation based on a height above sea level. However there will still be some guesswork in this as my flight routing data (from OAG) does not tell me the cruising altitude of the flight. I could fix this at 36,000ft and perhaps 40,000ft for longer flights.

If you're interested, here's some examples in PySolar: https://github.com/pingswept/pysolar/wiki/examples

I'd really like to get the calculation even more precise, so if you have any ideas let me know.

I've got no idea about Ramadan timings but if someone wants to request the feature and can tell me how to implement it, then I'll add it as a feature people can toggle in the "Advanced" tab.

Cheers,
Ian
sunflight is offline