Coder Social home page Coder Social logo

klausbrunner / solarpositioning Goto Github PK

View Code? Open in Web Editor NEW
84.0 16.0 24.0 360 KB

Java sun position code (topocentric coordinates, sunrise/sunset/twilight) based on the NREL SPA and ENEA/Grena algorithms.

License: MIT License

Java 100.00%
astronomy java science sun sunposition sunrise sunrise-sunset library solar solartracker

solarpositioning's People

Contributors

dependabot[bot] avatar klausbrunner 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

Watchers

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

solarpositioning's Issues

Improve sunrise/sunset/twilight API

Current one works ok if you only need a single pair of values, but users interested in twilight values will probably want more than one (e.g. sunrise/sunset + civil + nautical twilight). Then it's just repetitive and inefficient, as some calculations are repeated needlessly.

Maybe something along the lines of

List <SunriseTransitSet> bla = calculate(....., List.of(Horizon...., Horizon...))

Then refactor internally to separate the constant parts from those dependent on horizon type.

Regarding the steps of usage of this library

I am a new person in the java dev area and I wanted to use the repo in my project but i am confused about how to use the library what things do i need to have installed and do i need to make a jar file of the library could you please guide me for the same

Wrong times

I'm getting wrong sunrise/set information for:
Resolute Bay 74.6973, -94.8297 , November 1st, 2016
Returning Null, Null.
However there is a sunrise and sunset on this day.. and even 2nd, 3rd, 4rd, and 5th.. All of those return null.

DateTime dt = new DateTime(2016, 11, 1, 1, 0);
SPA.calculateSunriseTransitSet(dt.toGregorianCalendar(), 74.6973, // latitude
-94.8297, // longitude 68); // delta T

Unless I'm doing something wrong, it seems the error in the higher latitude is very big. If I enter a lower latitude I get results that look more accurate when comparing with other sources.

Switch to Java 8

Not planned in the short term, but probably sometime 2016. Would allow using the new Joda-like date/time APIs instead of the awful old Date/Calendar mess.

Support various twilight types

There seems to be some demand for twilight times, so look into supporting those (civil/nautical/astronomical, perhaps also "golden hour").

bug

Hi, there is a bug on file SPA.java, line 575

this one

pow(jd.julianCentury(), 2) / 38710000);

should be

pow(jd.julianCentury(), 3) / 38710000);

Moon and Milky way

Hey Klaus.
Any plans to expand the library to support moon and milky way calculations too?
Or maybe you could point me to some papers, or C++ libraries that do that?
Thanks

Sun transit date even when it is arctic night

On SPA.calculateSunriseTransitSet, sun transit is calculated even when there is no sunrise nor sunset and that it is the night (case when the position is inside the Arctic circle).

GregorianCalendar cal = new GregorianCalendar(TimeZone.getTimeZone(ZoneId.of("Europe/Paris")));
cal.set(Calendar.YEAR, 2017);
cal.set(Calendar.DAY_OF_YEAR, 01);
SPA.calculateSunriseTransitSet(cal, 78., // latitude
16., //Longitude
DeltaT.estimate(cal)); // delta T

A simple correction could be to return null for sun transit when :
final boolean noDay = (acosArg > 1.0);

Or if this behaviour is correct for you, can we get another method to get information on if there is a day or not.

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.