class Steps

Attributes

k1s[R]

Public Class Methods

new(ps, ss) click to toggle source
# File lib/topas-tools/Metarefine.rb, line 2
def initialize ps, ss
  ss.empty? &&  raise("Empty steps!")
  (ps.size == (ss.size + 1) ) || raise("Inconsistent points and steps: #{ps}, #{ss}")   
  @k1s = get_k1s ps, ss
end

Public Instance Methods

get_k1s(points, stepsizes) click to toggle source
# File lib/topas-tools/Metarefine.rb, line 8
def get_k1s points, stepsizes 
  stepsizes.reduce([]){|result, stepsize| 
    a = result + 
        points[0].step(points[1] ,-stepsize.to_f).to_a + 
        [points[1].to_f]
    points.shift
    a}.uniq
end