Class: Atmospheric::Export::Iso25332025::HypsometricalMbar
- Inherits:
-
HypsometricalTable
- Object
- Lutaml::Model::Serializable
- HypsometricalTable
- Atmospheric::Export::Iso25332025::HypsometricalMbar
- Defined in:
- lib/atmospheric/export/iso_25332025.rb
Instance Method Summary collapse
-
#steps ⇒ Object
TODO: when Ruby’s step does not create inaccurate floating point numbers This is a hack to solve a Ruby bug with floating point calcuations > (20.0..1770.9).step(0.1).to_a …
- #steps_unit ⇒ Object
Methods inherited from HypsometricalTable
Instance Method Details
#steps ⇒ Object
TODO: when Ruby’s step does not create inaccurate floating point numbers This is a hack to solve a Ruby bug with floating point calcuations > (20.0..1770.9).step(0.1).to_a
...
1769.4,
1769.5,
1769.6000000000001, # <== we need to clean these
1769.7,
1769.8000000000002, # <== we need to clean these
The last ‘map` should be removed if this bug is fixed
50 51 52 53 54 55 |
# File 'lib/atmospheric/export/iso_25332025.rb', line 50 def steps ( (5.0..19.99).step(0.01).to_a.map { |v| v.round(2) } + (20.0..1770.9).step(0.1).to_a.map { |v| v.round(1) } ) end |
#steps_unit ⇒ Object
57 58 59 |
# File 'lib/atmospheric/export/iso_25332025.rb', line 57 def steps_unit :mbar end |