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            integration_time: None,
50            light_time_correction: false,
51            timestamp_noise_s: None,
52            stochastic_noises: Some(stochastics),
53        }
54    }
55
56    pub fn dss34_canberra(
57        elevation_mask_deg: f64,
58        range_noise_km: StochasticNoise,
59        doppler_noise_km_s: StochasticNoise,
60    ) -> Self {
61        let mut measurement_types = IndexSet::new();
62        measurement_types.insert(MeasurementType::Range);
63        measurement_types.insert(MeasurementType::Doppler);
64
65        let mut stochastics = IndexMap::new();
66        stochastics.insert(MeasurementType::Range, range_noise_km);
67        stochastics.insert(MeasurementType::Doppler, doppler_noise_km_s);
68
69        Self {
70            name: "Canberra".to_string(),
71            location: Location {
72                terrain_mask: TerrainMask::from_flat_terrain(elevation_mask_deg),
73                terrain_mask_ignored: false,
74                latitude_deg: -35.398_333,
75                longitude_deg: 148.981_944,
76                height_km: 0.691_750,
77                frame: IAU_EARTH_FRAME.into(),
78            },
79            measurement_types,
80            integration_time: None,
81            light_time_correction: false,
82            timestamp_noise_s: None,
83            stochastic_noises: Some(stochastics),
84        }
85    }
86
87    pub fn dss13_goldstone(
88        elevation_mask_deg: f64,
89        range_noise_km: StochasticNoise,
90        doppler_noise_km_s: StochasticNoise,
91    ) -> Self {
92        let mut measurement_types = IndexSet::new();
93        measurement_types.insert(MeasurementType::Range);
94        measurement_types.insert(MeasurementType::Doppler);
95
96        let mut stochastics = IndexMap::new();
97        stochastics.insert(MeasurementType::Range, range_noise_km);
98        stochastics.insert(MeasurementType::Doppler, doppler_noise_km_s);
99
100        Self {
101            name: "Goldstone".to_string(),
102            location: Location {
103                terrain_mask: TerrainMask::from_flat_terrain(elevation_mask_deg),
104                terrain_mask_ignored: false,
105                latitude_deg: 35.247_164,
106                longitude_deg: 243.205,
107                height_km: 1.071_149_04,
108                frame: IAU_EARTH_FRAME.into(),
109            },
110            measurement_types,
111            integration_time: None,
112            light_time_correction: false,
113            timestamp_noise_s: None,
114            stochastic_noises: Some(stochastics),
115        }
116    }
117}