Skip to content

Commit d4057ff

Browse files
basic api docs
1 parent a40a287 commit d4057ff

File tree

16 files changed

+539
-9
lines changed

16 files changed

+539
-9
lines changed

docs/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.jl.*.cov
2+
*.jl.cov
3+
*.jl.mem
4+
/Manifest.toml
5+
build/

docs/generate.jl

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using Literate
2+
using Dates
3+
4+
# TODO: Remove items from `SKIPFILE` as soon as they run on the latest stable
5+
ONLYSTATIC = []
6+
EXAMPLE_DIRS = ["Tutorials",]
7+
SKIPFILE = [
8+
"t03_eop.jl", "t04_lighttime.jl", "t05_multithread.jl"
9+
]
10+
11+
function update_date(content)
12+
content = replace(content, "DATEOFTODAY" => Dates.DateTime(now()))
13+
return content
14+
end
15+
16+
for edir in EXAMPLE_DIRS
17+
gen_dir = joinpath(@__DIR__, "src", edir, "gen")
18+
example_dir = joinpath(@__DIR__, "src", edir)
19+
for example in filter!(x -> endswith(x, ".jl"), readdir(example_dir))
20+
if example in SKIPFILE
21+
continue
22+
end
23+
input = abspath(joinpath(example_dir, example))
24+
script = Literate.script(input, gen_dir)
25+
code = strip(read(script, String))
26+
mdpost(str) = replace(str, "@__CODE__" => code)
27+
Literate.markdown(
28+
input, gen_dir,
29+
preprocess=update_date,
30+
postprocess=mdpost,
31+
documenter=!(example in ONLYSTATIC)
32+
)
33+
end
34+
end
35+

docs/make.jl

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
using Documenter, FrameTransformations
2+
using Pkg
3+
4+
const CI = get(ENV, "CI", "false") == "true"
5+
6+
if CI
7+
Pkg.add("Ephemerides")
8+
Pkg.add("ReferenceFrameRotations")
9+
Pkg.add("JSMDUtils")
10+
Pkg.add("JSMDInterfaces")
11+
Pkg.add("Literate")
12+
Pkg.add("Dates")
13+
Pkg.add("Tempo")
14+
end
15+
16+
# include("generate.jl")
17+
18+
makedocs(;
19+
authors="JSMD Development Team",
20+
sitename="FrameTransformations.jl",
21+
modules=[FrameTransformations],
22+
format=Documenter.HTML(; prettyurls=CI, highlights=["yaml"], ansicolor=true),
23+
pages=[
24+
"Home" => "index.md",
25+
"Tutorials" => [
26+
# "01 - Frame System" => "Tutorials/gen/t00_frames.md",
27+
# "02 - Rotation" => "Tutorials/gen/t01_rotation.md",
28+
# "03 - Axes" => "Tutorials/gen/t02_axes.md",
29+
# "04 - Points" => "Tutorials/gen/t03_points.md",
30+
# "05 - Light Time Corrections" => "Tutorials/gen/t04_lighttime.md",
31+
# "06 - Multi-threading" => "Tutorials/gen/t05_multithread.md"
32+
],
33+
# "Use Cases" => [
34+
# "CR3BP" => "Examples/gen/e01_cr3bp.md",
35+
# "High Fidelity" => "Examples/gen/e02_hifi.md",
36+
# "Custom Orbit" => "Examples/gen/e03_customorb.md"
37+
# ],
38+
# "Benchmarks" => "benchmarks.md",
39+
"API" => [
40+
"Public API" => [
41+
"Axes" => "API/axes_api.md",
42+
"Points" => "API/point_api.md",
43+
"Directions" => "API/dir_api.md",
44+
"Frames" => "API/frames_api.md"
45+
],
46+
],
47+
],
48+
clean=true,
49+
checkdocs=:none
50+
)
51+
52+
if CI
53+
deploydocs(;
54+
repo="github.com/JuliaSpaceMissionDesign/FrameTransformations.jl", branch="gh-pages"
55+
)
56+
end

docs/src/API/axes_api.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# [Axes](@id axes_api)
2+
3+
## Core
4+
5+
```@docs
6+
add_axes!
7+
8+
add_axes_fixedoffset!
9+
add_axes_projected!
10+
add_axes_rotating!
11+
add_axes_alias!
12+
FrameTransformations.add_axes_ephemeris!
13+
```
14+
15+
## Celestial
16+
17+
```@docs
18+
add_axes_gcrf!
19+
add_axes_icrf!
20+
add_axes_eme2000!
21+
```
22+
23+
## Ecliptic
24+
25+
```@docs
26+
add_axes_ecl2000!
27+
```
28+
29+
## Terrestrial
30+
31+
```@docs
32+
add_axes_itrf!
33+
add_axes_tirf!
34+
add_axes_cirf!
35+
36+
add_axes_mod!
37+
add_axes_tod!
38+
add_axes_gtod!
39+
add_axes_pef!
40+
```
41+
42+
## Planetary
43+
44+
```@docs
45+
add_axes_bci2000!
46+
add_axes_bcrtod!
47+
```
48+
49+
## Lunar
50+
51+
```@docs
52+
add_axes_me421!
53+
add_axes_pa421!
54+
add_axes_pa440!
55+
```
56+
57+
## Topocentric
58+
59+
```@docs
60+
add_axes_topocentric!
61+
```
62+
63+
## Others
64+
65+
```@docs
66+
add_axes_twodir!
67+
add_axes_frozen!
68+
add_axes_fixed_quaternion!
69+
add_axes_fixed_angles!
70+
add_axes_fixed_angleaxis!
71+
```
72+
## Utils
73+
74+
### [IDs](@id frames_axesid)
75+
76+
This is a list of NAIF IDs for standard axes that are used in astrodynamic applications.
77+
78+
```@docs
79+
FrameTransformations.AXESID_ICRF
80+
FrameTransformations.AXESID_MOONME_DE421
81+
FrameTransformations.AXESID_MOONPA_DE421
82+
FrameTransformations.AXESID_MOONPA_DE440
83+
FrameTransformations.AXESID_ECL2000
84+
FrameTransformations.AXESID_EME2000
85+
FrameTransformations.AXESID_GCRF
86+
```
87+
88+
### [Rotation Matrices](@id frames_dcms)
89+
90+
```@docs
91+
FrameTransformations.DCM_ICRF_TO_EME2000
92+
```

docs/src/API/dir_api.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# [Directions](@id dir_api)
2+
3+
4+
```@docs
5+
add_direction!
6+
7+
add_direction_fixed!
8+
add_direction_position!
9+
add_direction_velocity!
10+
add_direction_orthogonal!
11+
```

docs/src/API/frames_api.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
## [Frame System](@id frames_api)
2+
3+
```@docs
4+
FrameSystem
5+
order
6+
FrameTransformations.timescale
7+
```
8+
9+
### Points
10+
11+
```@docs
12+
has_point
13+
points_graph
14+
points_alias
15+
```
16+
17+
### Axes
18+
19+
```@docs
20+
has_axes
21+
axes_graph
22+
axes_alias
23+
```
24+
25+
### Directions
26+
27+
```@docs
28+
has_direction
29+
directions
30+
```
31+
32+
## [Rotations](@id rotation_api)
33+
34+
```@docs
35+
Rotation
36+
Base.inv
37+
Translation
38+
```
39+
40+
## [Transformations](@id transformations_api)
41+
42+
### [Points](@id points_transform_api)
43+
44+
```@docs
45+
vector3
46+
vector6
47+
vector9
48+
vector12
49+
```
50+
51+
### [Axes](@id axes_transform_api)
52+
53+
```@docs
54+
rotation3
55+
rotation6
56+
rotation9
57+
rotation12
58+
```
59+
60+
### [Directions](@id directions_transform_api)
61+
62+
```@docs
63+
direction3
64+
direction6
65+
direction9
66+
direction12
67+
```

docs/src/API/point_api.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# [Points](@id points_api)
2+
3+
```@docs
4+
add_point!
5+
6+
add_point_dynamical!
7+
add_point_fixedoffset!
8+
9+
FrameTransformations.add_point_ephemeris!
10+
add_point_surface!
11+
12+
add_point_alias!
13+
```

docs/src/index.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Welcome to FrameTransformations.jl!
2+
3+
_A modern, high-performance and comprehensive set of tools for transformations between any standard and user-defined reference frame._
4+
5+
Are you in search of fundamental routines for efficient and extensible frames transformations?
6+
If so, this package is the ideal starting point. FrameTransformations.jl is designed to
7+
provide users with the ability to create a customized, efficient, flexible, and
8+
extensible axes/point graph models for mission analysis and space mission design purposes.
9+
10+
## Features
11+
12+
- Convert between different time scales and representations (via [Tempo.jl](https://github.com/JuliaSpaceMissionDesign/Tempo.jl)).
13+
- Read binary ephemeris files (via [Ephemerides.jl](https://github.com/JuliaSpaceMissionDesign/Ephemerides.jl) or [CalcephEphemeris.jl](https://github.com/JuliaSpaceMissionDesign/CalcephEphemeris.jl) extensions).
14+
- Create custom reference frame systems with both standard and user-defined points, axes and directions.
15+
- Transform states and their higher-order derivatives between different frames (up to jerk).
16+
17+
All of this integrated with [ForwardDiff.jl](https://github.com/JuliaDiff/ForwardDiff.jl).
18+
19+
## Installation
20+
21+
This package can be installed using Julia's package manager:
22+
```julia
23+
julia> import Pkg
24+
25+
julia> Pkg.add("FrameTransformations.jl");
26+
```

src/Core/axes.jl

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Add a new axes node to `frames`.
1313
1414
!!! warning
1515
This is a low-level function and is NOT meant to be directly used. Instead, to add a set of
16-
axes to the frame system, see [`add_axes_inertial!`](@ref), [`add_axes_rotating!`](@ref),
17-
[`add_axes_fixedoffset!`](@ref) and [`add_axes_root!`](@ref).
16+
axes to the frame system, see [`add_axes_projected!`](@ref), [`add_axes_rotating!`](@ref)
17+
and [`add_axes_fixedoffset!`](@ref).
1818
"""
1919
function add_axes!(
2020
frames::FrameSystem{O,T}, name::Symbol, id::Int,
@@ -188,4 +188,30 @@ function add_axes_rotating!(
188188
)
189189

190190
return add_axes!(frames, name, id, funs, axes_id(frames, parent))
191+
end
192+
193+
"""
194+
add_axes_alias!(frames, target, alias::Symbol)
195+
196+
Add a name `alias` to a `target` axes registered in `frames`.
197+
"""
198+
function add_axes_alias!(frames::FrameSystem{O,T}, target, alias::Symbol) where {O,T}
199+
if !has_axes(frames, target)
200+
throw(
201+
ErrorException(
202+
"no axes with ID $target registered in the given frame system"
203+
)
204+
)
205+
end
206+
207+
if alias in keys(axes_alias(frames))
208+
throw(
209+
ErrorException(
210+
"axes with name $alias already present in the given frame system"
211+
)
212+
)
213+
end
214+
215+
push!(axes_alias(frames), Pair(alias, axes_id(frames, target)))
216+
nothing
191217
end

src/Core/graph.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Return the frame system axes graph.
7676
"""
7777
points_alias(f::FrameSystem)
7878
79-
Return the registered points graph.
79+
Return the registered points aliases map.
8080
"""
8181
@inline points_alias(f::FrameSystem) = f.points.alias
8282

0 commit comments

Comments
 (0)