<commit_before>SunriseSunset
=============

Java utility which provides methods to determine the sunrise, sunset, civil twilight,
nautical twilight, and astronomical twilight times of a given
location.

Also provides methods:
* to convert between Gregorian and Julian dates.
* to know if it is currently day or night at a given location.

The formulas used by this class are from the Wikipedia articles on [Julian Day] (http://en.wikipedia.org/wiki/Julian_day)
and [Sunrise Equation] (http://en.wikipedia.org/wiki/Sunrise_equation).
  
Adding the dependency
=====================

Gradle:
-------
Add this repository:
```
maven { url "https://dl.bintray.com/caarmen/maven/" }
```

Declare the dependency:
```
classpath 'ca.rmen:lib-sunrise-sunset:1.0.0'
```
Maven:
------
Add this repository:
```
<repository>
 <id>caarmen-repo</id>
 <url>https://dl.bintray.com/caarmen/maven/</url>
</repository>
```
Declare the dependency:
```
<dependency>
 <groupId>ca.rmen</groupId>
 <artifactId>lib-sunrise-sunset</artifactId>
 <version>1.0.0</version>
 <scope>compile</scope>
</dependency>
```

Any other build system:
-------------------
Alternatively, you can just copy the single java file into your project:
[library/src/main/java/ca/rmen/sunrisesunset/SunriseSunset.java](library/src/main/java/ca/rmen/sunrisesunset/SunriseSunset.java)
Using the library
=================
To get the sunrise and sunset times for today in Paris, France:
```
Calendar[] sunriseSunset = ca.rmen.sunrisesunset.SunriseSunset.getSunriseSunset(Calendar.getInstance(), 48.85837, 2.294481);
System.out.println("Sunrise at: " + sunriseSunset[0].getTime());
System.out.println("Sunset at: " + sunriseSunset[1].getTime());
```

The civil, nautical, and astronomical twilight times are retrieved in the same way:
```
Calendar[] civilTwilight = ca.rmen.sunrisesunset.SunriseSunset.getCivilTwilight(Calendar.getInstance(), 48.85837, 2.294481);
System.out.println("Civil twilight stops at: " + civilTwilight[0].getTime());
System.out.println("Civil twilight starts at: " + civilTwilight[1].getTime());

Calendar[] nauticalTwilight = ca.rmen.sunrisesunset.SunriseSunset.getNauticalTwilight(Calendar.getInstance(), 48.85837, 2.294481);
System.out.println("Nautical twilight stops at: " + nauticalTwilight[0].getTime());
System.out.println("Nautical twilight starts at: " + nauticalTwilight[1].getTime());

Calendar[] astronomicalTwilight = ca.rmen.sunrisesunset.SunriseSunset.getAstronomicalTwilight(Calendar.getInstance(), 48.85837, 2.294481);
System.out.println("Astronomical twilight stops at: " + astronomicalTwilight[0].getTime());
System.out.println("Astronomical twilight starts at: " + astronomicalTwilight[1].getTime());
```<commit_msg>Add link to javadoc<commit_after>SunriseSunset
=============

Java utility which provides methods to determine the sunrise, sunset, civil twilight,
nautical twilight, and astronomical twilight times of a given
location.

Also provides methods:
* to convert between Gregorian and Julian dates.
* to know if it is currently day or night at a given location.

The formulas used by this class are from the Wikipedia articles on [Julian Day] (http://en.wikipedia.org/wiki/Julian_day)
and [Sunrise Equation] (http://en.wikipedia.org/wiki/Sunrise_equation).
  
Adding the dependency
=====================

Gradle:
-------
Add this repository:
```
maven { url "https://dl.bintray.com/caarmen/maven/" }
```

Declare the dependency:
```
classpath 'ca.rmen:lib-sunrise-sunset:1.0.0'
```
Maven:
------
Add this repository:
```
<repository>
 <id>caarmen-repo</id>
 <url>https://dl.bintray.com/caarmen/maven/</url>
</repository>
```
Declare the dependency:
```
<dependency>
 <groupId>ca.rmen</groupId>
 <artifactId>lib-sunrise-sunset</artifactId>
 <version>1.0.0</version>
 <scope>compile</scope>
</dependency>
```

Any other build system:
-------------------
Alternatively, you can just copy the single java file into your project:
[library/src/main/java/ca/rmen/sunrisesunset/SunriseSunset.java](library/src/main/java/ca/rmen/sunrisesunset/SunriseSunset.java)
Using the library
=================
To get the sunrise and sunset times for today in Paris, France:
```
Calendar[] sunriseSunset = ca.rmen.sunrisesunset.SunriseSunset.getSunriseSunset(Calendar.getInstance(), 48.85837, 2.294481);
System.out.println("Sunrise at: " + sunriseSunset[0].getTime());
System.out.println("Sunset at: " + sunriseSunset[1].getTime());
```

The civil, nautical, and astronomical twilight times are retrieved in the same way:
```
Calendar[] civilTwilight = ca.rmen.sunrisesunset.SunriseSunset.getCivilTwilight(Calendar.getInstance(), 48.85837, 2.294481);
System.out.println("Civil twilight stops at: " + civilTwilight[0].getTime());
System.out.println("Civil twilight starts at: " + civilTwilight[1].getTime());

Calendar[] nauticalTwilight = ca.rmen.sunrisesunset.SunriseSunset.getNauticalTwilight(Calendar.getInstance(), 48.85837, 2.294481);
System.out.println("Nautical twilight stops at: " + nauticalTwilight[0].getTime());
System.out.println("Nautical twilight starts at: " + nauticalTwilight[1].getTime());

Calendar[] astronomicalTwilight = ca.rmen.sunrisesunset.SunriseSunset.getAstronomicalTwilight(Calendar.getInstance(), 48.85837, 2.294481);
System.out.println("Astronomical twilight stops at: " + astronomicalTwilight[0].getTime());
System.out.println("Astronomical twilight starts at: " + astronomicalTwilight[1].getTime());
```

Documentation
=============
Javadoc is here: [http://caarmen.github.io/SunriseSunset/] http://caarmen.github.io/SunriseSunset/
{'fraction_non_alphanumeric': 0.1656441717791411, 'fraction_numerical': 0.025261638397690366, 'mean_word_length': 5.630382775119617, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3558861', 'n_tokens_mistral': 1980, 'n_tokens_neox': 1777, 'n_words': 405}