AstroMeasurements.jl
Julia library for computing astrodynamic measurements from various observer types. Repo: HAMMERHEAD-Space/AstroMeasurements.jl
Architecture
Observer Types
| Type |
Measurements |
Description |
Radar |
rho, rho_dot, alpha, delta |
Range, range-rate, RA, Dec |
RangeOnly |
rho, rho_dot |
Range and range-rate only |
Optical |
alpha, delta, alpha_dot, delta_dot |
Angles and angular rates |
AngleOnly |
alpha, delta |
RA and Dec only |
GNSSType |
x,y,z,vx,vy,vz |
Full state from GNSS |
FullStateType |
x,y,z,vx,vy,vz |
Perfect state observation (simulation) |
Source Layout
src/
AstroMeasurements.jl # Module entry, exports, includes
constants.jl # Physical constants
observer_types.jl # Observer type definitions
observer_functions.jl # Shared observer utilities
get_measurement.jl # Core measurement computation
get_measurement_jacobian.jl # Analytical Jacobians
radar.jl # Radar-specific logic
optical.jl # Optical-specific logic
gnss.jl # GNSS-specific logic
fullstate.jl # Full-state observer logic
Key Patterns
Core API
# Compute measurement from observer
meas = get_measurement(observer, state, params...)
# Compute analytical Jacobian
H = get_measurement_jacobian(observer, state, params...)
Multiple dispatch on observer type selects the correct measurement model.
Analytical Jacobians
Hand-derived Jacobians verified against ForwardDiff in tests. This provides:
- Better performance than AD for orbit determination inner loops
- Validated correctness against automatic differentiation
Features
- Light-time correction: Optional for ground station observations
- Elevation masking: Configurable elevation masks for visibility checking
- Frame transformations: Uses
SatelliteToolboxTransformations for ECI/ECEF conversion
Adding a New Observer Type
- Define observer struct in
observer_types.jl
- Implement
get_measurement() dispatch for the new type
- Derive and implement analytical Jacobian in
get_measurement_jacobian.jl
- Validate Jacobian against ForwardDiff in tests
- Add
@check_allocs test for measurement computation
Dependencies
AstroCoords 0.3, Parameters 0.12, StaticArraysCore 1
SatelliteToolboxTransformations 1 (frame transformations)
- Test:
AllocCheck, Aqua, ForwardDiff, JET
1---2name: astromeasurements-jl3description: Develop and maintain AstroMeasurements.jl, a Julia library for computing astrodynamics measurements from observers. Use when working on AstroMeasurements.jl, implementing observation models, computing measurement Jacobians, or simulating orbit determination observations.4---5
6# AstroMeasurements.jl
7
8Julia library for computing astrodynamic measurements from various observer types. Repo: [HAMMERHEAD-Space/AstroMeasurements.jl](https://github.com/HAMMERHEAD-Space/AstroMeasurements.jl)
9
10## Architecture
11
12### Observer Types
13| Type | Measurements | Description |
14|------|-------------|-------------|
15| `Radar` | rho, rho_dot, alpha, delta | Range, range-rate, RA, Dec |
16| `RangeOnly` | rho, rho_dot | Range and range-rate only |
17| `Optical` | alpha, delta, alpha_dot, delta_dot | Angles and angular rates |
18| `AngleOnly` | alpha, delta | RA and Dec only |
19| `GNSSType` | x,y,z,vx,vy,vz | Full state from GNSS |
20| `FullStateType` | x,y,z,vx,vy,vz | Perfect state observation (simulation) |
21
22### Source Layout
23```
24src/
25 AstroMeasurements.jl # Module entry, exports, includes
26 constants.jl # Physical constants
27 observer_types.jl # Observer type definitions
28 observer_functions.jl # Shared observer utilities
29 get_measurement.jl # Core measurement computation
30 get_measurement_jacobian.jl # Analytical Jacobians
31 radar.jl # Radar-specific logic
32 optical.jl # Optical-specific logic
33 gnss.jl # GNSS-specific logic
34 fullstate.jl # Full-state observer logic
35```
36
37## Key Patterns
38
39### Core API
40```julia
41# Compute measurement from observer
42meas = get_measurement(observer, state, params...)
43
44# Compute analytical Jacobian
45H = get_measurement_jacobian(observer, state, params...)
46```
47
48Multiple dispatch on observer type selects the correct measurement model.
49
50### Analytical Jacobians
51Hand-derived Jacobians verified against ForwardDiff in tests. This provides:
52- Better performance than AD for orbit determination inner loops
53- Validated correctness against automatic differentiation
54
55### Features
56- **Light-time correction**: Optional for ground station observations
57- **Elevation masking**: Configurable elevation masks for visibility checking
58- **Frame transformations**: Uses `SatelliteToolboxTransformations` for ECI/ECEF conversion
59
60## Adding a New Observer Type
61
621. Define observer struct in `observer_types.jl`
632. Implement `get_measurement()` dispatch for the new type
643. Derive and implement analytical Jacobian in `get_measurement_jacobian.jl`
654. Validate Jacobian against ForwardDiff in tests
665. Add `@check_allocs` test for measurement computation
67
68## Dependencies
69- `AstroCoords` 0.3, `Parameters` 0.12, `StaticArraysCore` 1
70- `SatelliteToolboxTransformations` 1 (frame transformations)
71- Test: `AllocCheck`, `Aqua`, `ForwardDiff`, `JET`