;ELC ;;; compiled by reingold@albert.gnu.ai.mit.edu on Mon Jun 19 11:37:41 1995 ;;; from file /gd/gnu/emacs/19.0/lisp/solar.el ;;; emacs version 19.28.1. ;;; bytecomp version FSF 2.10 ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19"))) (error "`/gd/gnu/emacs/19.0/lisp/solar.el' was compiled for Emacs 19")) (byte-code "! !!!" [fboundp atan require lisp-float-type error "Solar/lunar calculations impossible since floating point is unavailable." cal-dst] 2) (defvar calendar-time-display-form (quote (12-hours ":" minutes am-pm (if time-zone " (") time-zone (if time-zone ")"))) "\ *The pseudo-pattern that governs the way a time of day is formatted. A pseudo-pattern is a list of expressions that can involve the keywords `12-hours', `24-hours', and `minutes', all numbers in string form, and `am-pm' and `time-zone', both alphabetic strings. For example, the form '(24-hours \":\" minutes (if time-zone \" (\") time-zone (if time-zone \")\")) would give military-style times like `21:07 (UTC)'.") (defvar calendar-latitude nil "\ *Latitude of `calendar-location-name' in degrees. The value can be either a decimal fraction (one place of accuracy is sufficient), + north, - south, such as 40.7 for New York City, or the value can be a vector [degrees minutes north/south] such as [40 50 north] for New York City. This variable should be set in site-local.el.") (defvar calendar-longitude nil "\ *Longitude of `calendar-location-name' in degrees. The value can be either a decimal fraction (one place of accuracy is sufficient), + east, - west, such as -73.9 for New York City, or the value can be a vector [degrees minutes east/west] such as [73 55 west] for New York City. This variable should be set in site-local.el.") (defalias 'calendar-latitude #[nil "HHå\\Hƚ\f\f[)" [calendar-latitude 0 1 60.0 lat 2 north] 3 "\ Convert calendar-latitude to a signed decimal fraction, if needed."]) (put (quote calendar-latitude) (quote byte-optimizer) (quote byte-compile-inline-expand)) (defalias 'calendar-longitude #[nil "HHå\\Hƚ\f\f[)" [calendar-longitude 0 1 60.0 long 2 east] 3 "\ Convert calendar-longitude to a signed decimal fraction, if needed."]) (put (quote calendar-longitude) (quote byte-optimizer) (quote byte-compile-inline-expand)) (defvar calendar-location-name (quote (let ((float-output-format "%.1f")) (format "%s%s, %s%s" (if (numberp calendar-latitude) (abs calendar-latitude) (+ (aref calendar-latitude 0) (/ (aref calendar-latitude 1) 60.0))) (if (numberp calendar-latitude) (if (> calendar-latitude 0) "N" "S") (if (equal (aref calendar-latitude 2) (quote north)) "N" "S")) (if (numberp calendar-longitude) (abs calendar-longitude) (+ (aref calendar-longitude 0) (/ (aref calendar-longitude 1) 60.0))) (if (numberp calendar-longitude) (if (> calendar-longitude 0) "E" "W") (if (equal (aref calendar-longitude 2) (quote east)) "E" "W"))))) "\ *Expression evaluating to name of `calendar-longitude', calendar-latitude'. For example, \"New York City\". Default value is just the latitude, longitude pair. This variable should be set in site-local.el.") (defvar solar-n-hemi-seasons (quote ("Vernal Equinox" "Summer Solstice" "Autumnal Equinox" "Winter Solstice")) "\ List of season changes for the northern hemisphere.") (defvar solar-s-hemi-seasons (quote ("Autumnal Equinox" "Winter Solstice" "Vernal Equinox" "Summer Solstice")) "\ List of season changes for the southern hemisphere.") (defalias 'solar-setup #[nil " !\f!?!" [beep calendar-longitude solar-get-number "Enter longitude (decimal fraction; + east, - west): " calendar-latitude "Enter latitude (decimal fraction; + north, - south): " calendar-time-zone "Enter difference from Coordinated Universal Time (in minutes): "] 2 "\ Prompt user for latitude, longitude, and time zone."]) (defalias 'solar-get-number #[(prompt) " \"˜? !)" [read-string prompt "" x string-to-int] 4 "\ Return a number from the minibuffer, prompting with PROMPT. Returns nil if nothing was entered."]) (byte-code "\"#\"#\"" [defalias solar-sin-degrees #[(x) " _!" [sin x .017453292519943295] 3] put byte-optimizer byte-compile-inline-expand solar-cosine-degrees #[(x) " _!" [cos x .017453292519943295] 3] solar-tangent-degrees #[(x) " _!" [tan x .017453292519943295] 3]] 4) (defalias 'solar-xy-to-quadrant #[(x y) "V\nVÇć\nVŇƇ" [x 0 y 1 4 2 3] 2 "\ Determines the quadrant of the point X, Y."]) (defalias 'solar-degrees-to-quadrant #[(angle) "\n\"\"T" [floor mod angle 360 90] 4 "\ Determines the quadrant of ANGLE."]) (defalias 'solar-arctan #[(x quad) " !_\fŚ \\+\fǚ \\+\fȚ* \\+ )" [atan x 57.295779513082323 deg quad 2 180 3 4 360] 2 "\ Arctangent of X in quadrant QUAD."]) (byte-code "\"\"" [defalias solar-arccos #[(x) "\n_Z! \n\n \"\")" [sqrt 1 x y solar-arctan solar-xy-to-quadrant] 5] solar-arcsin #[(y) "\n_Z!\n \n\"\")" [sqrt 1 y x solar-arctan solar-xy-to-quadrant] 5]] 3) (defconst solar-earth-inclination 23.441884000000002 "\ Inclination of earth's equator to its solar orbit in degrees.") (defconst solar-cos-inclination (byte-code " _!)" [solar-earth-inclination x cos .017453292519943295] 3) "\ Cosine of earth's inclination.") (defconst solar-sin-inclination (byte-code " _!)" [solar-earth-inclination x sin .017453292519943295] 3) "\ Sine of earth's inclination.") (defconst solar-earth-orbit-eccentricity .016718 "\ Eccentricity of orbit of the earth around the sun.") (byte-code "\"#\"#" [defalias solar-degrees-to-hours #[(deg) "" [deg 15.0] 2] put byte-optimizer byte-compile-inline-expand solar-hours-to-days #[(hour) "" [hour 24.0] 2]] 4) (defalias 'solar-longitude-of-sun #[(day) "_Z  _!)_ \\ _!)_\\\\\\\")" [day .98559999999999999 3.2890000000000001 mean-anomaly mod x sin .017453292519943295 1.916 .02 282.63400000000001 360] 6 "\ Longitude of the sun at DAY in the year."]) (defalias 'solar-right-ascension #[(longitude) " !_ !\"ƥ)" [solar-arctan solar-cos-inclination solar-tangent-degrees longitude solar-degrees-to-quadrant deg 15.0] 5 "\ Right ascension of the sun, given its LONGITUDE."]) (defalias 'solar-declination #[(longitude) " \n _!)_!" [solar-arcsin solar-sin-inclination longitude x sin .017453292519943295] 5 "\ Declination of the sun, given its LONGITUDE."]) (defalias 'solar-sunrise #[(date) "@A@AA@\n S_\\ V> _\\ɥZ ǦU> ˦U; ̦U> T ,NmHHХ\\HҚil[)ԥ)Z֥)\\!!!ߥ\\!!_!)!!_!)&&&H&H\\(&H隃(([)!!_!)_Z!!_!)&&&H&H\\(&H隃(([)!!_!)_**!X*!Zԥ)..\\_\\Z\"3SrHHХ\\HҚnq[)ԥ)Z4\\*." [date month day year 31 day-of-year 2 4 23 10 0 100 400 6 calendar-longitude 1 60.0 long east deg 15.0 hour 24.0 approx-sunrise solar-longitude-of-sun solar-longitude-of-sun-at-sunrise solar-right-ascension solar-right-ascension-at-sunrise solar-declination solar-declination-at-sunrise 50.0 60.0 90 x cos .017453292519943295 sin .017453292519943295 calendar-latitude 60.0 lat north cos-local-sunrise abs 360 solar-arccos local-sunrise mod .065709999999999997 6.6219999999999999 24 local-mean-sunrise calendar-time-zone 60.0] 6 "\ Calculates the *standard* time of sunrise for Gregorian DATE. Calculation is for location given by `calendar-latitude' and `calendar-longitude'. Returns a decimal fraction of hours. Returns nil if the sun does not rise at that location on that day."]) (defalias 'solar-sunset #[(date) "@A@AA@\n S_\\ V> _\\ɥZ ǦU> ˦U; ̦U> T ,NmHHХ\\HҚil[)ԥ)Z֥)\\!!!ߥ\\!!_!)!!_!)&&&H&H\\(&H隃(([)!!_!)_Z!!_!)&&&H&H\\(&H隃(([)!!_!)_**!X}*!ԥ)--\\_\\Z\"2QpHHХ\\HҚlo[)ԥ)Z3\\*." [date month day year 31 day-of-year 2 4 23 10 0 100 400 18 calendar-longitude 1 60.0 long east deg 15.0 hour 24.0 approx-sunset solar-longitude-of-sun solar-longitude-of-sun-at-sunset solar-right-ascension solar-right-ascension-at-sunset solar-declination solar-declination-at-sunset 50.0 60.0 90 x cos .017453292519943295 sin .017453292519943295 calendar-latitude 60.0 lat north cos-local-sunset abs solar-arccos local-sunset mod .065709999999999997 6.6219999999999999 24 local-mean-sunset calendar-time-zone 60.0] 6 "\ Calculates the *standard* time of sunset for Gregorian DATE. Calculation is for location given by `calendar-latitude' and `calendar-longitude'. Returns a decimal fractions of hours. Returns nil if the sun does not set at that location on that day."]) (defalias 'solar-adj-time-for-dst #[(date time &optional style) "AA@AA@S@A@AA@\f S_\\ VN _\\ʥZ ȦUN ̦UI ͦUNT,\n_\nȥ\n̥[\nͥ\\\\\\\\)_!ҥ\\!AA@S!@!A@!AA@\f S_\\ V _\\ʥZ ȦU ̦U ͦUT,\n_\nȥ\n̥[\nͥ\\\\\\\\)ץ\\[!AA@S!@!A@!AA@\f S_\\ V> _\\ʥZ ȦU> ̦U9 ͦU>T,\n_\nȥ\n̥[\nͥ\\\\\\\\)Zܥ\\=?=WXWWWXX?W!\"#$!奂\\!!!Z_$E." [date year prior-years month day 31 day-of-year 2 4 23 10 0 100 400 365 round time 60 1440.0 rounded-abs-date calendar-daylight-savings-starts eval calendar-daylight-savings-starts-time 1440.0 dst-starts calendar-daylight-savings-ends calendar-daylight-savings-ends-time calendar-daylight-time-offset 1440.0 dst-ends style standard daylight dst calendar-daylight-time-zone-name calendar-standard-time-zone-name time-zone 1440.0 calendar-gregorian-from-absolute truncate 24.0] 7 "\ Adjust decimal fraction standard TIME on DATE to account for dst. Returns a list (date adj-time zone) where `date' and `time' are the values adjusted for `zone'; here `date' is a list (month day year), `time' is a decimal fraction time, and `zone' is a string. Optional parameter STYLE forces the result time to be standard time when its value is 'standard and daylight savings time (if available) when its value is 'daylight. Conversion to daylight savings time is done according to `calendar-daylight-savings-starts', `calendar-daylight-savings-ends', `calendar-daylight-savings-starts-time', `calendar-daylight-savings-ends-time', and `calendar-daylight-savings-offset'."]) (defalias 'solar-time-string #[(time time-zone) " _!¥ ¦\" \\ɦT\"\n Y'˂( \"#." [round time 60 24-hours format "%02d" minutes "%d" 11 12 12-hours "pm" "am" am-pm mapconcat eval calendar-time-display-form ""] 5 "\ Printable form for decimal fraction TIME on DATE. Format used is given by `calendar-time-display-form'."]) (defalias 'solar-sunrise-sunset #[(date) " !\f \n\" ! \"\n5 \f@\"5\fA\"P6O @\"OA\"PP!$," [solar-sunrise date rise solar-adj-time-for-dst adj-rise solar-sunset set adj-set format "%s, %s at %s" calendar-date-equal "Sunrise " apply solar-time-string "No sunrise" "sunset " "no sunset" eval calendar-location-name] 8 "\ String giving local times of sunrise and sunset on Gregorian DATE."]) (defalias 'solar-apparent-longitude-of-sun #[(date) "AA@S@A@AA@ \nS_\\\nVI\n_\\ʥZ\fȦUI\f̦UD\fͦUIT, _ ȥ ̥[ ͥ\\\\\\\\) \nS_\\\nV\n_\\ʥZ\fȦU\f̦U\fͦUT, _ ȥ ̥[ ͥ\\\\\\\\)Zӥ___\\\\______\\\\\\___\\\\!!_!)__\\\\!!_!)__!!_!)_\\\\((\\)_\\,),!!_!)_\\\\." [date prior-years month day year 31 day-of-year 2 4 23 10 0 100 400 365 1899 1 .5 1900 36525 time 36000.768920000002 .00030249999999999999 279.69668000000001 l 35999.049749999998 -.00014999999999999996 -3.3000000000000003e-006 358.47582999999997 m -.0047889999999999997 -1.3999999999999999e-005 1.9194599999999999 x sin .017453292519943295 -.0001 .020094000000000003 3 .00029300000000000006 c L -1934.1420000000001 259.18000000000001 omega -.00479 -.0056899999999999995] 8 "\ Apparent longitude of the sun on Gregorian DATE."]) (defalias 'solar-ephemeris-correction #[(year) "Z¥_ __\\\\)" [year 1900 100.0 T 1.2053 .4992 .40999999999999996] 5 "\ Difference in minutes between Ephemeris time and UTC in YEAR. Value is only an approximation."]) (defalias 'solar-equinoxes/solstices #[(k year) "_\\ EVD!\"_Z_!)_@A@\\ E@A@ӥ !ե[\\\\ E+" [k 3 21 year nil 1000 correction app date 1e-005 mod solar-apparent-longitude-of-sun 360 90 x sin .017453292519943295 58 calendar-time-zone 1440.0 solar-ephemeris-correction 1440.0] 5 "\ Date of equinox/solstice K for YEAR. K=0, spring equinox; K=1, summer solstice; K=2, fall equinox; K=3, winter solstice. Accurate to within several minutes."]) (defalias 'sunrise-sunset #[(&optional arg) "W \f  W%\f(!W3 6!WA D!WP  ` !i H Hҥ\\ | VxӂԂ H֚ӂ\f\f!\fH\fHץ\\\f\fV؂ق\fHښ؂%) W U܂ W \" \"WW  W \n $$\"'$!)')#+!-+G X7+!Z')Q!-W4SXX!!.\f" [arg 1 16 calendar-latitude calendar-longitude calendar-time-zone solar-setup solar-get-number "Enter longitude (decimal fraction; + east, - west): " "Enter latitude (decimal fraction; + north, - south): " "Enter difference from Coordinated Universal Time (in minutes): " calendar-location-name "%.1f" float-output-format format "%s%s, %s%s" abs 0 60.0 "N" "S" 2 north 60.0 "E" "W" east calendar-standard-time-zone-name "UTC" "UTC%dmin" "UTC+%dmin" calendar-daylight-savings-starts calendar-daylight-savings-ends 4 calendar-current-date calendar-read-date date calendar-date-string t date-string solar-sunrise-sunset time-string "%s: %s" msg one-window-p one-window frame-width message "*temp*" princ "\n" substitute-command-keys pop-up-windows "Type \\[delete-other-windows] to remove temp window." "Type \\[switch-to-buffer] RET to remove temp window." "Type \\[switch-to-buffer-other-window] RET to restore old contents of temp window."] 7 "\ Local time of sunrise and sunset for today. Accurate to +/- 2 minutes. If called with an optional prefix argument, prompt for date. If called with an optional double prefix argument, prompt for longitude, latitude, time zone, and date, and always use standard time. This function is suitable for execution in a .emacs file." "p"]) (defalias 'calendar-sunrise-sunset #[nil "\f \f\n !ʼn#!#)" [calendar-latitude calendar-longitude calendar-time-zone solar-setup calendar-cursor-to-date t date message "%s: %s" calendar-date-string solar-sunrise-sunset] 6 "\ Local time of sunrise and sunset for date under cursor. Accurate to +/- 2 minutes." nil]) (defalias 'diary-sunrise-sunset #[nil "\f \f\n !" [calendar-latitude calendar-longitude calendar-time-zone solar-setup solar-sunrise-sunset date] 2 "\ Local time of sunrise and sunset as a diary entry. Accurate to +/- 2 minutes."]) (defalias 'diary-sabbath-candles #[nil "\f \f\n \fAA@S\f@\fA@\fAA@S_\\\nVb\n_\\ΥZ\n̦UbЦU]ѦUb\nT\n\n, _ ̥ Х[ ѥ\\\\\\\\)ӦU\f!\f٥Z\"\f@\"A\"\"*" [calendar-latitude calendar-longitude calendar-time-zone solar-setup date prior-years month day year 31 day-of-year 2 4 23 10 0 100 400 365 7 5 solar-sunset sunset solar-adj-time-for-dst 18.0 60.0 light calendar-date-equal format "%s Sabbath candle lighting" apply solar-time-string] 7 "\ Local time of candle lighting diary entry--applies if date is a Friday. No diary entry if there is no sunset on that date."]) (defalias 'solar-equinoxes-solstices #[nil " \n_ ŦUǂ! ŦU Ƃ!\\\\\\\nĦT\nĥ) <\f=\f F O [ \\ ťS\n\"{HHԥ\\H֚[)WA@@!AA@E!Z_\"@ 8A\"#. DC" [displayed-month displayed-year y m 12 3 1 -1 2 0 macro-y calendar-time-zone calendar-standard-time-zone-name "UTC" calendar-daylight-savings-starts calendar-daylight-savings-ends k solar-equinoxes/solstices date calendar-latitude 60.0 lat north s-hemi day solar-adj-time-for-dst truncate 24 adj format "%s %s" solar-s-hemi-seasons solar-n-hemi-seasons apply solar-time-string] 8 "\ Date and time of equinoxes and solstices, if visible in the calendar window. Requires floating point."]) (provide (quote solar))