solarpositioning
solarpositioning copied to clipboard
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.