@@ -24,7 +24,7 @@ use indexmap::{IndexMap, IndexSet};
24
24
use snafu:: ensure;
25
25
26
26
use super :: msr:: MeasurementType ;
27
- use super :: noise:: StochasticNoise ;
27
+ use super :: noise:: { GaussMarkov , StochasticNoise } ;
28
28
use super :: { ODAlmanacSnafu , ODError , ODTrajSnafu , TrackingDevice } ;
29
29
use crate :: io:: ConfigRepr ;
30
30
use crate :: od:: NoiseNotConfiguredSnafu ;
@@ -119,6 +119,34 @@ impl GroundStation {
119
119
self
120
120
}
121
121
122
+ /// Returns a copy of this ground station with the measurement type noises' constant bias set to the provided value.
123
+ pub fn with_msr_bias_constant (
124
+ mut self ,
125
+ msr_type : MeasurementType ,
126
+ bias_constant : f64 ,
127
+ ) -> Result < Self , ODError > {
128
+ if self . stochastic_noises . is_none ( ) {
129
+ self . stochastic_noises = Some ( IndexMap :: new ( ) ) ;
130
+ }
131
+
132
+ let stochastics = self . stochastic_noises . as_mut ( ) . unwrap ( ) ;
133
+
134
+ let this_noise = stochastics
135
+ . get_mut ( & msr_type)
136
+ . ok_or ( ODError :: NoiseNotConfigured {
137
+ kind : format ! ( "{msr_type:?}" ) ,
138
+ } )
139
+ . unwrap ( ) ;
140
+
141
+ if this_noise. bias . is_none ( ) {
142
+ this_noise. bias = Some ( GaussMarkov :: ZERO ) ;
143
+ }
144
+
145
+ this_noise. bias . unwrap ( ) . constant = Some ( bias_constant) ;
146
+
147
+ Ok ( self )
148
+ }
149
+
122
150
/// Computes the azimuth and elevation of the provided object seen from this ground station, both in degrees.
123
151
/// This is a shortcut to almanac.azimuth_elevation_range_sez.
124
152
pub fn azimuth_elevation_of (
0 commit comments