Skip to content

Commit

Permalink
adding tpdate and mjd
Browse files Browse the repository at this point in the history
  • Loading branch information
xanthospap committed Jul 19, 2024
1 parent 444fd10 commit d88d32c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/tpdate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,20 @@ class TwoPartDate {
constexpr explicit TwoPartDate(modified_julian_day mjd) noexcept
: _mjd(mjd.as_underlying_type()), _fsec(0){};

constexpr explicit TwoPartDate(year y, month m, day_of_month d,
double sec_of_day=0e0)
: _mjd(modified_julian_day(y, m, d).as_underlying_type()),
_fsec(sec_of_day) {
this->normalize();
}

constexpr explicit TwoPartDate(year y, day_of_year d,
double sec_of_day=0e0)
: _mjd(modified_julian_day(y, d).as_underlying_type()),
_fsec(sec_of_day) {
this->normalize();
}

/** Get the MJD as an intgral number, i.e. no fractional part */
int imjd() const noexcept { return _mjd; }

Expand Down

0 comments on commit d88d32c

Please sign in to comment.