Class: When::TimeStandard::MartianTimeCoordinated

Inherits:
TimeStandard show all
Defined in:
lib/when_exe/region/martian.rb

Overview

Martian Time, Coordinated

Constant Summary collapse

J2000Jan6 =
2451549.5
Ratio =
1.02749125
MTC0 =
44796.0 - 0.0002 - 0.5

Constants included from When::TimeStandard

DeltaT, DeltaT0, DeltaThreshold, TAI_UTC, YearThreshold

Constants included from Parts::Resource

Parts::Resource::LabelProperty

Instance Attribute Summary

Attributes inherited from BasicTypes::Object

#label

Attributes included from Parts::Resource

#_pool, #child, #keys, #locale, #namespace

Instance Method Summary collapse

Methods inherited from TimeStandard

#from_time_object, #has_leap?, #rate_of_clock, #to_time_object

Methods included from When::TimeStandard

_is_systemtime_universal?, _leap_seconds, _setup_, delta_t, delta_t_coordinated, delta_t_observed, delta_t_observed_nasa, delta_t_observed_poly, from_dynamical_time, from_time_object, to_dynamical_time, to_time_object

Methods included from Parts::Resource

#[], #^, _decode, _encode, _extract_prefix, _instance, _parse, _path_with_prefix, _replace_tags, _setup_, #each, #enum_for, #hierarchy, #include?, #included?, #iri, #leaf?, #m17n, #map, #next, #parent, #prev, #registered?

Methods included from Parts::Resource::Pool

#[], #[]=, #_pool, #_setup_, #pool_keys

Methods included from Parts::Resource::Synchronize

#synchronize

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class When::Parts::Resource

Instance Method Details

#from_dynamical_date(date) ⇒ Numeric

dynamical date を当該時刻系の日付に変換する

Parameters:

  • date (Numeric)

    dynamical date

Returns:

  • (Numeric)

    当該時刻系の日付


75
76
77
# File 'lib/when_exe/region/martian.rb', line 75

def from_dynamical_date(date)
  (date - J2000Jan6) / Ratio + MTC0
end

#from_dynamical_time(time) ⇒ Numeric

dynamical time を universal time に変換する

Parameters:

  • time (Numeric)

    dynamical time

Returns:


97
98
99
100
101
# File 'lib/when_exe/region/martian.rb', line 97

def from_dynamical_time(time)
  When::TM::JulianDate._d_to_t(
    from_dynamical_date(
      When::TM::JulianDate._t_to_d(time)))
end

#to_dynamical_date(date) ⇒ Numeric

当該時刻系の日付を dynamical date に変換する

Parameters:

  • date (Numeric)

    当該時刻系の日付

Returns:


65
66
67
# File 'lib/when_exe/region/martian.rb', line 65

def to_dynamical_date(date)
  (date - MTC0) * Ratio + J2000Jan6
end

#to_dynamical_time(time) ⇒ Numeric

universal time を dynamical time に変換する

Parameters:

  • time (Numeric)

    universal time

Returns:


85
86
87
88
89
# File 'lib/when_exe/region/martian.rb', line 85

def to_dynamical_time(time)
  When::TM::JulianDate._d_to_t(
    to_dynamical_date(
      When::TM::JulianDate._t_to_d(time)))
end