Class: When::Ephemeris::Datum

Inherits:
CelestialObject show all
Defined in:
lib/when_exe/ephemeris.rb,
lib/when_exe/region/planets.rb

Overview

座標の基準になる天体

座標の基準になる天体の特性を定義する

Direct Known Subclasses

Big, Far, Near, Earth, Moon, Sun

Defined Under Namespace

Classes: Big, Far, Near

Constant Summary

Constants included from When::Ephemeris

AU, AcS, BCENT, C0, CIRCLE, COS, COSL, COSLT, COST, DAY, DEG, EPOCH1800, EPOCH1900, EPOCH1975, EPOCH2000, FARAWAY, JCENT, JYEAR, Jupiter, LIN, Mars, Mercury, Neptune, P0B, P0L, P0P, P0dB, P0dL, P1B, P1L, P1R, P2B, P2L, P2Q, P2dL, P3L, P3Q, P4B, P4L, P4Q, P4dL, P5B, P5L, P5Q, P5dL, P5l, P5n, P5r, P5t, P6B, P6L, P6Q, P6dL, P6l, P6n, P6r, P6t, P7B, P7L, P7R, P8B, P8L, P8R, P9B, P9L, P9R, PSEC, Pluto, SIN, SINL, SINLT, SINT, Saturn, Uranus, Venus

Constants included from Parts::Resource

Parts::Resource::LabelProperty

Instance Attribute Summary collapse

Attributes inherited from CelestialObject

#aberration, #luminosity

Attributes inherited from BasicTypes::Object

#label

Attributes included from Parts::Resource

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

Instance Method Summary collapse

Methods inherited from CelestialObject

#coords

Methods included from When::Ephemeris

_adjust, _rot, _to_p2, _to_p3, _to_r3, acos, asin, cosc, cosd, delta_e, delta_p, julian_century_from_2000, julian_year_from_1975, obl, polynomial, root, sinc, sind, tanc, tand, trigonometric

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 Attribute Details

#airArray<Numeric> (readonly)

大気の補正

Returns:



991
992
993
# File 'lib/when_exe/ephemeris.rb', line 991

def air
  @air
end

#axisArray<Numeric> (readonly)

自転軸

Returns:



995
996
997
# File 'lib/when_exe/ephemeris.rb', line 995

def axis
  @axis
end

#dlArray<Numeric> (readonly)

黄経の補正の係数

Returns:



947
948
949
# File 'lib/when_exe/ephemeris.rb', line 947

def dl
  @dl
end

#first_dayNumeric (readonly)

計算式の精度保証期間の下限 / ユリウス日

Returns:



935
936
937
# File 'lib/when_exe/ephemeris.rb', line 935

def first_day
  @first_day
end

#jslArray<Numeric> (readonly)

黄経の係数2 (木星-土星)

Returns:



967
968
969
# File 'lib/when_exe/ephemeris.rb', line 967

def jsl
  @jsl
end

#jsnArray<Numeric> (readonly)

黄経の係数1 (木星-土星)

Returns:



963
964
965
# File 'lib/when_exe/ephemeris.rb', line 963

def jsn
  @jsn
end

#jsrArray<Numeric> (readonly)

動径の係数 (木星-土星)

Returns:



975
976
977
# File 'lib/when_exe/ephemeris.rb', line 975

def jsr
  @jsr
end

#jstArray<Numeric> (readonly)

黄緯の係数 (木星-土星)

Returns:



971
972
973
# File 'lib/when_exe/ephemeris.rb', line 971

def jst
  @jst
end

#last_dayNumeric (readonly)

計算式の精度保証期間の上限 / ユリウス日

Returns:



939
940
941
# File 'lib/when_exe/ephemeris.rb', line 939

def last_day
  @last_day
end

#nnArray<Numeric> (readonly)

木星と土星の相互摂動項

Returns:



959
960
961
# File 'lib/when_exe/ephemeris.rb', line 959

def nn
  @nn
end

#phiArray<Numeric> (readonly)

黄経の係数

Returns:



943
944
945
# File 'lib/when_exe/ephemeris.rb', line 943

def phi
  @phi
end

#radiusArray<Numeric> (readonly)

動径の係数

Returns:



955
956
957
# File 'lib/when_exe/ephemeris.rb', line 955

def radius
  @radius
end

#shapeArray<Numeric> (readonly)

惑星の形

Returns:



979
980
981
# File 'lib/when_exe/ephemeris.rb', line 979

def shape
  @shape
end

#sidArray<Numeric> (readonly)

自転 - 平均太陽の赤経(2000年分点)

Returns:



983
984
985
# File 'lib/when_exe/ephemeris.rb', line 983

def sid
  @sid
end

#surface_radiusNumeric (readonly)

半径/km

Returns:



931
932
933
# File 'lib/when_exe/ephemeris.rb', line 931

def surface_radius
  @surface_radius
end

#thetaArray<Numeric> (readonly)

黄緯の係数

Returns:



951
952
953
# File 'lib/when_exe/ephemeris.rb', line 951

def theta
  @theta
end

#zerosHash<String=>Numeric> (readonly)

天体の出没、薄明の閾値

Returns:



987
988
989
# File 'lib/when_exe/ephemeris.rb', line 987

def zeros
  @zeros
end

Instance Method Details

#apparent_luminosity(t, base) ⇒ Numeric

視光度 / magnitude

Parameters:

Returns:



1088
1089
1090
# File 'lib/when_exe/ephemeris.rb', line 1088

def apparent_luminosity(t, base)
  return @luminosity - 2.5*log10(base._coords(t).luminosity_spe(self._coords(t)))
end

#apparent_radius(t, base = Earth) ⇒ Numeric

視半径 / CIRCLE

Parameters:

Returns:



1075
1076
1077
1078
# File 'lib/when_exe/ephemeris.rb', line 1075

def apparent_radius(t, base=Earth)
  target_coords = self.coords(t, base)
  asin(@surface_radius / (target_coords.radius * AU)) / CIRCLE
end

#axis_of_rotation(t) ⇒ When::Ephemeris::Coords

自転軸の歳差補正

Parameters:

Returns:



1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
# File 'lib/when_exe/ephemeris.rb', line 1040

def axis_of_rotation(t)
  return nil unless @axis
  c1900 = (@axis[0]-1900.0)/100.0
  dt    = (+t-(EPOCH1900-0.68648354))/BCENT - c1900
  Coords.polar(
    (@axis[1][0] + dt * @axis[2][0]) / 360,
    (@axis[1][1] + dt * @axis[2][1]) / 360,
    (@axis[1][2] + dt * @axis[2][2]) / 360
  ).precession(dt, c1900)
end

#eclipse(t, target, base = Earth) ⇒ Numeric

食分

Parameters:

Returns:



1119
1120
1121
1122
1123
1124
1125
# File 'lib/when_exe/ephemeris.rb', line 1119

def eclipse(t, target, base=Earth)
  t = +t
  distance      = self.coords(t, base).spherical_law_of_cosines(target.coords(t, base)) / CIRCLE
  self_radius   = self.apparent_radius(t, base)
  target_radius = target.apparent_radius(t, base)
  return (self_radius + target_radius - distance) / (2.0 * target_radius)
end

#elongation(t, target = Sun, base = Earth) ⇒ Numeric

離角 / CIRCLE

Parameters:

Returns:



1101
1102
1103
1104
1105
1106
1107
1108
# File 'lib/when_exe/ephemeris.rb', line 1101

def elongation(t, target=Sun, base=Earth)
  t = +t
  self_coords   = self.coords(t, base)
  target_coords = target.coords(t, base)
  elongation    = acos(self_coords.spherical_law_of_cosines(target_coords)) / CIRCLE
  difference    = (self_coords.phi - target_coords.phi + 0.5) % 1 - 0.5
  return (difference >= 0) ? elongation : -elongation
end

#equation_of_time(t) ⇒ Numeric

均時差 / DAY

Parameters:

Returns:



1058
1059
1060
1061
1062
1063
1064
1065
# File 'lib/when_exe/ephemeris.rb', line 1058

def equation_of_time(t)
  t = +t
  c = julian_century_from_2000(t)
  coords = _coords(t)
  coords = coords.rotate_z(0.5 - (@aberration||0) / coords.radius / 360)
  coords = coords.y_to_r(t, self)
  return 0.5 - ((coords.phi - (@sid[0] + c * (@sid[1] + c * @sid[2])) / 24.0) % 1)
end

#mean_longitude(t) ⇒ Numeric

光行差を含んだ平均黄経 / CIRCLE

Parameters:

Returns:



1014
1015
1016
1017
# File 'lib/when_exe/ephemeris.rb', line 1014

def mean_longitude(t)
  coord = _coords(t)
  coord.c - @aberration / coord.radius / 360
end

#mean_motionNumeric

平均運動 / (DEG / YEAR)

Returns:



1002
1003
1004
# File 'lib/when_exe/ephemeris.rb', line 1002

def mean_motion
  return @phi[0][2]
end

#true_longitude(t) ⇒ Numeric

光行差を含んだ真黄経 / CIRCLE

Parameters:

Returns:



1027
1028
1029
1030
# File 'lib/when_exe/ephemeris.rb', line 1027

def true_longitude(t)
  coord = _coords(t)
  coord.phi - @aberration / coord.radius / 360
end