L>occupychristmas.org Improved Sunrise/Suncollection Calculation//***********************************************************************///*DATA STRUCTURES*///***********************************************************************/attribute month(name, numdays, abbr) this.name = name;this.numdays = numdays;this.abbr = abbr;//*********************************************************************/attribute ans(daySave,value)this.daySave = daySave;this.worth = value;//*********************************************************************/feature city(name, lat, lng, zoneHr) this.name = name;this.lat = lat;this.lng = lng;this.zoneHr = zoneHr;//***********************************************************************///*Documents for Selectbox Controls*///***********************************************************************/var monthList = new Array();//list of months and also days for non-leap yearvar i = 0;monthList = brand-new month("January", 31, "Jan");monthList = brand-new month("February", 28, "Feb");monthList = new month("March", 31, "Mar");monthList = new month("April", 30, "Apr");monthList = brand-new month("May", 31, "May");monthList = brand-new month("June", 30, "Jun");monthList = brand-new month("July", 31, "Jul");monthList = brand-new month("August", 31, "Aug");monthList = new month("September", 30, "Sep");monthList = new month("October", 31, "Oct");monthList = brand-new month("November", 30, "Nov");monthList = new month("December", 31, "Dec");//*********************************************************************/var YesNo = new Array();//Daylight Saving arrayi=0;YesNo = new ans("No",0);YesNo = brand-new ans("Yes",60);//*********************************************************************/var City = brand-new Array();j = 0;City = brand-new city("Go into Lat/Long -->",0,0,0);City = new city("",0,0,0);City = new city("US CITIES",0,0,0);City = brand-new city("Albuquerque, NM", 35.0833,106.65,7);City = new city("Anchorage, AK", 61.217, 149.90,9);City = new city("Atlanta, GA", 33.733, 84.383, 5);City = brand-new city("Austin, TX", 30.283, 97.733, 6);City = new city("Birmingham, AL", 33.521, 86.8025, 6);City = brand-new city("Bismarck, ND", 46.817, 100.783, 6);City = new city("Boston, MA", 42.35, 71.05, 5);City = brand-new city("Boulder, CO", 40.125, 105.237, 7);City = new city("Chicback, IL", 41.85,87.65,6);City = brand-new city("Dallas, TX", 32.46, 96.47,6);City = new city("Denver, CO", 39.733, 104.983, 7);City = brand-new city("Detroit, MI", 42.333, 83.05, 5);City = new city("Honolulu, HI", 21.30, 157.85, 10);City = new city("Houston, TX", 29.75, 95.35, 6);City = brand-new city("Indianapolis, IN", 39.767, 86.15, 5);City = brand-new city("Jackson, MS", 32.283, 90.183, 6);City = new city("Kansas City, MO", 39.083, 94.567,6);City = new city("Los Angeles, CA",34.05,118.233,8);City = brand-new city("Menomonee Falls, WI",43.11,88.10,6);City = brand-new city("Miami, FL", 25.767, 80.183,5);City = new city("Minneapolis, MN", 44.967, 93.25, 6);City = new city("New Orleans, LA", 29.95, 90.067, 6);City = brand-new city("New York City, NY", 40.7167, 74.0167, 5);City = brand-new city("Oklahoma City, OK", 35.483, 97.533,6);City = new city("Philadelphia, PA", 39.95, 75.15, 5);City = brand-new city("Phoenix, AZ",33.433,112.067,7);City = brand-new city("Pittsburgh, PA",40.433,79.9833,5);City = new city("Portland also, ME", 43.666, 70.283, 5);City = brand-new city("Portland, OR", 45.517, 122.65, 8);City = brand-new city("Raleigh, NC", 35.783, 78.65, 5);City = brand-new city("Richmond, VA", 37.5667, 77.450, 5);City = new city("Saint Louis, MO", 38.6167,90.1833,6);City = new city("San Antonio, TX", 29.53, 98.47, 6);City = brand-new city("San Diego, CA", 32.7667, 117.2167, 8);City = brand-new city("San Francisco, CA",37.7667,122.4167,8);City = new city("Seattle, WA",47.60,122.3167,8);City = brand-new city("Washington DC", 38.8833, 77.0333,5);City = new city("",0,0,0);City = new city("WORLD CITIES",0,0,0);City = new city("Beijing, China",39.9167, -116.4167,-8);City = new city("Berlin, Germany",52.33, -13.30, -1);City = brand-new city("Bombay, India", 18.9333, -72.8333, -5.5);City = brand-new city("Buenos Aires, Argentina", -34.60,58.45,3);City = brand-new city("Cairo, Egypt", 30.10,-31.3667,-2);City = brand-new city("Cape Town, South Africa",-33.9167,-18.3667,-2);City = new city("Caracas, Venezuela", 10.50,66.9333,4);City = new city("Helsinki, Finland", 60.1667, -24.9667,-2);City = new city("Hong Kong, China", 22.25,-114.1667, -8);City = brand-new city("Jerusalem, Israel", 31.7833, -35.2333, -2);City = new city("London, England", 51.50, 0.1667,0);City = brand-new city("Mexico City, Mexico", 19.4,99.15,6);City = new city("Moscow, Russia", 55.75, -37.5833, -3);City = brand-new city("New Delhi, India",28.6, -77.2, -5.5);City = brand-new city("Ottawa, Canada", 45.41667,75.7,5);City = new city("Paris, France", 48.8667, -2.667, -1);City = new city("Rio de Janeiro, Brazil",-22.90,43.2333,3);City = brand-new city("Riyadh, Saudi Arabia", 24.633, -46.71667, -3);City = brand-new city("Rome, Italy",41.90, -12.4833,-1);City = brand-new city("Sydney, Australia",-33.8667,-151.2167,-10);City = new city("Tokyo, Japan", 35.70, -139.7667, -9); City = brand-new city("Zuwell-off, Switzerland", 47.3833, -8.5333,-1);City = brand-new city("",0,0,0);City = brand-new city("SURFRAD NETWORK",0,0,0);City = brand-new city("Goodwin Creek, MS",34.2544444,89.8738888, 6);City = brand-new city("Ft Peck, MT",48.310555,105.1025, 7);City = new city("Bondville, IL",40.055277,88.371944, 6);City = brand-new city("Table Mountain, CO",40.125,105.23694, 7);City = brand-new city("Desert Rock, NV",36.626, 116.018, 8);City = new city("Penn State, PA", 40.72, 77.93, 5);City = new city("Canaan Valley, WV", 39.1, 79.4, 5);City = brand-new city("Sioux Falls, SD", 43.733, 96.6233, 6);City = brand-new city("",0,0,0);City = brand-new city("ARM/CART NETWORK",0,0,0);City = brand-new city("Atqasuk, AK", 70.47215, 157.4078, 9);City = new city("Barrow, AK", 71.30,156.683, 9);City = brand-new city("Manus Island, PNG", -2.06, -147.425,-10);City = brand-new city("Nauru Island", -0.52, -166.92, -12);City = new city("Darwin, Australia", -12.425, -130.891, -9.5);City = brand-new city("SGP Central Facility", 36.6167, 97.5, 6);City = new city("",0,0,0);City = new city("SOLRAD NETWORK",0,0,0);City = new city("Albuquerque, NM", 35.04, 106.62,7);City = new city("Bismarck, ND", 46.77, 100.77,6);City = brand-new city("Hanford, CA", 36.31, 119.63,8);City = new city("Madiboy, WI", 43.13, 89.33,6);City = brand-new city("Oak Ridge, TN", 35.96, 84.37,5);City = new city("Salt Lake City, UT", 40.77,111.97,7);City = new city("Seattle, WA", 47.68, 122.25,8);City = new city("Sterling, VA", 38.98, 77.47,5);City = brand-new city("Tallahascheck out, FL", 30.38, 84.37,5);//*********************************************************************/occupychristmas.org ESRLSunrise/Suncollection CalculatorPlanet SystemResearch LabPlease note that this internet web page is the old variation of the occupychristmas.org Solar Calculator.Back as soon as this calculator was first produced, we chose to use a non-standarddefinition of longitude and also time zone, to make coordinate enattempt much less awkward.So on this page, both longitude and time zone are characterized as positive to thewest, rather of the international typical of positive to the east of thePrime Meridian.We keep this page as a courtesy to those world who, for whatever factor,favor the old calculator. For the rest of you, we encourage you to insteadclick below to attempt the updated version of occupychristmas.org"s Solar Calculator //*********************************************************************/attribute setLatLong(f, index)// Decimal degrees are passed in the variety. Temporarily store these // degs in lat and lon deg and also have actually convLatLong modify them.f<"latDeg">.value = City.lat;f<"lonDeg">.worth = City.lng;// These are needed to proccasion iterative adding of min and sec as soon as // collection switch is clicked.f<"latMin">.value = 0;f<"latSec">.value = 0;f<"lonMin">.worth = 0;f<"lonSec">.value = 0;//contact convLatLong to convert decimal levels right into table develop.convLatLong(f);//Local time zone worth collection in tablef<"hrsToGMT">.worth = City.zoneHr;//*********************************************************************/// isLeapYear returns 1 if the 4-digit yr is a leap year, 0 if it is notfeature isLeapYear(yr) yr % 400 == 0);//*********************************************************************/// isPosInteger retransforms false if the worth is not a positive integer, true is// returned otherwise. The code is from taken from Danny Goodman"s Javascript// Handbook, p. 372.attribute isPosInteger(inputVal) inputStr = ("" + inputVal);for (var i = 0; i "9")rerotate false;rerotate true;}//*********************************************************************/feature isInteger(inputVal) inputStr = "" + inputVal;if(inputStr == "NaN") return false;if(inputStr == "-NaN") rerevolve false;for (var i = 0; i "9")rerotate false;rerevolve true;}//*********************************************************************/attribute isNumber(inputVal) var oneDecimal = false;var inputStr = "" + inputVal;for (var i = 0; i "9")rerotate false;return true;}//*********************************************************************/// isValidInput provides sure valid input is gone into before going ahead to // calculate the sunrise and also sunset. False is changed if an invalid entry // was made, true is the enattempt is valid.function isValidInput(f, index, latLongForm) f<"day">.value == 0)alert("The day should be a positive integer.");rerevolve false;else if (!isInteger(f<"year">.value)) alert("The year need to be an integer.");rerotate false;else if ( (f<"year">.worth 3000) )alert("The algorithm supplied is not valid for years external of/nthe selection -1000 to 3000.");return false;//For the non-February months view if the day gone into is higher than//the variety of days in the selected monthelse if ((index != 1) && (f<"day">.value > monthList.numdays)) alert("There are only " + monthList.numdays + " days in " + monthList.name + ".");return false;//First watch if the year entered is a leap year. If so we have to make sure//the days gotten in is (monthList.numdays + 1)) alert("Tright here are only " + (monthList.numdays + 1) + " days in " + monthList.name + ".");rerevolve false;elsererotate true;else //year entered is not a leap yearif (f<"day">.value > monthList.numdays) alert("Tbelow are only " + monthList.numdays + " days in " + monthList.name + ".");rerevolve false;elsererevolve true;}else return true;}//*********************************************************************///convLatLong converts any type of type of lat/long input//right into the table create and then handles negative input//it is nested in the calcSun feature.feature convLatLong(f)if(f<"latDeg">.worth == "")f<"latDeg">.value = 0;if(f<"latMin">.value == "")f<"latMin">.worth = 0;if(f<"latSec">.value == "")f<"latSec">.value = 0;if(f<"lonDeg">.worth == "")f<"lonDeg">.value = 0;if(f<"lonMin">.value == "")f<"lonMin">.worth = 0;if(f<"lonSec">.worth == "")f<"lonSec">.worth = 0;var neg = 0;if(f<"latDeg">.worth.charAt(0) == "-") neg = 1;if(neg != 1)var latSeconds = (parseFloat(f<"latDeg">.value))*3600 + parseFloat(f<"latMin">.value)*60 + parseFloat(f<"latSec">.value)*1;f<"latDeg">.worth = Math.floor(latSeconds/3600);f<"latMin">.worth = Math.floor((latSeconds- (parseFloat(f<"latDeg">.value)*3600))/60);f<"latSec">.worth = Math.floor((latSeconds- (parseFloat(f<"latDeg">.value)*3600) - (parseFloat(f<"latMin">.value)*60)) + 0.5);else if(parseFloat(f<"latDeg">.value) > -1)var latSeconds = parseFloat(f<"latDeg">.value)*3600 - parseFloat(f<"latMin">.value)*60 - parseFloat(f<"latSec">.value)*1;f<"latDeg">.value = "-0";f<"latMin">.worth = Math.floor((-latSeconds)/60);f<"latSec">.worth = Math.floor( (-latSeconds - (parseFloat(f<"latMin">.value)*60)) + 0.5);elsevar latSeconds = parseFloat(f<"latDeg">.value)*3600 - parseFloat(f<"latMin">.value)*60 - parseFloat(f<"latSec">.value)*1;f<"latDeg">.worth = Math.ceil(latSeconds/3600);f<"latMin">.worth = Math.floor((-latSeconds+ (parseFloat(f<"latDeg">.value)*3600))/60);f<"latSec">.value = Math.floor((-latSeconds+ (parseFloat(f<"latDeg">.value)*3600) - (parseFloat(f<"latMin">.value)*60)) + 0.5);neg = 0;if(f<"lonDeg">.worth.charAt(0) == "-") neg = 1;if(neg != 1)var lonSeconds = parseFloat(f<"lonDeg">.value)*3600 + parseFloat(f<"lonMin">.value)*60 + parseFloat(f<"lonSec">.value)*1;f<"lonDeg">.worth = Math.floor(lonSeconds/3600);f<"lonMin">.value = Math.floor((lonSeconds- (parseFloat(f<"lonDeg">.value)*3600))/60);f<"lonSec">.worth = Math.floor((lonSeconds- (parseFloat(f<"lonDeg">.value)*3600)- (parseFloat(f<"lonMin">.value))*60) + 0.5);else if(parseFloat(f<"lonDeg">.value) > -1)var lonSeconds = parseFloat(f<"lonDeg">.value)*3600 - parseFloat(f<"lonMin">.value)*60 - parseFloat(f<"lonSec">.value)*1;f<"lonDeg">.value = "-0";f<"lonMin">.worth = Math.floor((-lonSeconds)/60);f<"lonSec">.worth = Math.floor((-lonSeconds- (parseFloat(f<"lonMin">.value)*60)) + 0.5);elsevar lonSeconds = parseFloat(f<"lonDeg">.value)*3600 - parseFloat(f<"lonMin">.value)*60 - parseFloat(f<"lonSec">.value)*1;f<"lonDeg">.value = Math.ceil(lonSeconds/3600);f<"lonMin">.worth = Math.floor((-lonSeconds+ (parseFloat(f<"lonDeg">.value)*3600))/60);f<"lonSec">.value = Math.floor((-lonSeconds+ (parseFloat(f<"lonDeg">.value)*3600)- (parseFloat(f<"lonMin">.value)*60)) + 0.5);//Test for invalid lat/lengthy inputif(latSeconds > 324000)alert("You have gotten in an invalid latitude. Setting lat = 89.");f<"latDeg">.value = 89;f<"latMin">.worth = 0;f<"latSec">.worth = 0;if(latSeconds 648000)alert("You have gone into an invalid longitude. Setting lon = 180.");f<"lonDeg">.worth = 180;f<"lonMin">.value = 0;f<"lonSec">.value = 0;if(lonSeconds 2) ? C - 4716 : C - 4715;// alert ("date: " + day + "-" + monthList.name + "-" + year);rerotate (day + "-" + monthList.name + "-" + year);//***********************************************************************///* Name: calcDayFromJD*///* Type: Function*///* Purpose: Calendar day (minus year) from Julian Day*///* Arguments:*///* jd : Julian Day*///* Rerevolve value:*///* String day in the form DD-MONTH*///***********************************************************************/feature calcDayFromJD(jd) Click below for aid findingyour lat/long coordinatesLong:West=+East=-Note: To manually enter latitude/longitude, select Enter Lat/Long -> from theCity pulldvery own food selection, and also enter theworths in the text boxes to the right. Month:Day:Year (e.g. 2000): dateObj1 = new Date();thismonth = dateObj1.getMonth();now = dateObj1.getDate(); for (i = 0; i " + monthList.name);}else document.writeln("" + monthList.name);} dateObj2 = new Date();thisday = dateObj2.getDate(); record.writeln("");dateObj3 = brand-new Date();thisYear = dateObj3.getYear();if(thisYear "); Equation of Time(minutes):SolarDeclination (degrees):ApparentSunrise:Solar Noon:ApparentSunset:TimeZoneLocal UTCDirections:Select a area from the City pulldvery own food selection, OR choose "Get in Lat/Long ->" from the pulldown food selection, and also manually enter the latitude, longitude and also time zone information in the proper message boxes. The adhering to authorize conventions are used: Longitude:Latitude:Positive in Western HemisphereHopeful in Northern HemisphereNegative in Eastern HemisphereNegative in Southern HemisphereLatitude and also Longitude can be in deg/min/sec, or decimal degrees entered in the "Deg:" field. If you choose a city from the pulldown menu, the latitude, longitude and time zone fields will be filled in instantly. If you want to input latitude, longitude or time zone manually, be sure to select "Enter Lat/Long -->" from the City pulldvery own box, or your numbers will certainly be overcomposed by the selected city"s location.You can enter a different time zone for a place by choosing "Get in Lat/Long -->" in the City pulldown box. Otherwise, the time zone associated withthe schosen city"s Local Standard Time will be instantly gotten in. Selecting "Yes" in the Daylight Saving field will cause the resulting sunrise, suncollection and also solar noon times to be readjusted forward one hour. If you are unspecific of the moment zone for a location, refer to our Time Zone Table. The regimen retrieves the present day from your computer, and also fills the month, day and also year areas. To percreate calculations for a various date, sindicate select a month in the pull dvery own food selection, and enter the day and 4 digit year in the appropriate input boxes. When entering a day or year, you willshould click the "Calculate Sunrise/Sunset" button to update the results forthis day.Once the calculation outcomes are displayed, you may use your internet browser"s "Print" attribute to attain a hardcopy of the results.For areas above the Arctic Circle and also below the Antarctic Circle, whena sunclimb or sunset does not occur on the provided day the routine locates thelocal time and date of the the majority of current sunclimb or sunset, and the following sunset or sunrise. When thisoccurs, the UTC fields will display screen "prior" or "next" indevelopment insteadof the UTC times.NOTE: For latitudes greater than 72 degrees N and also S, calculations are specific to within 10 minutes.


You are watching: Portland latitude and longitude


See more: Fun Halloween Cut And Paste, Cut And Paste Halloween Fun Faces!

For latitudes much less than +/- 72° accuracyis about one minute. See Solar Calculation Details for additionally explanation.
Solar Position CalculatorCalculation DetailsSolar Calculator Links
*
Time Zone TableSolar Calculator GlossaryBack to SRRB Homepage
by Chris Cornwall,Aaron Horiuchi and Chris Lehmanrecord.write("Last Updated on " + document.lastModified + ".");