All Projects → onekiloparsec → Swiftaa

onekiloparsec / Swiftaa

Licence: mit
The most comprehensive collection of accurate astronomical algorithms in (C++, Objective-C and) Swift.

Programming Languages

swift
15916 projects
cplusplus
227 projects

Projects that are alternatives of or similar to Swiftaa

Taniwhatextfield
My first cocoapod framework
Stars: ✭ 26 (-71.43%)
Mutual labels:  framework, ios-sdk
Towel
Throw in the towel.
Stars: ✭ 333 (+265.93%)
Mutual labels:  algorithm, framework
Vsalert
An drop-in replacement for UIAlertController with more power and better looks.
Stars: ✭ 48 (-47.25%)
Mutual labels:  algorithm, framework
Android Notes
✨✨✨这有一包小鱼干,确定不要吃嘛?( 逃
Stars: ✭ 732 (+704.4%)
Mutual labels:  algorithm, framework
Smqtk
Python toolkit for pluggable algorithms and data structures for multimedia-based machine learning.
Stars: ✭ 69 (-24.18%)
Mutual labels:  algorithm, framework
El Bot
🤖 基于 mirai-ts,运行于 Node.js,可配置、可自定义插件的 QQ 机器人框架。
Stars: ✭ 88 (-3.3%)
Mutual labels:  framework
Ant nest
Simple, clear and fast Web Crawler framework build on python3.6+, powered by asyncio.
Stars: ✭ 90 (-1.1%)
Mutual labels:  framework
Jsav
JavaScript Algorithm Visualization library
Stars: ✭ 87 (-4.4%)
Mutual labels:  algorithm
Ml
A high-level machine learning and deep learning library for the PHP language.
Stars: ✭ 1,270 (+1295.6%)
Mutual labels:  algorithm
Pyautolens
PyAutoLens: Open Source Strong Gravitational Lensing
Stars: ✭ 90 (-1.1%)
Mutual labels:  astronomy
Gotree
Gotree is a vertically distributed framework. Gotree's goal is to easily develop distributed services and liberate the mental burden of developers.
Stars: ✭ 91 (+0%)
Mutual labels:  framework
Torchrl
Pytorch Implementation of Reinforcement Learning Algorithms ( Soft Actor Critic(SAC)/ DDPG / TD3 /DQN / A2C/ PPO / TRPO)
Stars: ✭ 90 (-1.1%)
Mutual labels:  algorithm
Gotch
Go binding for Pytorch C++ API (libtorch)
Stars: ✭ 88 (-3.3%)
Mutual labels:  framework
Literoute
LiteRoute is easy transition for your app. Written on Swift 4
Stars: ✭ 90 (-1.1%)
Mutual labels:  framework
Acm Icpc Algorithms
Algorithms used in Competitive Programming
Stars: ✭ 1,281 (+1307.69%)
Mutual labels:  algorithm
Gracejs
A Nodejs BFF framework, build with koa2(基于koa2的标准前后端分离框架)
Stars: ✭ 1,302 (+1330.77%)
Mutual labels:  framework
Starlink
Starlink Software Collection
Stars: ✭ 87 (-4.4%)
Mutual labels:  astronomy
Spring Data Redis
Provides support to increase developer productivity in Java when using Redis, a key-value store. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.
Stars: ✭ 1,293 (+1320.88%)
Mutual labels:  framework
Adstex
Automated generation of NASA ADS bibtex entries directly from citation keys in your TeX source files
Stars: ✭ 89 (-2.2%)
Mutual labels:  astronomy
Mbpopup
macOS status bar popups done right 😎
Stars: ✭ 89 (-2.2%)
Mutual labels:  framework

SwiftAAAA.jsQLFitsFITSImporterObjCFITSIO

Become a Patreon

SwiftAA (and ObjCAA)

Travis Codecov Carthage compatible FOSSA Status

The most comprehensive collection of accurate astronomical algorithms, in C++, Objective-C and Swift, all in one place.

(Available through all distribution mechanisms: Swift Package Manager, Cocoapods and Carthage.)

Other implementations: JavaScript (AA.js), C# (AASharp).

See Notes below for the difference between ObjCAA and SwiftAA.

Description

SwiftAA provides everything you need to build our Solar System, compute length of seasons, moon phases, determine rise, transit and set times, get positions of large planetary moons, transform coordinates, determine physical details of planets, their illumination, distance etc. With a professional-grade accuracy.

SwiftAA is already used in production apps. In particular, MeteorActive, a carefully crafted iOS app to get everything about meteors.

SwiftAA is first built with an Objective-C(++) layer atop the C++ implementation by P.J. Naughter of the reference textbook Astronomical Algorithms, by Jean Meeus (2nd ed., Amazon). This C++ package is called AA+ (see below). AA+ also includes additional algorithms of the VSOP87 framework, and includes the complete support for the ELP/MPP02 theory. Thus, SwiftAA, thanks to AA+, is the most complete and accurate collection of algorithms for all things astronomical in Swift.

But SwiftAA provides more modern and a lot more readable APIs, taking advantage of the expressiveness of Swift and its various syntax elements, making it fun and easy of use. In fact, you simply can't use AA+ without having the AA book. While SwiftAA is precisely made to be accessible by anyone. Additional functions and algorithms are added to improve even more the completeness and ease of use. In particular, SwiftAA provides units safety a lot stronger compared to C++ APIs.

Moreover, SwiftAA has a much larger unit tests coverage (>90% for the Swift code!). In fact, unit tests are being carefully written with data directly taken from Jean Meeus' textbook, AA+ own tests, USNO, SkySafari and Xephem (and thus trying to achieve a probably hypothetical consistency between these sources).

Documentation

The documentation generated from the code itself is available at http://onekiloparsec.github.io/SwiftAA.

Installation

Using the Swift Package Manager: either through Xcode > File > Swift Packages > Add Package Dependency... and enter this repo URL (including the .git extension), , then choose SwiftAA target. Or add the line .package(url: "https://github.com/onekiloparsec/SwiftAA.git", from: "2.2.2") in the dependencies section of your Package.swift file.

Using Carthage: add github "onekiloparsec/SwiftAA" to your Cartfile, then run carthage update, and finally add the newly built SwiftAA-macOS.framework or SwiftAA-iOS.framework into your project (in embedded binaries).

Using CocoaPods: add pod 'SwiftAA', or pod 'ObjCAA' to your Podfile and then run pod update.

Notes

ObjCAA

For a long time, all the C++, Objective-C++ and Swift code was bundled together. But in order to distribute SwiftAA through the SPM, it was necessary to split the sources into seperate folders. Then, three different libraries were declared in the Package.swift file and built separatedly, each of them depending on the previous one (AA+, then ObjCAA, and finally SwiftAA).

During that evolution, we chose to create a specific ObjCAA target inside the Xcode project. The consequence is that ObjCAA must be imported in SwiftAA source files that need it. Not a big deal, expect for Cocoapods which doesn't understand the subtelty. Hence, we created a specific ObjCAA pod, which will follow the versionning numbers of the main package.

In summary, we have:

  • Three targets available through the Swift Package Manager: AA+, ObjCAA and SwiftAA. Embed only the last level you intend to use in your project.
  • Three targets available through Carthage, inside the Xcode project: ObjCAA (including AA+), SwiftAA-iOS and SwiftAA-macOS.
  • Two pods available through Cocoapods: ObjCAA and SwiftAA.

AA+

The AA+ framework, written in C++ by PJ Naughter (Visual C++ MVP) is certainly the best and most complete implementation of the "Astronomical Algorithms", found in the reference textbook by Jean Meeus. To make the most of this code specifically, you have to have a copy of the book with you (APIs and method names are hardly understandable without knowing what they refer to).

Pull requests are accepted only about the Objective-C(++) and Swift code. The AA+ code changes must be directed (as I will personnaly do if I need to) to the original source (see the AA+ website).

Today's version of AA+ used in SwiftAA is 2.08 (released October 22th, 2019).

Caution on Coordinates

The coordinates computations are key for modern astronomy. However, there is no mention to modern conventions (like ICRS) in the textbook of Jean Meeus, therefore in the AA+ code. Awaiting for such improvement, any user wanting to compute coordinates transformations should be careful. For a good example of a complete implementation of such transformations, see the AstroPy excellent package.

Prefixes & Conventions

Needless to say how different the syntax is between C, C++, Objective-C and Swift. The main guideline in writting SwiftAA was to build an Objective-C(++) layer that follow strictly the methods and interfaces of the underlying C++ library. Only the name of some variables were a bit "Objective-C-fied" (to avoid prefix them with the one-letter type, 'b' for boolean etc').

As Objective-C lacks namespaces, everything must be prefixed. It is a convention to use 3-letters prefixes in Objective-C. KPC stands for "kiloparsec" and is "my" usual prefix. I chose to keep the AA prefix that belongs to the C++ library as well. Hence the (rather long) 5-letters KPCAA prefix of all methods.

The constraint of having an Objective-C layer first comes from the fact that no C++ code can be written directly alongside Swift code (in the same file). And Swift doesn't have the header/implementation split into different files. Hence one must write a Objective-C++/C wrapper around it, with name prefixes.

Branches

For Swift4, see the swift4 branch. Likewise for Swift3 (unmaintained).

Author

Cédric Foellmi, a.k.a. @onekiloparsec (website).
(Ph.D. in astrophysics, and former support astronomer at the European Southern Observatory in Chile).
I am the author of the app iObserve (for macOS (and formerly in [iOS/iPad]) and arcsecond.io.

Support

You can help me spend more time on Open-Source software for astronomers by supporting me on Patreon!

Licence

The licence of this software is the MIT licence, which allows you to use it freely in open-source or commercial products. But it does not apply to the AA+ Framework, which retains its own licence. Quoting the original:

AA+ Copyright :

  • You are allowed to include the source code in any product (commercial, shareware, freeware or otherwise) when your product is released in binary form.
  • You are allowed to modify the source code in any way you want except you cannot modify the copyright details at the top of each module.
  • If you want to distribute source code with your application, then you are only allowed to distribute versions released by the author. This is to maintain a single distribution point for the source code.

FOSSA

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].