Code Monkey home page Code Monkey logo

swift-solar-calculator's Introduction

The SolarCalucuator.swift was created by Dr. Jeff Craighead and has been tested on iOS 8.3.

This code is based on the NREL Technical Report "Solar Position Algorithm for Solar Radiation Applications" which provides C source for the calculations.
NREL/TP-560-34302 - November 2005 revision
http://www.nrel.gov/docs/fy08osti/34302.pdf

I made some modifications to eliminate the use of the SPA struct and often return a tuple for methods that would modify the contents of that struct.
You really don't need to worry about any of that, there are only a handful of important methods you need to use this library. They are:

-spa_calculate:
	calculates all the various solar output parameters described in the NREL report based on the latitude, longitude, time, date, altitude, and optionally temperature and air pressure you set.

-get_sunrise_tuple:
	returns a tuple with Hour, Minute, and Second that indicates the sunrise time for the day used when spa_calculate was run

-get_sunset_tuple:
	returns a tuple with Hour, Minute, and Second that indicates the sunset time for the day used when spa_calculate was run

-get_suntransit_tuple
	returns a tuple with Hour, Minute, and Second that indicates the sun transit (solar noon) time for the day used when spa_calculate was run

-showRTSAlertView:
	on iOS displays an AlertView with the next sunrise, sunset, and sun transit for the based on the parameters you provide (latitude, longitude, altitude)	

swift-solar-calculator's People

Contributors

jeffcraighead avatar

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.