-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathlib.rs
95 lines (81 loc) · 3.79 KB
/
lib.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]
/*
* Hifitime
* Copyright (C) 2017-onward Christopher Rabotin <[email protected]> et al. (cf. https://github.com/nyx-space/hifitime/graphs/contributors)
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* Documentation: https://nyxspace.com/
*/
/// Julian date for the J1900 epoch, as per NAIF SPICE.
pub const JD_J1900: f64 = 2_415_020.0;
/// Julian date for the J2000 epoch, as per NAIF SPICE.
pub const JD_J2000: f64 = 2_451_545.0;
/// Julian days between 01 Jan 1900 at midnight and the Modified Julian Day at 17 November 1858.
pub const MJD_J1900: f64 = 15_020.0;
/// Julian days between 01 Jan 2000 at **noon** and the Modified Julian Day at 17 November 1858.
pub const MJD_J2000: f64 = 51_544.5;
/// The Ephemeris Time epoch, in seconds
pub const ET_EPOCH_S: i64 = 3_155_716_800;
/// Modified Julian Date in seconds as defined [here](http://tycho.usno.navy.mil/mjd.html). MJD epoch is Modified Julian Day at 17 November 1858 at midnight.
pub const MJD_OFFSET: f64 = 2_400_000.5;
/// `DAYS_PER_YEAR` corresponds to the number of days per year in the Julian calendar.
pub const DAYS_PER_YEAR: f64 = 365.25;
/// `DAYS_PER_YEAR_NLD` corresponds to the number of days per year **without leap days**.
pub const DAYS_PER_YEAR_NLD: f64 = 365.0;
/// `DAYS_PER_CENTURY` corresponds to the number of days per century in the Julian calendar.
pub const DAYS_PER_CENTURY: f64 = 36525.0;
pub const DAYS_PER_CENTURY_I64: i64 = 36525;
pub const DAYS_PER_WEEK: f64 = 7.0;
pub const DAYS_PER_WEEK_I64: i64 = 7;
/// `SECONDS_PER_MINUTE` defines the number of seconds per minute.
pub const SECONDS_PER_MINUTE: f64 = 60.0;
/// `SECONDS_PER_HOUR` defines the number of seconds per hour.
pub const SECONDS_PER_HOUR: f64 = 3_600.0;
/// `SECONDS_PER_DAY` defines the number of seconds per day.
pub const SECONDS_PER_DAY: f64 = 86_400.0;
pub const SECONDS_PER_DAY_I64: i64 = 86_400;
/// `SECONDS_PER_CENTURY` defines the number of seconds per century.
pub const SECONDS_PER_CENTURY: f64 = SECONDS_PER_DAY * DAYS_PER_CENTURY;
/// `SECONDS_PER_YEAR` corresponds to the number of seconds per julian year from [NAIF SPICE](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/jyear_c.html).
pub const SECONDS_PER_YEAR: f64 = 31_557_600.0;
pub const SECONDS_PER_YEAR_I64: i64 = 31_557_600;
/// `SECONDS_PER_TROPICAL_YEAR` corresponds to the number of seconds per tropical year from [NAIF SPICE](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/tyear_c.html).
pub const SECONDS_PER_TROPICAL_YEAR: f64 = 31_556_925.974_7;
/// `SECONDS_PER_SIDEREAL_YEAR` corresponds to the number of seconds per sidereal year from [NIST](https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors/nist-guide-si-appendix-b9#TIME).
pub const SECONDS_PER_SIDEREAL_YEAR: f64 = 31_558_150.0;
// Epoch formatting module is called `efmt` to avoid collision with `std::fmt` and `core::fmt`.
pub mod efmt;
mod parser;
pub mod errors;
pub use errors::{DurationError, HifitimeError, ParsingError};
mod epoch;
pub use epoch::*;
mod duration;
pub use duration::*;
mod timescale;
pub use timescale::*;
mod timeunits;
pub use timeunits::*;
mod timeseries;
pub use timeseries::*;
mod weekday;
pub use weekday::*;
mod month;
pub use month::*;
pub mod prelude {
pub use crate::efmt::{Format, Formatter};
pub use crate::{
Duration, DurationError, Epoch, Freq, Frequencies, HifitimeError, ParsingError, TimeScale,
TimeSeries, TimeUnits, Unit, Weekday,
};
}
#[cfg(kani)]
mod kani_verif;
#[cfg(feature = "python")]
pub mod python;
#[cfg(feature = "std")]
extern crate core;