Module: SeisRuby::Data::Sac::Head::IntegerConverter

Defined in:
lib/seis_ruby/data/sac/head.rb

Constant Summary collapse

UNDEFINED =
-12345

Class Method Summary collapse

Class Method Details

.from_head(n) ⇒ Object



82
83
84
85
86
# File 'lib/seis_ruby/data/sac/head.rb', line 82

def self.from_head(n)
  n_i = n.to_f.round
  return nil if n_i == UNDEFINED
  n_i
end

.to_head(n) ⇒ Object



88
89
90
91
# File 'lib/seis_ruby/data/sac/head.rb', line 88

def self.to_head(n)
  return UNDEFINED if n.nil?
  n.to_f.round
end