Class: Wrnap::Package::FftPopulation
- Defined in:
- lib/wrnap/package/fft_population.rb
Defined Under Namespace
Classes: PopulationProportion
Constant Summary collapse
- THREE_COLUMN_REGEX =
/^([+-]\d+\.\d+\t){2}[+-]\d+\.\d+$/
Instance Attribute Summary collapse
-
#starting_population ⇒ Object
readonly
Returns the value of attribute starting_population.
-
#target_population ⇒ Object
readonly
Returns the value of attribute target_population.
Attributes inherited from Base
#data, #flags, #response, #runtime
Instance Method Summary collapse
Methods inherited from FftEqBase
Methods inherited from Base
bootstrap, #debugger, #initialize, #inspect
Methods included from Global::Yaml
Methods included from Global::Chainer
Methods included from Global::Runner
Constructor Details
This class inherits a constructor from Wrnap::Package::Base
Instance Attribute Details
#starting_population ⇒ Object (readonly)
Returns the value of attribute starting_population.
6 7 8 |
# File 'lib/wrnap/package/fft_population.rb', line 6 def starting_population @starting_population end |
#target_population ⇒ Object (readonly)
Returns the value of attribute target_population.
6 7 8 |
# File 'lib/wrnap/package/fft_population.rb', line 6 def target_population @target_population end |
Instance Method Details
#post_process ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/wrnap/package/fft_population.rb', line 38 def post_process unless response.empty? time_points, target_population, starting_population = response.split(/\n/).select { |line| line =~ THREE_COLUMN_REGEX }.map { |line| line.split(/\t/).map(&:to_f) }.transpose @starting_population = PopulationProportion.new(time_points, starting_population) @target_population = PopulationProportion.new(time_points, target_population) end end |