libtad_models/astronomy/astronomy_current.rs
1use super::MoonPhase;
2use crate::time::DateTime;
3use serde::Deserialize;
4
5#[derive(Debug, Deserialize)]
6/// Current information about an astronomical object.
7pub struct AstronomyCurrent {
8 #[serde(deserialize_with = "DateTime::option_deserialize_from_str", default)]
9 /// Local time stamp for the data in ISO 8601 format (including UTC offset).
10 /// Only returned if requested by specifying the parameter isotime.
11 ///
12 /// Example: 2012-04-17T00:57:42+02:00
13 pub isotime: Option<DateTime>,
14
15 #[serde(deserialize_with = "DateTime::option_deserialize_from_str", default)]
16 /// UTC time stamp for the data in ISO 8601 format.
17 /// Only returned if requested by specifying the parameter utctime.
18 pub utctime: Option<DateTime>,
19
20 /// Altitude of the center of the queried astronomical object above an ideal horizon.
21 pub altitude: f64,
22
23 /// Horizontal direction of the astronomical object at set/rise time (referring to true north).
24 /// North is 0 degrees, east is 90 degrees, south is 180 degrees and west is 270 degrees.
25 pub azimuth: f64,
26
27 /// Distance of the earth's center to the center of the queried astronomical object in
28 /// kilometers.
29 pub distance: f64,
30
31 /// The fraction of the Moon's surface illuminated by the Sun's rays as seen from the selected
32 /// location. Only available for the moon object.
33 pub illuminated: Option<f64>,
34
35 /// The counterclockwise angle of the midpoint of the Moon's bright limb as seen from the
36 /// selected location. Only available for the moon object.
37 pub posangle: Option<f64>,
38
39 /// The current phase of the moon. Only available for the moon object.
40 pub moonphase: Option<MoonPhase>,
41}