Skip to main content

nyx_space/od/ground_station/
builtin.rs

1/*
2    Nyx, blazing fast astrodynamics
3    Copyright (C) 2018-onwards Christopher Rabotin <christopher.rabotin@gmail.com>
4
5    This program is free software: you can redistribute it and/or modify
6    it under the terms of the GNU Affero General Public License as published
7    by the Free Software Foundation, either version 3 of the License, or
8    (at your option) any later version.
9
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU Affero General Public License for more details.
14
15    You should have received a copy of the GNU Affero General Public License
16    along with this program.  If not, see <https://www.gnu.org/licenses/>.
17*/
18
19use anise::astro::TerrainMask;
20use anise::constants::frames::IAU_EARTH_FRAME;
21
22use super::*;
23
24impl GroundStation {
25    pub fn dss65_madrid(
26        elevation_mask_deg: f64,
27        range_noise_km: StochasticNoise,
28        doppler_noise_km_s: StochasticNoise,
29    ) -> Self {
30        let mut measurement_types = IndexSet::new();
31        measurement_types.insert(MeasurementType::Range);
32        measurement_types.insert(MeasurementType::Doppler);
33
34        let mut stochastics = IndexMap::new();
35        stochastics.insert(MeasurementType::Range, range_noise_km);
36        stochastics.insert(MeasurementType::Doppler, doppler_noise_km_s);
37
38        Self {
39            name: "Madrid".to_string(),
40            location: Location {
41                terrain_mask: TerrainMask::from_flat_terrain(elevation_mask_deg),
42                terrain_mask_ignored: false,
43                latitude_deg: 40.427_222,
44                longitude_deg: 4.250_556,
45                height_km: 0.834_939,
46                frame: IAU_EARTH_FRAME.into(),
47            },
48            measurement_types,
49            doppler_config: None,
50            light_time_correction: false,
51            timestamp_noise_s: None,
52            stochastic_noises: Some(stochastics),
53            obstructing_body: None,
54            relativistic_corrections: false,
55        }
56    }
57
58    pub fn dss34_canberra(
59        elevation_mask_deg: f64,
60        range_noise_km: StochasticNoise,
61        doppler_noise_km_s: StochasticNoise,
62    ) -> Self {
63        let mut measurement_types = IndexSet::new();
64        measurement_types.insert(MeasurementType::Range);
65        measurement_types.insert(MeasurementType::Doppler);
66
67        let mut stochastics = IndexMap::new();
68        stochastics.insert(MeasurementType::Range, range_noise_km);
69        stochastics.insert(MeasurementType::Doppler, doppler_noise_km_s);
70
71        Self {
72            name: "Canberra".to_string(),
73            location: Location {
74                terrain_mask: TerrainMask::from_flat_terrain(elevation_mask_deg),
75                terrain_mask_ignored: false,
76                latitude_deg: -35.398_333,
77                longitude_deg: 148.981_944,
78                height_km: 0.691_750,
79                frame: IAU_EARTH_FRAME.into(),
80            },
81            measurement_types,
82            doppler_config: None,
83            light_time_correction: false,
84            timestamp_noise_s: None,
85            stochastic_noises: Some(stochastics),
86            obstructing_body: None,
87            relativistic_corrections: false,
88        }
89    }
90
91    pub fn dss13_goldstone(
92        elevation_mask_deg: f64,
93        range_noise_km: StochasticNoise,
94        doppler_noise_km_s: StochasticNoise,
95    ) -> Self {
96        let mut measurement_types = IndexSet::new();
97        measurement_types.insert(MeasurementType::Range);
98        measurement_types.insert(MeasurementType::Doppler);
99
100        let mut stochastics = IndexMap::new();
101        stochastics.insert(MeasurementType::Range, range_noise_km);
102        stochastics.insert(MeasurementType::Doppler, doppler_noise_km_s);
103
104        Self {
105            name: "Goldstone".to_string(),
106            location: Location {
107                terrain_mask: TerrainMask::from_flat_terrain(elevation_mask_deg),
108                terrain_mask_ignored: false,
109                latitude_deg: 35.247_164,
110                longitude_deg: 243.205,
111                height_km: 1.071_149_04,
112                frame: IAU_EARTH_FRAME.into(),
113            },
114            measurement_types,
115            doppler_config: None,
116            light_time_correction: false,
117            timestamp_noise_s: None,
118            stochastic_noises: Some(stochastics),
119            obstructing_body: None,
120            relativistic_corrections: false,
121        }
122    }
123}