Class: Atmospheris::Iso5878::TemperatureLayerStructure
- Inherits:
-
Object
- Object
- Atmospheris::Iso5878::TemperatureLayerStructure
- Defined in:
- lib/atmospheris/iso5878/atmosphere_profile.rb
Overview
Converts YAML breakpoint data (Table 16 / Table 19 format) into the ISA-compatible layer format used by AtmosphereProfile.
Input format (YAML rows):
[{ geopotential_altitude: 0.0, temperature_K: 299.65 },
{ geopotential_altitude: 2.25, temperature_K: 286.15 },
...]
Output format (ISA layers):
[{ H: 0.0, T: 299.65, B: -0.006 },
{ H: 2250.0, T: 286.15, B: 0.0032 },
...]
Gradients (B) are computed from consecutive temperature/altitude pairs rather than read from the YAML gradient column, ensuring consistency with the specified temperature breakpoints.
Instance Attribute Summary collapse
-
#layers ⇒ Object
readonly
Returns the value of attribute layers.
Class Method Summary collapse
-
.from_yaml_rows(rows) ⇒ TemperatureLayerStructure
Construct from a YAML row subset (e.g., yaml_data).
Instance Method Summary collapse
-
#initialize(yaml_rows) ⇒ TemperatureLayerStructure
constructor
A new instance of TemperatureLayerStructure.
-
#to_a ⇒ Array<Hash>
ISA-format layers.
Constructor Details
#initialize(yaml_rows) ⇒ TemperatureLayerStructure
Returns a new instance of TemperatureLayerStructure.
176 177 178 |
# File 'lib/atmospheris/iso5878/atmosphere_profile.rb', line 176 def initialize(yaml_rows) @layers = build_layers(yaml_rows) end |
Instance Attribute Details
#layers ⇒ Object (readonly)
Returns the value of attribute layers.
172 173 174 |
# File 'lib/atmospheris/iso5878/atmosphere_profile.rb', line 172 def layers @layers end |
Class Method Details
.from_yaml_rows(rows) ⇒ TemperatureLayerStructure
Construct from a YAML row subset (e.g., yaml_data)
183 184 185 |
# File 'lib/atmospheris/iso5878/atmosphere_profile.rb', line 183 def self.from_yaml_rows(rows) new(rows) end |
Instance Method Details
#to_a ⇒ Array<Hash>
Returns ISA-format layers.
188 189 190 |
# File 'lib/atmospheris/iso5878/atmosphere_profile.rb', line 188 def to_a @layers end |