Class: EphJpl::Binary

Inherits:
Object
  • Object
show all
Defined in:
lib/eph_jpl/binary.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Binary

Returns a new instance of Binary.



3
4
5
6
# File 'lib/eph_jpl/binary.rb', line 3

def initialize(*args)
  @bin_path, @target, @center, @jd = *args
  @pos = 0
end

Instance Method Details

#get_binaryObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/eph_jpl/binary.rb', line 8

def get_binary
  begin
    ttl    = get_ttl            # TTL
    cnams  = get_cnams          # CNAM
    sss    = get_sss            # SS
    ncon   = get_ncon           # NCON
    au     = get_au             # AU
    emrat  = get_emrat          # EMRAT
    ipts   = get_ipts           # IPT
    numde  = get_numde          # NUMDE
    ipts  << get_ipts_13        # IPT(Month's libration)
    cnams += get_cnams_2(ncon)  # CNAM(>400)
    cvals  = get_cvals(ncon)    # CVAL(定数値)
    jdepoc = cvals[4]           # JDEPOC
    coeffs, jds_cheb = get_coeffs(sss, ipts)  # Coefficient, JDs(for Chebyshev polynomial)
    return {
      ttl: ttl, cnams: cnams, sss: sss, ncon: ncon, au: au, emrat: emrat,
      numde: numde, ipts: ipts, cvals: cvals, jdepoc: jdepoc,
      coeffs: coeffs, jds_cheb: jds_cheb
    }
  rescue => e
    raise
  end
end