libtad_models/astronomy/
astronomy_day_event.rs

1use crate::time::DateTime;
2use serde::Deserialize;
3
4#[derive(Debug, Deserialize)]
5/// Information about an astronomical event at a specific day.
6pub struct AstronomyDayEvent {
7    /// Indicates the type of the event.
8    pub r#type: String,
9
10    /// Hour at which the event is happening (local time).
11    pub hour: i32,
12
13    /// Minute at which the event is happening (local time).
14    pub min: i32,
15
16    /// Second at which the event is happening (local time).
17    pub sec: i32,
18
19    #[serde(deserialize_with = "DateTime::option_deserialize_from_str", default)]
20    /// Local time at which the event is happening in ISO 8601 format.
21    /// Only returned if requested by specifying the parameter isotime.
22    pub isotime: Option<DateTime>,
23
24    #[serde(deserialize_with = "DateTime::option_deserialize_from_str", default)]
25    /// UTC time at which the event is happening in ISO 8601 format.
26    /// Only returned if requested by specifying the parameter utctime.
27    pub utctime: Option<DateTime>,
28
29    /// Altitude of the center of the queried astronomical object above an ideal horizon.
30    /// Only for meridian type events.
31    pub altitude: Option<f32>,
32
33    /// Horizontal direction of the astronomical object at set/rise time (referring to true north).
34    /// North is 0 degrees, east is 90 degrees, south is 180 degrees and west is 270 degrees.
35    /// Only for rise ans set type events.
36    pub azimuth: Option<f32>,
37
38    /// Distance of the earth's center to the center of the queried astronomical object in
39    /// kilometers. Only for meridian type events.
40    pub distance: Option<f32>,
41
42    /// The fractin of the Moon's surface illuminated by the Sun's rays as seen from the selected
43    /// location. Only for the moon for meridian type events.
44    pub illuminated: Option<f32>,
45
46    /// The counterclockwise angle of the midpoint of the Moon's bright limb as seen from the
47    /// selected location. Only for the moon for meridian type events.
48    pub posangle: Option<f32>,
49}