Skip to content

Instantly share code, notes, and snippets.

View vineetred's full-sized avatar
🚩
Focusing

Vineet Reddy vineetred

🚩
Focusing
  • Uber
  • SF
View GitHub Profile
@vineetred
vineetred / solar.rs
Created July 9, 2020 13:14
Solar Timetable in Rust
/// This file is a copy of [solar.c](https://github.com/jonls/redshift/blob/master/src/solar.c) from redshift.
///
/// This module makes extensive use of the [Julian Day notation](https://en.wikipedia.org/wiki/Julian_day)
/// to measure elapsed days between events and in calculations.
use std::collections::HashMap;
use chrono;
use chrono::prelude::*;
/* Ported from javascript code by U.S. Department of Commerce,
National Oceanic & Atmospheric Administration:
http://www.srrb.noaa.gov/highlights/sunrise/calcdetails.html