Class: Astronoby::DeepSkyObjectPosition

Inherits:
Object
  • Object
show all
Includes:
Position
Defined in:
lib/astronoby/bodies/deep_sky_object_position.rb

Overview

Represents the computed position of a deep-sky object at a specific instant, providing astrometric, apparent, and topocentric reference frames.

Constant Summary collapse

DEFAULT_DISTANCE =
Distance.from_parsecs(1e9)

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Position

#observed_by

Constructor Details

#initialize(instant:, equatorial_coordinates:, ephem: nil, proper_motion_ra: nil, proper_motion_dec: nil, parallax: nil, radial_velocity: nil, deep_sky_object: nil) ⇒ DeepSkyObjectPosition

Returns a new instance of DeepSkyObjectPosition.

Parameters:



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/astronoby/bodies/deep_sky_object_position.rb', line 31

def initialize(
  instant:,
  equatorial_coordinates:,
  ephem: nil,
  proper_motion_ra: nil,
  proper_motion_dec: nil,
  parallax: nil,
  radial_velocity: nil,
  deep_sky_object: nil
)
  @instant = instant
  @initial_equatorial_coordinates = equatorial_coordinates
  @proper_motion_ra = proper_motion_ra
  @proper_motion_dec = proper_motion_dec
  @parallax = parallax
  @radial_velocity = radial_velocity
  @body = deep_sky_object
  if ephem
    @earth_geometric = Earth.geometric(ephem: ephem, instant: @instant)
  end
  compute_apparent
end

Instance Attribute Details

#apparentAstronoby::Apparent (readonly)

Returns the apparent reference frame.

Returns:



15
16
17
# File 'lib/astronoby/bodies/deep_sky_object_position.rb', line 15

def apparent
  @apparent
end

#bodyAstronoby::DeepSkyObject? (readonly)

Returns the body definition.

Returns:



18
19
20
# File 'lib/astronoby/bodies/deep_sky_object_position.rb', line 18

def body
  @body
end

#instantAstronoby::Instant (readonly)

Returns the time instant.

Returns:



12
13
14
# File 'lib/astronoby/bodies/deep_sky_object_position.rb', line 12

def instant
  @instant
end

Instance Method Details

#astrometricAstronoby::Astrometric

Returns Astrometric position of the object.

Returns:



55
56
57
58
59
60
61
62
63
# File 'lib/astronoby/bodies/deep_sky_object_position.rb', line 55

def astrometric
  @astrometric ||= Astrometric.new(
    instant: @instant,
    position: astrometric_position,
    velocity: astrometric_velocity,
    center: Center.geocentric,
    target_body: body
  )
end