GithubHelp home page GithubHelp logo

solar-calculator's Introduction

Equations based on NOAA’s Solar Calculator.

Examples:

API Reference

# solar.apparentLongitude(t) <>

Given a time t in J2000.0 centuries, returns the Sun’s apparent longitude in degrees.

# solar.century(date) <>

Given a date, returns the fraction number of centures since the J2000.0 epoch, 2000-01-01T12:00:00Z. (No correction is made between Terrestrial Time and UTC.)

# solar.declination(t) <>

Given a time t in J2000.0 centuries, returns the Sun’s declination in degrees.

# solar.equationOfCenter(t) <>

Given a time t in J2000.0 centuries, returns the Sun and Earth’s equation of the center in degrees.

# solar.equationOfTime(t) <>

Given a time t in J2000.0 centuries, returns the Sun and Earth’s equation of time in minutes.

# solar.hours(date, latitude) <>

Given a date and a latitude in degrees, returns the number of daylight hours.

# solar.meanAnomaly(t) <>

Given a time t in J2000.0 centuries, returns the Sun’s mean anomaly in degrees.

# solar.meanLongitude(t) <>

Given a time t in J2000.0 centuries, returns the Sun’s mean longitude in degrees.

# solar.noon(date, longitude) <>

Given a date and a longitude in degrees, returns the time of the solar noon. (TODO This description isn’t quite right, because the date is first floored to the UTC day boundary and then adjusted based on the specified longitude.)

# solar.obliquityOfEcliptic(t) <>

Given a time t in J2000.0 centuries, returns the obliquity of the ecliptic in degrees.

# solar.orbitEccentricity(t) <>

Given a time t in J2000.0 centuries, returns Earth’s orbital eccentricity.

# solar.riseHourAngle(date, latitude) <>

Given a date and a latitude in degrees, returns the hour angle of sunrise on the given day in degrees.

# solar.rise(date, latitude, longitude) <>

Given a date and a latitude and longitude in degrees, returns the time of sunrise. (TODO Describe more precisely the date of the returned sunrise.)

# solar.set(date, latitude, longitude) <>

Given a date and a latitude and longitude in degrees, returns the time of sunset. (TODO Describe more precisely the date of the returned sunset.)

# solar.trueLongitude(t) <>

Given a time t in J2000.0 centuries, returns the Sun’s true longitude in degrees.

solar-calculator's People

Contributors

mbostock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

solar-calculator's Issues

README needs clarification for Date objects in #noon, #rise, and #set

I was wondering if you could clarify the input and returned Date objects for the #noon, #rise, and #set functions in the README

Two sources for confusion:

  • input Date: My understanding is that the input Date is floored to the UTC day boundary. This can lead to unexpected results if the input Date has a UTC offset that puts it in a different day than the UTC.
// System timezone is EDT, UTC-04:00
d = new Date()          // => Mon Mar 12 2018 22:30:00 GMT-0400 (EDT)

// Sunrise for New York (returns the next day)
rise(d, 40.7, -74.0)    // => Tue Mar 13 2018 07:10:16 GMT-0400 (EDT)
  • return Date: The Date is returned in UTC, but JavaScript displays it in the system's local time, regardless.
// System timezone is EDT, UTC-04:00
d = new Date()          // => Mon Mar 12 2018 22:30:00 GMT-0400 (EDT)

// Sunrise for Los Angeles
rise(d, 34, -118)       // => Tue Mar 13 2018 10:04:24 GMT-0400 (EDT)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.