| Date: | Mon, 7 May 2001 14:54:13 -0400 |
| Reply-To: | "Bosch, Jules [PRI]" <JBosch1@PRIUS.JNJ.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | "Bosch, Jules [PRI]" <JBosch1@PRIUS.JNJ.COM> |
| Subject: | Re: Hours of daylight by day |
|
| Content-Type: | multipart/alternative;
|
|---|
Sunrise, Sunset,
Sunrise, Sunset,
Swiftly flow the day.
Couldn't resist.
Jules
-----Original Message-----
From: Patrice Bourdages [SMTP:PBourdages@IAG.QC.CA]
Sent: Monday, May 07, 2001 2:40 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: Hours of daylight by day
You might want to try this... and adapt for your own need. It's
working very well for my need.
data;
retain data SunRise SunSet HoursOfDaylight;
input latitude longitud timezone;
array sun{0:1} SunSet SunRise;
pi = arcos(-1);
radian = pi/180;
phi = latitude * radian;
lambda = longitud / 15;
do date = intnx("month",today(),0) to intnx("month",today(),1)-1;
n = date-intnx("year",date,0)+1;
dst = mdy(4,7,year(date))-weekday(mdy(4,7,year(date))) LT date LE
mdy(10,31,year(date))-weekday(mdy(10,31,year(date)));
do s = 0 to 1;
t = n+(18-12*s-lambda)/24;
m = (.9856*t-3.289)*radian;
l = m+(1.916*sin(m)+.02*sin(2*m)+282.634)*radian;
delta =.39782*sin(l);
sun{s} = 3600 * (mod(24*((1-2*s)
* arcos((-.01454-sin(delta)*sin(phi))
/(cos(delta)*cos(phi)))
/(2*pi)+s)+12*(atan(.91746*tan(l))/pi
+(mod(floor(l*2/pi)+4,4)
in(1,2)))-.06571*t-6.622
- lambda + timezone + dst + 48,24));
end;
HoursOfDaylight = intck("second",SunRise,SunSet);
output;
end;
format date yymmdd10. SunRise SunSet time5. format HoursOfDaylight
time5.;
keep date SunRise SunSet HoursOfDaylight;
** Coordonnates for Quebec city;
cards;
46.8521 -71.3015 -5
;
run;
title 'Québec';
proc calendar legend;
start date;
var SunRise SunSet HoursOfDaylight;
run;
Excuse the bad format. You just have to replace the coordinates in
the cards section for you location's one and you should be all set to go..
Sincerely yours,
\\\|///
\\ - - //
( o o )
+-----oOOo-(_)-oOOo------------+--------------------------------+
| Patrice Bourdages | |
| SI Analyst | Tel : (418) 650-4600 x3216 |
| Industrielle Alliance, | Fax : (418) 650-4825 |
| Assurances auto & habitation | E-mail: pbourdages@iag.qc.ca |
+--------------Oooo------------+--------------------------------+
oooO ( )
( ) ) /
\ ( (_/
\_)
-----Message d'origine-----
De : Charlie Brown [mailto:project_monkey@HOTMAIL.COM]
Envoyé : 7 mai, 2001 13:28
À : SAS-L@LISTSERV.UGA.EDU
Objet : OT: Hours of daylight by day
Sorry for the OT post:
Where can I find the number of hours of daylight by day for
geographical locations? Any Ideas?
Thanks: Charlie
_____
Get your FREE download of MSN Explorer at
http://explorer.msn.com <http://explorer.msn.com>
[text/html]
|