hi there, does anyone know how to calculate the amount of daylight on every day of the year in R? I mean the time between sunrise and sunset. thanks -- View this message in context: http://r.789695.n4.nabble.com/daylight-tp4647213.html Sent from the R help mailing list archive at Nabble.com.
I would start with the data. My source for this is the US Navy Sunrise/Sunset tables: http://aa.usno.navy.mil/data/docs/RS_OneYear.php The page is produces is pure text; I've previously extracted the values with a simple Perl script, but would do it today using R (in general, most of the parsing I used to perform in Perl can readily be performed in R). Once I had the data available as a data frame, I'd convert the columns to POSIXct format and then use difftime(). Cheers, Mark bambus wrote:> hi there, > does anyone know how to calculate the amount of daylight on every day of the > year in R? I mean the time between sunrise and sunset. > > thanks > > > > -- > View this message in context: http://r.789695.n4.nabble.com/daylight-tp4647213.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Mark Dalphin Ph.D. Director of Bioinformatics mark.dalphin at pacificedge.co.nz <mailto:mark.dalphin at pacificedge.co.nz> *Ph:* +64-3-479-5805 *Cell:* +64-21-156-7625 *Skype:* mark.dalphin.pel <http://www.facebook.com/pages/Pacific-Edge/111356775582456> <http://twitter.com/#%21/pacificEdgeLtd> <http://www.youtube.com/PacificEdgeLtd> 87 St David St, PO Box 56, Dunedin, New Zealand 9016www.pacificedge.co.nz
On Oct 23, 2012, at 12:45 PM, bambus wrote:> hi there, > does anyone know how to calculate the amount of daylight on every day of the > year in R? I mean the time between sunrise and sunset.http://www.esrl.noaa.gov/gmd/grad/solcalc/sunrise.html This should explain why you are posing an underdetermined problem. --> > View this message in context: http://r.789695.n4.nabble.com/daylight-tp4647213.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.David Winsemius, MD Alameda, CA, USA
library(maptools) ?sunriset --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. bambus <sonja_lae at hotmail.com> wrote:>hi there, >does anyone know how to calculate the amount of daylight on every day >of the >year in R? I mean the time between sunrise and sunset. > >thanks > > > >-- >View this message in context: >http://r.789695.n4.nabble.com/daylight-tp4647213.html >Sent from the R help mailing list archive at Nabble.com. > >______________________________________________ >R-help at r-project.org mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide >http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code.
Do you care about local topography/terrain? I think most of the calculators/tables that are commonly used assume that you are at a fairly flat place on the earth's surface, but that is not always true. The area where my wife grew up had its longest day closer to the equinox than the summer solstice and if I wanted to calculate the number of hours that direct sunlight would hit solar panels (which I don't have yet) on my house or the solar oven (which I do have) in my back yard, then assuming sunset and sunrise occurred at 90 degrees from vertical would definitely overestimate the time. On Tue, Oct 23, 2012 at 1:45 PM, bambus <sonja_lae at hotmail.com> wrote:> hi there, > does anyone know how to calculate the amount of daylight on every day of the > year in R? I mean the time between sunrise and sunset. > > thanks > > > > -- > View this message in context: http://r.789695.n4.nabble.com/daylight-tp4647213.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Gregory (Greg) L. Snow Ph.D. 538280 at gmail.com