Class: Atmospheris::Iso5878::TemperatureLayerStructure

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(yaml_rows) ⇒ TemperatureLayerStructure

Returns a new instance of TemperatureLayerStructure.

Parameters:

  • yaml_rows (Array<Hash>)

    breakpoint data from table16/19 YAML Keys: :geopotential_altitude (km), :temperature_K (K)



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

#layersObject (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)

Parameters:

  • rows (Array<Hash>)

Returns:



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_aArray<Hash>

Returns ISA-format layers.

Returns:

  • (Array<Hash>)

    ISA-format layers



188
189
190
# File 'lib/atmospheris/iso5878/atmosphere_profile.rb', line 188

def to_a
  @layers
end