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::ConstList, Parts::Resource::ConstTypes, Parts::Resource::IRIDecode, Parts::Resource::IRIDecodeTable, Parts::Resource::IRIEncode, Parts::Resource::IRIEncodeTable, Parts::Resource::IRIHeader, Parts::Resource::LabelProperty

Constants included from Namespace

Namespace::DC, Namespace::DCQ, Namespace::DCT, Namespace::FOAF, Namespace::OWL, Namespace::RDF, Namespace::RDFC, Namespace::RDFS, Namespace::RSS, Namespace::XSD

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_, _setup_info, 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

#[], #^, _abbreviation_to_iri, _decode, _encode, _extract_prefix, _instance, _instantiate, _parse, _path_with_prefix, _replace_tags, _setup_, _setup_info, _simplify_path, base_uri, #each, #enum_for, #hierarchy, #include?, #included?, #iri, #leaf?, #m17n, #map, #parent, #registered?, root_dir

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)

    当該時刻系の日付



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

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:



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

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:



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

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:



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

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