Occurify.Astro 0.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Occurify.Astro --version 0.1.0
                    
NuGet\Install-Package Occurify.Astro -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Occurify.Astro" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Occurify.Astro" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Occurify.Astro" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Occurify.Astro --version 0.1.0
                    
#r "nuget: Occurify.Astro, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Occurify.Astro&version=0.1.0
                    
Install Occurify.Astro as a Cake Addin
#tool nuget:?package=Occurify.Astro&version=0.1.0
                    
Install Occurify.Astro as a Cake Tool

Occurify.Astro

Astronomical instants and periods for Occurify: Track sun states, perform calculations, and manage events.

Overview

  • Uses the SunCalcNet library to enable functionality that:
  • Supports location (coordinate) based instants and periods (e.g. dawn, daytime, etc).
  • Supports multiple solar phases (sunrise, sunset, end of sunrise, start of sunset, (nautical) dawn, (nautical) dusk, (end of) night, (end of) golden hour, solar noon and nadir).

For details on the Occurify ecosystem including examples for this library, please check the following documentation: Occurify main README.

Installation

Occurify.Astro is distributed as a NuGet package, you can install it from the official NuGet Gallery. Please use the following command to install it using the NuGet Package Manager Console window.

PM> Install-Package Occurify.Astro

Usage

Rather than working with concrete instants and periods in time, Occurify allows for conceptual representation of time using intstant and period timelines.

For example, rather than listing all sunrises of a year to work with, you can define the concept of "all sunrises", apply transformations or filters, and extract the relevant periods as needed.

The following example illustrates how we can calculate the number of days in the current year in the Arctic region that do not experience either a sunset or a sunrise:

Coordinates arcticCoordinates = new Coordinates(80.45302, 54.77918, Height: 37);
ITimeline sunsetsAndRises = AstroInstants.SunPhases(arcticCoordinates, SunPhases.Sunrise | SunPhases.Sunset);
IPeriodTimeline daysOfCurrentYear = TimeZonePeriods.Days().Within(TimeZonePeriods.CurrentYear());
IPeriodTimeline daysWithoutSunsetsOrRises = daysOfCurrentYear - daysOfCurrentYear.Containing(sunsetsAndRises);

Console.WriteLine($"This year on the arctic the sun doesn't rise or set on {daysWithoutSunsetsOrRises.Count()} days.");

The period timeline only resolves the necessary periods when enumerated, ensuring efficiency.

This approach allows developers to focus on what they need—such as "sunrises"—without manually managing time calculations. As a result, coding becomes more intuitive and use case-driven.

Coordinates

All methods in Occurify.Astro have a signature with and without Coordinates object. If no Coordinates object is provided, the method will use Coordinates.Local by default. Note that this static property needs to be set before use:

Coordinates.Local = new Coordinates(48.8584, 2.2945);

License

Copyright © 2025 Jasper Lammers. Occurify.Astro is licensed under The MIT License (MIT).

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.5.2 75 3 days ago
0.5.1 94 4 days ago
0.5.0 69 6 days ago
0.4.0 134 10 days ago
0.3.0 76 13 days ago
0.2.0 261 19 days ago
0.1.2 84 21 days ago
0.1.1 136 23 days ago
0.1.0 141 a month ago