@@ -29,39 +29,51 @@ extern crate gnss_rs as gnss;
2929
3030## Space Vehicles
3131
32+ A small library to define and handle satellite vehicles and constellation.
33+
3234``` rust
33- extern crate gnss_rs as gnss;
35+ use gnss_rs :: sv;
36+ use gnss_rs :: prelude :: * ;
3437
35- use gnss :: sv;
36- use gnss :: prelude :: * ;
3738use std :: str :: FromStr ;
38- use hifitime :: TimeScale ;
39+ use hifitime :: { TimeScale , Epoch } ;
3940
41+ // This method lets you construct satellites that may not exist
4042let sv = SV :: new (Constellation :: GPS , 1 );
43+
4144assert_eq! (sv . constellation, Constellation :: GPS );
4245assert_eq! (sv . prn, 1 );
43- assert_eq! (sv . timescale (), Some (TimeScale :: GPST ));
44- assert_eq! (sv , sv! (" G01" ));
45- assert_eq! (sv . launched_date (), None );
46+ assert_eq! (sv . launch_date (), None ); // only for SBAS vehicles
4647```
4748
48- ## SBAS support
49-
50- We support SBAS (geostationary augmentations) systems.
49+ ## SBAS (Geostationary) vehicles
5150
51+ The library integrates a smart SBAS constellation identifier. We use the RINEX
52+ convention (PRN ranging from 0..100), therefore the true satellite number
53+ of SBAS vehicles is the PRN we use +100.
54+
5255``` rust
53- extern crate gnss_rs as gnss;
56+ use gnss_rs :: sv;
57+ use gnss_rs :: prelude :: * ;
5458
55- use gnss :: sv;
56- use gnss :: prelude :: * ;
5759use std :: str :: FromStr ;
58- use hifitime :: {Epoch , TimeScale };
60+ use hifitime :: {TimeScale , Epoch , MonthName };
61+
62+ // This only works if satellite do exist in our database
63+ assert! (SV :: new_sbas (1 ). is_none ());
64+
65+ let egnos_geo23 = SV :: new_sbas (23 )
66+ . unwrap (); // GEO #123
67+
68+ assert_eq! (egnos_geo23 . prn, 23 );
69+ assert! (egnos_geo23 . constellation. is_sbas ()); // obviously
70+ assert_eq! (egnos_geo23 . constellation, Constellation :: EGNOS ); // smart builder
71+
72+ let launch_date = egnos_geo23 . launch_date ()
73+ . unwrap (); // only for detailed SBAS
5974
60- let sv = sv! (" S23" );
61- assert_eq! (sv . constellation, Constellation :: EGNOS );
62- let launched_date = Epoch :: from_str (" 2021-11-01T00:00:00 UTC" )
63- . unwrap ();
64- assert_eq! (sv . launched_date (), Some (launched_date ));
75+ assert_eq! (launch_date . year (), 2021 );
76+ assert_eq! (launch_date . month_name (), MonthName :: November );
6577```
6678
6779## Other definitions and features
@@ -98,4 +110,4 @@ Amongst them, be sure to checkout:
98110## License
99111
100112This library is part of the [ NAV-Solutions framework] ( https://github.com/nav-solutions ) which
101- is delivered under the [ Mozilla V2 Public] ( https://www.mozilla.org/en-US/MPL/2.0 ) license.
113+ is licensed under [ Mozilla V2 Public] ( https://www.mozilla.org/en-US/MPL/2.0 ) license.
0 commit comments