Skip to content

Commit 197c2e5

Browse files
committed
A few months of off/on work.
* Refactor of astro-core * Initial commit of astro-time * Initial commit of astro-coords * Initial commit of astro-ephemeris * Initial commit of astro-images * Initial commit of astro-wcs * Removed vendor. will publish ERFA/etc integration tests in other repos.
1 parent 5dd7df5 commit 197c2e5

260 files changed

Lines changed: 236413 additions & 1636 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
publish:
10+
name: Publish to crates.io
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout source
15+
uses: actions/checkout@v4
16+
17+
- name: Install Rust
18+
uses: dtolnay/rust-toolchain@stable
19+
20+
- name: Initialize ERFA submodule
21+
run: git submodule update --init --recursive
22+
23+
- name: Publish crates (in dependency order)
24+
env:
25+
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
26+
run: |
27+
# Publish order based on dependency graph
28+
crates=(
29+
"astro-core"
30+
"astro-time"
31+
"astro-coords"
32+
"astro-wcs"
33+
"astro-ephemeris"
34+
"astro-images"
35+
)
36+
37+
for crate in "${crates[@]}"; do
38+
echo "Publishing $crate..."
39+
cargo publish -p "$crate"
40+
# Wait for crates.io to index before publishing dependents
41+
sleep 30
42+
done
43+
44+
create-release:
45+
name: Create GitHub Release
46+
runs-on: ubuntu-latest
47+
needs: publish
48+
49+
steps:
50+
- name: Checkout source
51+
uses: actions/checkout@v4
52+
53+
- name: Create Release
54+
uses: softprops/action-gh-release@v1
55+
with:
56+
name: Release ${{ github.ref_name }}
57+
body: "Celestial workspace release ${{ github.ref_name }}"
58+
draft: false
59+
prerelease: false

.github/workflows/test.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ jobs:
2222
git submodule update --init --recursive
2323
2424
- name: Install Rust
25-
uses: actions-rs/toolchain@v1
25+
uses: dtolnay/rust-toolchain@stable
2626
with:
27-
toolchain: stable
28-
override: true
2927
components: clippy
3028

3129
- name: Run tests
@@ -51,10 +49,7 @@ jobs:
5149
git submodule update --init --recursive
5250
5351
- name: Install Rust
54-
uses: actions-rs/toolchain@v1
55-
with:
56-
toolchain: stable
57-
override: true
52+
uses: dtolnay/rust-toolchain@stable
5853

5954
- name: Cache cargo + tarpaulin
6055
uses: actions/cache@v3

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ target/
33
Cargo.lock
44
.ipynb_checkpoints/
55
build_rs_cov.profraw
6+
*.fits
7+
_tmp/*
8+
vendor/*
9+
vsop2013/*
610

7-
# Test data dumping ground
8-
dumping-ground/
911

1012
# Python
1113
__pycache__/

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

.python-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

.tarpaulin.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
[default]
22
workspace = true
33
timeout = "120s"
4-
exclude-files = ["vendor/*"]
4+
skip-clean = true
5+
out = ["Lcov", "Json"]
6+
output-dir = "target/tarpaulin"
7+
exclude-files = [
8+
"astro-core/src/test_helpers.rs"
9+
]

Cargo.toml

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
[workspace]
22
resolver = "2"
3-
members = [ "astro-core", "erfa-sys" ]
3+
members = [
4+
"astro-coords",
5+
"astro-core",
6+
"astro-ephemeris",
7+
"astro-time",
8+
"astro-images",
9+
"astro-wcs",
10+
]
411

512
[workspace.package]
613
version = "0.1.0"
@@ -10,9 +17,47 @@ license = "MIT OR Apache-2.0"
1017
repository = "https://github.com/gaker/celestial"
1118

1219
[workspace.dependencies]
13-
thiserror = "2.0"
14-
once_cell = "1.19"
15-
cc = "1.0"
16-
proptest = "1.4"
20+
# Internal crates
21+
astro-core = { version = "0.1.0", path = "astro-core" }
22+
astro-time = { version = "0.1.0", path = "astro-time" }
23+
astro-coords = { version = "0.1.0", path = "astro-coords" }
24+
astro-ephemeris = { version = "0.1.0", path = "astro-ephemeris" }
25+
astro-images = { version = "0.1.0", path = "astro-images" }
26+
astro-wcs = { version = "0.1.0", path = "astro-wcs" }
27+
28+
# External dependencies (alphabetical)
1729
approx = "0.5"
30+
byteorder = "1.5"
31+
cc = "1.0"
32+
chrono = "0.4"
33+
clap = { version = "4.5", features = ["derive"] }
34+
crc32fast = "1.4"
1835
criterion = "0.5"
36+
flate2 = "1.0"
37+
glob = "0.3"
38+
libm = "0.2.11"
39+
lz4_flex = "0.11"
40+
memmap2 = "0.9"
41+
mockito = "1.0"
42+
ndarray = "0.15"
43+
num-traits = "0.2"
44+
once_cell = "1.19"
45+
png = "0.18"
46+
proptest = "1.4"
47+
quick-xml = "0.31"
48+
rayon = "1.8"
49+
regex = "1.11"
50+
reqwest = "0.12"
51+
serde = { version = "1.0", features = ["derive"] }
52+
serde_json = "1.0"
53+
tempfile = "3.10"
54+
thiserror = "2.0"
55+
tiff = "0.11"
56+
tokio = { version = "1.0", features = ["rt", "macros", "net", "io-util", "time"] }
57+
wide = "0.7"
58+
wiremock = "0.6"
59+
60+
[profile.release]
61+
opt-level = 3
62+
lto = true
63+
codegen-units = 1

README.md

Lines changed: 41 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,58 +4,72 @@
44
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
55
[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
66

7-
Astronomical computation library for Rust.
7+
Pure Rust astronomical computation library. No runtime FFI.
88

9-
## Status
9+
## Crates
1010

11-
Early development. Only `astro-core` for now
11+
### astro-core
1212

13-
## What's Available
13+
Low-level astronomical calculations: IAU 2000/2006 nutation/precession models, rotation matrices, angle handling, geodetic conversions.
1414

15-
### astro-core [![Crates.io](https://img.shields.io/crates/v/astro-core)](https://crates.io/crates/astro-core)
15+
```toml
16+
[dependencies]
17+
astro-core = "0.1"
18+
```
1619

17-
Basic types for astronomical calculations:
20+
### astro-time
1821

19-
- Earth locations using WGS84 ellipsoid
20-
- Error types for astronomical calculations
21-
- Physical constants (speed of light, Earth radius, etc.)
22+
8 astronomical time scales (UTC, TAI, TT, UT1, GPS, TDB, TCB, TCG) with nanosecond-precision Julian Dates, leap second support, and IAU-standard sidereal time.
2223

2324
```toml
2425
[dependencies]
25-
astro-core = "0.1"
26+
astro-time = "0.1"
2627
```
2728

28-
```rust
29-
use astro_core::Location;
29+
### astro-coords
3030

31-
// Create a location for Mauna Kea Observatory
32-
let mauna_kea = Location::from_degrees(19.8283, -155.4783, 4207.0)?;
31+
Type-safe coordinate frame transformations (ICRS, CIRS, GCRS, TIRS, ITRS, Galactic, Ecliptic, Topocentric) with aberration, light deflection, and Earth orientation support.
3332

34-
// Get geocentric coordinates for Earth rotation calculations
35-
let (u, v) = mauna_kea.to_geocentric_km()?;
36-
println!("Distance from Earth's axis: {:.3} km", u);
33+
```toml
34+
[dependencies]
35+
astro-coords = "0.1"
3736
```
3837

39-
### erfa-sys
38+
### astro-ephemeris
4039

41-
Low-level FFI bindings to the ERFA astronomical library. Used internally for validation and reference implementations.
40+
Planetary and lunar ephemerides using VSOP2013 and ELP/MPP02 theories. JPL SPK kernel support.
4241

43-
## Planned
42+
```toml
43+
[dependencies]
44+
astro-ephemeris = "0.1"
45+
```
4446

45-
- `astro-time`: High-precision time handling (nanosecond accuracy)
46-
- `astro-coords`: Coordinate transformations
47-
- `astro-earth`: Earth rotation models
47+
### astro-images
4848

49-
## Development
49+
FITS, XISF, and SER image format support with compression (Gzip, Rice), binary/ASCII tables, and Bayer demosaicing.
5050

51-
This is early stage development. The API will change. Don't use this. If you want to help. Reach out.
51+
```toml
52+
[dependencies]
53+
astro-images = "0.1"
54+
```
55+
56+
### astro-wcs
57+
58+
World Coordinate System (WCS) transformations for FITS images. Pixel to celestial coordinate mapping with distortion support.
59+
60+
```toml
61+
[dependencies]
62+
astro-wcs = "0.1"
63+
```
64+
65+
## Development
5266

53-
Each crate has its own README with detailed documentation.
67+
Early stage. API will change. Each crate has its own README with detailed documentation.
5468

5569
## Requirements
5670

5771
Rust 1.70 or later.
5872

5973
## License
6074

61-
Licensed under either Apache 2.0 or MIT at your option.
75+
Licensed under either Apache 2.0 or MIT.

astro-coords/Cargo.toml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[package]
2+
name = "astro-coords"
3+
version.workspace = true
4+
authors.workspace = true
5+
edition.workspace = true
6+
license.workspace = true
7+
repository.workspace = true
8+
description = "Astronomical coordinate transformations"
9+
keywords = ["astronomy", "coordinates", "celestial", "astrometry"]
10+
categories = ["science"]
11+
12+
[dependencies]
13+
astro-core.workspace = true
14+
astro-time.workspace = true
15+
crc32fast.workspace = true
16+
libm.workspace = true
17+
reqwest = { workspace = true, optional = true, features = ["blocking"] }
18+
serde = { workspace = true, optional = true }
19+
serde_json = { workspace = true, optional = true }
20+
thiserror.workspace = true
21+
22+
[features]
23+
default = []
24+
serde = ["dep:serde", "dep:serde_json", "astro-core/serde", "astro-time/serde"]
25+
eop-download = ["serde", "dep:reqwest"]
26+
27+
[dev-dependencies]
28+
criterion.workspace = true
29+
mockito.workspace = true
30+
serde_json.workspace = true
31+
tokio.workspace = true
32+

0 commit comments

Comments
 (0)