Module: SeisRuby::Data::Sac::Head::FloatConverter

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

Overview

Float

Constant Summary collapse

UNDEFINED =
-12345.0

Class Method Summary collapse

Class Method Details

.from_head(x) ⇒ Object



67
68
69
70
71
# File 'lib/seis_ruby/data/sac/head.rb', line 67

def self.from_head(x)
  x_f = x.to_f
  return nil if x_f == UNDEFINED
  x_f
end

.to_head(x) ⇒ Object



73
74
75
76
# File 'lib/seis_ruby/data/sac/head.rb', line 73

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