atmospheris 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE.txt +25 -0
- data/README.adoc +1254 -0
- data/lib/atmospheris/export/altitude_attrs.rb +296 -0
- data/lib/atmospheris/export/altitude_convertable_model.rb +80 -0
- data/lib/atmospheris/export/altitude_table.rb +49 -0
- data/lib/atmospheris/export/hypsometrical_table.rb +36 -0
- data/lib/atmospheris/export/iso_25331975/group_one.rb +21 -0
- data/lib/atmospheris/export/iso_25331975/group_one_attrs.rb +101 -0
- data/lib/atmospheris/export/iso_25331975/group_three.rb +21 -0
- data/lib/atmospheris/export/iso_25331975/group_three_attrs.rb +101 -0
- data/lib/atmospheris/export/iso_25331975/group_two.rb +21 -0
- data/lib/atmospheris/export/iso_25331975/group_two_attrs.rb +113 -0
- data/lib/atmospheris/export/iso_25331975.rb +28 -0
- data/lib/atmospheris/export/iso_25331985/pressure_attrs.rb +16 -0
- data/lib/atmospheris/export/iso_25331985/table_five_six_attrs.rb +16 -0
- data/lib/atmospheris/export/iso_25331985.rb +113 -0
- data/lib/atmospheris/export/iso_25331997.rb +86 -0
- data/lib/atmospheris/export/iso_25332025/altitude_attrs_group.rb +25 -0
- data/lib/atmospheris/export/iso_25332025/combined_altitude_attrs_group.rb +41 -0
- data/lib/atmospheris/export/iso_25332025.rb +81 -0
- data/lib/atmospheris/export/precision_value.rb +9 -0
- data/lib/atmospheris/export/pressure_attrs.rb +87 -0
- data/lib/atmospheris/export/utils.rb +30 -0
- data/lib/atmospheris/export.rb +17 -0
- data/lib/atmospheris/isa.rb +493 -0
- data/lib/atmospheris/namespace.rb +8 -0
- data/lib/atmospheris/unit_value_float.rb +23 -0
- data/lib/atmospheris/unit_value_integer.rb +23 -0
- data/lib/atmospheris/version.rb +5 -0
- data/lib/atmospheris.rb +14 -0
- metadata +117 -0
data/README.adoc
ADDED
|
@@ -0,0 +1,1254 @@
|
|
|
1
|
+
= Atmospheris for Ruby (ISO Standard Atmosphere / ICAO Standard Atmosphere (ISA))
|
|
2
|
+
|
|
3
|
+
== Purpose
|
|
4
|
+
|
|
5
|
+
This repository provides Ruby code for calculating values defined in the
|
|
6
|
+
following standards:
|
|
7
|
+
|
|
8
|
+
* International Standard Atmosphere (ISA) from ISO 2533:1975,
|
|
9
|
+
ISO 2533:1975/ADD 1:1985 and ISO 2533:1975/ADD 2:1997
|
|
10
|
+
* https://store.icao.int/en/manual-of-the-icao-standard-atmosphere-extended-to-80-kilometres-262500-feet-doc-7488[ICAO Standard Atmosphere (ICAO Doc 7488/3, 1994)]
|
|
11
|
+
|
|
12
|
+
Which are technically identical standards but different in presentation and
|
|
13
|
+
units (the ICAO document includes `ft` in addition to `m`).
|
|
14
|
+
|
|
15
|
+
This library serves as a reference implementation for the values defined in
|
|
16
|
+
ISO CD 2533:2025.
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
== Usage
|
|
20
|
+
|
|
21
|
+
=== General
|
|
22
|
+
|
|
23
|
+
This library contains code for two separate, but related, purposes.
|
|
24
|
+
|
|
25
|
+
* Calculating atmospheric properties at different altitudes. The algorithms
|
|
26
|
+
are based on ISO 2533.
|
|
27
|
+
|
|
28
|
+
* Generating tables of atmospheric properties at different altitudes. This library
|
|
29
|
+
is used to data tables provided by the full ISO 2533 series:
|
|
30
|
+
|
|
31
|
+
** ISO 2533:1975
|
|
32
|
+
** ISO 2533:1975/ADD 1:1985
|
|
33
|
+
** ISO 2533:1975/ADD 2:1997
|
|
34
|
+
** ISO CD 2533:2025
|
|
35
|
+
|
|
36
|
+
For the typical user who wishes to calculate atmospheric properties, there
|
|
37
|
+
is no need to worry about how the tables work.
|
|
38
|
+
|
|
39
|
+
To calculate atmospheric properties, either use the formulas directly or use the
|
|
40
|
+
`Atmospheris::Export::AltitudeAttrs` class to bulk obtain the values needed.
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
=== Prerequisites
|
|
44
|
+
|
|
45
|
+
Include the `atmospheris` gem in your Gemfile:
|
|
46
|
+
|
|
47
|
+
[source,ruby]
|
|
48
|
+
----
|
|
49
|
+
gem 'atmospheris'
|
|
50
|
+
----
|
|
51
|
+
|
|
52
|
+
Then use `require` in code:
|
|
53
|
+
|
|
54
|
+
[source,ruby]
|
|
55
|
+
----
|
|
56
|
+
require 'atmospheris'
|
|
57
|
+
----
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
=== Atmospheric attributes by altitude
|
|
61
|
+
|
|
62
|
+
The `Atmospheris::Export::AltitudeAttrs` class provides a way to obtain the
|
|
63
|
+
atmospheric properties at a particular given altitude, geopotential or
|
|
64
|
+
geometric.
|
|
65
|
+
|
|
66
|
+
The resulting object can also be easily serialized, courtesy of the
|
|
67
|
+
https://github.com/lutaml/lutaml-model[`lutaml-model`] library.
|
|
68
|
+
|
|
69
|
+
Syntax:
|
|
70
|
+
|
|
71
|
+
[source,ruby]
|
|
72
|
+
----
|
|
73
|
+
require 'atmospheris'
|
|
74
|
+
|
|
75
|
+
Atmospheris::Export::AltitudeAttrs.new.set_altitude(
|
|
76
|
+
value: {altitude-value} <1>
|
|
77
|
+
type: {altitude-type} <2>
|
|
78
|
+
unit: {altitude-unit} <3>,
|
|
79
|
+
precision: {precision-mode} <4>
|
|
80
|
+
)
|
|
81
|
+
----
|
|
82
|
+
<1> Value of the altitude desired. Integer.
|
|
83
|
+
<2> Type of altitude. Symbol. One of `:geometric`, `:geopotential`.
|
|
84
|
+
<3> Unit of the altitude. Symbol. One of `:meters`, `:feet`.
|
|
85
|
+
<4> Precision mode. Symbol. One of `:normal`, `:high`, `:reduced`. Default is `:normal`.
|
|
86
|
+
|
|
87
|
+
Each attribute of the `AltitudeAttrs` object is wrapped in a defined
|
|
88
|
+
data class which is associated with a https://www.unitsml.org/[UnitsML] unit.
|
|
89
|
+
|
|
90
|
+
Behavior of the precision mode:
|
|
91
|
+
|
|
92
|
+
`:reduced`:: (default) Uses Isa::NormalPrecision for calculations with signficant digits
|
|
93
|
+
rounding according to the original ISO 2533 specification.
|
|
94
|
+
|
|
95
|
+
`:normal`:: Uses Isa::NormalPrecision for calculations without value modification.
|
|
96
|
+
|
|
97
|
+
`:high`:: Uses Isa::HighPrecision for calculations without value modifications. This mode uses BigDecimal.
|
|
98
|
+
|
|
99
|
+
Depending on the type of the value, it is in one of the following classes:
|
|
100
|
+
|
|
101
|
+
* Integer. Class: `UnitValueInteger`
|
|
102
|
+
* Float. Class: `UnitValueFloat`
|
|
103
|
+
|
|
104
|
+
The `AltitudeAttrs` object provides the following attributes:
|
|
105
|
+
|
|
106
|
+
All attributes are represented as collections (arrays) to support multiple units:
|
|
107
|
+
|
|
108
|
+
`geometric_altitudes`:: Array of geometric altitude values. Units: m, ft.
|
|
109
|
+
`geopotential_altitudes`:: Array of geopotential altitude values. Units: m, ft.
|
|
110
|
+
`temperatures`:: Array of temperature values. Units: K, degC.
|
|
111
|
+
`pressures`:: Array of pressure values. Units: mbar, mm_Hg.
|
|
112
|
+
`densities`:: Array of density values. Units: kg*m^-3.
|
|
113
|
+
`accelerations`:: Array of acceleration values. Units: m*s^-2.
|
|
114
|
+
`ppns`:: Array of pressure ratio values (unitless).
|
|
115
|
+
`rhorhons`:: Array of density ratio values (unitless).
|
|
116
|
+
`sqrt_rhorhons`:: Array of sqrt of density ratio values (unitless).
|
|
117
|
+
`speeds_of_sound`:: Array of speed of sound values. Units: m*s^-1.
|
|
118
|
+
`dynamic_viscosities`:: Array of dynamic viscosity values. Units: Pa*s.
|
|
119
|
+
`kinematic_viscosities`:: Array of kinematic viscosity values. Units: m^2*s^-1.
|
|
120
|
+
`thermal_conductivities`:: Array of thermal conductivity values. Units: W*m^-1*K^-1.
|
|
121
|
+
`pressure_scale_heights`:: Array of pressure scale height values. Units: m.
|
|
122
|
+
`specific_weights`:: Array of specific weight values. Units: N*m^-3.
|
|
123
|
+
`air_number_densities`:: Array of air number density values. Units: m^-3.
|
|
124
|
+
`mean_speeds`:: Array of mean speed values. Units: m*s^-1.
|
|
125
|
+
`frequencies`:: Array of frequency values. Units: s^-1.
|
|
126
|
+
`mean_free_paths`:: Array of mean free path values. Units: m.
|
|
127
|
+
|
|
128
|
+
Each attribute value is wrapped in `UnitValueFloat` or `UnitValueInteger` with UnitsML unit metadata.
|
|
129
|
+
|
|
130
|
+
[example]
|
|
131
|
+
====
|
|
132
|
+
[source,ruby]
|
|
133
|
+
----
|
|
134
|
+
require 'atmospheris'
|
|
135
|
+
attrs = Atmospheris::Export::AltitudeAttrs.new.set_altitude(
|
|
136
|
+
value: -2000,
|
|
137
|
+
type: :geopotential,
|
|
138
|
+
unit: :meters
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
# Access collection values
|
|
142
|
+
attrs.geometric_altitudes[0].value #=> -1999 (meters)
|
|
143
|
+
attrs.geometric_altitudes[1].value #=> -6560 (feet)
|
|
144
|
+
attrs.geopotential_altitudes[0].value #=> -2000 (meters)
|
|
145
|
+
attrs.geopotential_altitudes[1].value #=> -6562 (feet)
|
|
146
|
+
attrs.temperatures[0].value #=> 301.15 (Kelvin)
|
|
147
|
+
attrs.temperatures[1].value #=> 28.0 (Celsius)
|
|
148
|
+
attrs.pressures[0].value #=> 1277.74 (mbar)
|
|
149
|
+
attrs.pressures[1].value #=> 958.382 (mm_Hg)
|
|
150
|
+
----
|
|
151
|
+
====
|
|
152
|
+
|
|
153
|
+
The object can be serialized into YAML or XML.
|
|
154
|
+
|
|
155
|
+
.AltitudeAttrs in YAML
|
|
156
|
+
[example]
|
|
157
|
+
====
|
|
158
|
+
[source,ruby]
|
|
159
|
+
----
|
|
160
|
+
attrs = Atmospheris::Export::AltitudeAttrs.new.set_altitude(
|
|
161
|
+
value: -2000,
|
|
162
|
+
type: :geopotential,
|
|
163
|
+
unit: :meters
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
attrs.to_yaml
|
|
167
|
+
----
|
|
168
|
+
|
|
169
|
+
[source,yaml]
|
|
170
|
+
----
|
|
171
|
+
geometric-altitude:
|
|
172
|
+
- value: -1999
|
|
173
|
+
unitsml: m
|
|
174
|
+
type: integer
|
|
175
|
+
- value: -6560
|
|
176
|
+
unitsml: ft
|
|
177
|
+
type: integer
|
|
178
|
+
geopotential-altitude:
|
|
179
|
+
- value: -2000
|
|
180
|
+
unitsml: m
|
|
181
|
+
type: integer
|
|
182
|
+
- value: -6562
|
|
183
|
+
unitsml: ft
|
|
184
|
+
type: integer
|
|
185
|
+
temperature:
|
|
186
|
+
- value: 301.15
|
|
187
|
+
unitsml: K
|
|
188
|
+
type: float
|
|
189
|
+
- value: 28.0
|
|
190
|
+
unitsml: degC
|
|
191
|
+
type: float
|
|
192
|
+
pressure:
|
|
193
|
+
- value: 1277.74
|
|
194
|
+
unitsml: mbar
|
|
195
|
+
type: float
|
|
196
|
+
- value: 958.382
|
|
197
|
+
unitsml: mm_Hg
|
|
198
|
+
type: float
|
|
199
|
+
density:
|
|
200
|
+
- value: 1.47808
|
|
201
|
+
unitsml: kg*m^-3
|
|
202
|
+
type: float
|
|
203
|
+
acceleration:
|
|
204
|
+
- value: 9.8128
|
|
205
|
+
unitsml: m*s^-2
|
|
206
|
+
type: float
|
|
207
|
+
ppn:
|
|
208
|
+
- value: 1.26103
|
|
209
|
+
type: float
|
|
210
|
+
rhorhon:
|
|
211
|
+
- value: 1.20659
|
|
212
|
+
type: float
|
|
213
|
+
sqrt-rhorhon:
|
|
214
|
+
- value: 1.09845
|
|
215
|
+
type: float
|
|
216
|
+
speed-of-sound:
|
|
217
|
+
- value: 347.886
|
|
218
|
+
unitsml: m*s^-1
|
|
219
|
+
type: float
|
|
220
|
+
dynamic-viscosity:
|
|
221
|
+
- value: 1.8514e-05
|
|
222
|
+
unitsml: Pa*s
|
|
223
|
+
type: float
|
|
224
|
+
kinematic-viscosity:
|
|
225
|
+
- value: 1.2526e-05
|
|
226
|
+
unitsml: m^2*s^-1
|
|
227
|
+
type: float
|
|
228
|
+
thermal-conductivity:
|
|
229
|
+
- value: 0.026359
|
|
230
|
+
unitsml: W*m^-1*K^-1
|
|
231
|
+
type: float
|
|
232
|
+
pressure-scale-height:
|
|
233
|
+
- value: 8809.5
|
|
234
|
+
unitsml: m
|
|
235
|
+
type: float
|
|
236
|
+
specific-weight:
|
|
237
|
+
- value: 14.504
|
|
238
|
+
unitsml: N*m^-3
|
|
239
|
+
type: float
|
|
240
|
+
air-number-density:
|
|
241
|
+
- value: 3.0734e+25
|
|
242
|
+
unitsml: m^-3
|
|
243
|
+
type: float
|
|
244
|
+
mean-speed:
|
|
245
|
+
- value: 469.18
|
|
246
|
+
unitsml: m*s^-1
|
|
247
|
+
type: float
|
|
248
|
+
frequency:
|
|
249
|
+
- value: 8535100000.0
|
|
250
|
+
unitsml: s^-1
|
|
251
|
+
type: float
|
|
252
|
+
mean-free-path:
|
|
253
|
+
- value: 5.4971e-08
|
|
254
|
+
unitsml: m
|
|
255
|
+
type: float
|
|
256
|
+
precision: reduced
|
|
257
|
+
----
|
|
258
|
+
====
|
|
259
|
+
|
|
260
|
+
.AltitudeAttrs in XML
|
|
261
|
+
[example]
|
|
262
|
+
====
|
|
263
|
+
[source,ruby]
|
|
264
|
+
----
|
|
265
|
+
attrs = Atmospheris::Export::AltitudeAttrs.new.set_altitude(
|
|
266
|
+
value: -2000,
|
|
267
|
+
type: :geopotential,
|
|
268
|
+
unit: :meters,
|
|
269
|
+
precision: :normal
|
|
270
|
+
)
|
|
271
|
+
|
|
272
|
+
attrs.to_xml
|
|
273
|
+
----
|
|
274
|
+
|
|
275
|
+
[source,xml]
|
|
276
|
+
----
|
|
277
|
+
<atmosphere-attributes xmlns="urn:iso:std:iso:2533:tech:xsd">
|
|
278
|
+
<geometric-altitude unitsml="m" type="integer">-1999</geometric-altitude>
|
|
279
|
+
<geometric-altitude unitsml="ft" type="integer">-6560</geometric-altitude>
|
|
280
|
+
<geopotential-altitude unitsml="m" type="integer">-2000</geopotential-altitude>
|
|
281
|
+
<geopotential-altitude unitsml="ft" type="integer">-6562</geopotential-altitude>
|
|
282
|
+
<temperature unitsml="K" type="float">301.15</temperature>
|
|
283
|
+
<temperature unitsml="degC" type="float">28.0</temperature>
|
|
284
|
+
<pressure unitsml="mbar" type="float">1277.74</pressure>
|
|
285
|
+
<pressure unitsml="mm_Hg" type="float">958.38</pressure>
|
|
286
|
+
<density unitsml="kg*m^-3" type="float">1.47808</density>
|
|
287
|
+
<acceleration unitsml="m*s^-2" type="float">9.81282</acceleration>
|
|
288
|
+
<ppn type="float">1.26103</ppn>
|
|
289
|
+
<rhorhon type="float">1.20659</rhorhon>
|
|
290
|
+
<sqrt-rhorhon type="float">1.09845</sqrt-rhorhon>
|
|
291
|
+
<speed-of-sound unitsml="m*s^-1" type="float">347.886</speed-of-sound>
|
|
292
|
+
<dynamic-viscosity unitsml="Pa*s" type="float">1.8514e-05</dynamic-viscosity>
|
|
293
|
+
<kinematic-viscosity unitsml="m^2*s^-1" type="float">1.2526e-05</kinematic-viscosity>
|
|
294
|
+
<thermal-conductivity unitsml="W*m^-1*K^-1" type="float">0.026359</thermal-conductivity>
|
|
295
|
+
<pressure-scale-height unitsml="m" type="float">8809.5</pressure-scale-height>
|
|
296
|
+
<specific-weight unitsml="N*m^-3" type="float">14.504</specific-weight>
|
|
297
|
+
<air-number-density unitsml="m^-3" type="float">3.0734e+25</air-number-density>
|
|
298
|
+
<mean-speed unitsml="m*s^-1" type="float">469.18</mean-speed>
|
|
299
|
+
<frequency unitsml="s^-1" type="float">8535100000.0</frequency>
|
|
300
|
+
<mean-free-path unitsml="m" type="float">5.4971e-08</mean-free-path>
|
|
301
|
+
<precision>normal</precision>
|
|
302
|
+
</atmosphere-attributes>
|
|
303
|
+
----
|
|
304
|
+
====
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
=== Altitude by pressure
|
|
308
|
+
|
|
309
|
+
The `Atmospheris::Export::PressureAttrs` class provides a way to obtain the
|
|
310
|
+
altitude at a given pressure value (mbar, mmhg).
|
|
311
|
+
|
|
312
|
+
Syntax:
|
|
313
|
+
|
|
314
|
+
[source,ruby]
|
|
315
|
+
----
|
|
316
|
+
require 'atmospheris'
|
|
317
|
+
|
|
318
|
+
Atmospheris::Export::PressureAttrs.new.set_pressure(
|
|
319
|
+
value: {pressure-value}, <1>
|
|
320
|
+
unit: {pressure-unit}, <2>
|
|
321
|
+
precision: {precision-mode} <3>
|
|
322
|
+
)
|
|
323
|
+
----
|
|
324
|
+
<1> Value of the pressure desired. Float.
|
|
325
|
+
<2> Unit of the pressure. Symbol. One of `:mbar`, `:mmhg`.
|
|
326
|
+
|
|
327
|
+
NOTE: The `set_pressure` method does not yet support high-precision mode.
|
|
328
|
+
|
|
329
|
+
Behavior of the precision mode:
|
|
330
|
+
|
|
331
|
+
`:reduced`:: (default) Uses Isa::NormalPrecision for calculations with signficant digits
|
|
332
|
+
rounding according to the original ISO 2533/ADD 2 specification.
|
|
333
|
+
|
|
334
|
+
`:normal`:: Uses Isa::NormalPrecision for calculations without value modification.
|
|
335
|
+
|
|
336
|
+
`:high`:: Uses Isa::HighPrecision for calculations without value modifications. This mode uses BigDecimal.
|
|
337
|
+
|
|
338
|
+
Each attribute of the `PressureAttrs` object is wrapped in a defined
|
|
339
|
+
data class which is associated with a https://www.unitsml.org/[UnitsML] unit.
|
|
340
|
+
|
|
341
|
+
Depending on the type of the value, it is in one of the following classes:
|
|
342
|
+
|
|
343
|
+
* Integer. Class: `UnitValueInteger`
|
|
344
|
+
* Float. Class: `UnitValueFloat`
|
|
345
|
+
|
|
346
|
+
The `PressureAttrs` object provides the following attributes:
|
|
347
|
+
|
|
348
|
+
All attributes are represented as collections (arrays) to support multiple units:
|
|
349
|
+
|
|
350
|
+
`pressures`:: Array of pressure values. Units: mbar, mm_Hg.
|
|
351
|
+
`geometric_altitudes`:: Array of geometric altitude values. Units: m, ft.
|
|
352
|
+
`geopotential_altitudes`:: Array of geopotential altitude values. Units: m, ft.
|
|
353
|
+
|
|
354
|
+
[example]
|
|
355
|
+
====
|
|
356
|
+
[source,ruby]
|
|
357
|
+
----
|
|
358
|
+
attrs = Atmospheris::Export::PressureAttrs.new.set_pressure(
|
|
359
|
+
value: 5.0,
|
|
360
|
+
unit: :mbar
|
|
361
|
+
)
|
|
362
|
+
|
|
363
|
+
# Access collection values
|
|
364
|
+
attrs.pressures[0].value #=> 5.0 (mbar)
|
|
365
|
+
attrs.pressures[1].value #=> 3.7503084135 (mm_Hg)
|
|
366
|
+
attrs.geopotential_altitudes[0].value #=> 35776.5 (meters)
|
|
367
|
+
attrs.geopotential_altitudes[1].value #=> 117377.0 (feet)
|
|
368
|
+
attrs.geometric_altitudes[0].value #=> 35979.0 (meters)
|
|
369
|
+
attrs.geometric_altitudes[1].value #=> 118041.0 (feet)
|
|
370
|
+
----
|
|
371
|
+
====
|
|
372
|
+
|
|
373
|
+
The object can be serialized into YAML or XML.
|
|
374
|
+
|
|
375
|
+
.PressureAttrs in YAML
|
|
376
|
+
[example]
|
|
377
|
+
====
|
|
378
|
+
[source,ruby]
|
|
379
|
+
----
|
|
380
|
+
attrs = Atmospheris::Export::PressureAttrs.new.set_pressure(
|
|
381
|
+
value: 5.0,
|
|
382
|
+
unit: :mbar
|
|
383
|
+
)
|
|
384
|
+
|
|
385
|
+
attrs.to_yaml
|
|
386
|
+
----
|
|
387
|
+
|
|
388
|
+
[source,yaml]
|
|
389
|
+
----
|
|
390
|
+
pressure:
|
|
391
|
+
- value: 5.0
|
|
392
|
+
unitsml: mbar
|
|
393
|
+
type: float
|
|
394
|
+
- value: 3.7503084135
|
|
395
|
+
unitsml: mm_Hg
|
|
396
|
+
type: float
|
|
397
|
+
geopotential-altitude:
|
|
398
|
+
- value: 35776.5
|
|
399
|
+
unitsml: m
|
|
400
|
+
type: float
|
|
401
|
+
- value: 117377.0
|
|
402
|
+
unitsml: ft
|
|
403
|
+
type: float
|
|
404
|
+
geometric-altitude:
|
|
405
|
+
- value: 35979.0
|
|
406
|
+
unitsml: m
|
|
407
|
+
type: float
|
|
408
|
+
- value: 118041.0
|
|
409
|
+
unitsml: ft
|
|
410
|
+
type: float
|
|
411
|
+
----
|
|
412
|
+
====
|
|
413
|
+
|
|
414
|
+
.PressureAttrs in XML
|
|
415
|
+
[example]
|
|
416
|
+
====
|
|
417
|
+
[source,ruby]
|
|
418
|
+
----
|
|
419
|
+
attrs = Atmospheris::Export::PressureAttrs.new.set_pressure(
|
|
420
|
+
value: 5.0,
|
|
421
|
+
unit: :mbar
|
|
422
|
+
)
|
|
423
|
+
|
|
424
|
+
attrs.to_xml
|
|
425
|
+
----
|
|
426
|
+
|
|
427
|
+
[source,xml]
|
|
428
|
+
----
|
|
429
|
+
<hypsometrical-attributes xmlns="urn:iso:std:iso:2533:tech:xsd">
|
|
430
|
+
<pressure unitsml="mbar" type="float">5.0</pressure>
|
|
431
|
+
<pressure unitsml="mm_Hg" type="float">3.7503084135</pressure>
|
|
432
|
+
<geometric-altitude unitsml="m" type="float">35979.0</geometric-altitude>
|
|
433
|
+
<geometric-altitude unitsml="ft" type="float">118041.0</geometric-altitude>
|
|
434
|
+
<geopotential-altitude unitsml="m" type="float">35776.5</geopotential-altitude>
|
|
435
|
+
<geopotential-altitude unitsml="ft" type="float">117377.0</geopotential-altitude>
|
|
436
|
+
</hypsometrical-attributes>
|
|
437
|
+
----
|
|
438
|
+
====
|
|
439
|
+
|
|
440
|
+
=== Algorithms
|
|
441
|
+
|
|
442
|
+
==== General
|
|
443
|
+
|
|
444
|
+
For users who wish to access the algorithms directly, the
|
|
445
|
+
`Atmospheris::Isa::Algorithms` class provides a set of methods for calculating
|
|
446
|
+
atmospheric properties at different altitudes.
|
|
447
|
+
|
|
448
|
+
ISO 2533 specifies a number of formulas for the calculation of atmospheric
|
|
449
|
+
properties at different altitudes.
|
|
450
|
+
|
|
451
|
+
These algorithms are implemented in the `Atmospheris::Isa::Algorithms` class.
|
|
452
|
+
|
|
453
|
+
There are two ways to use the `Atmospheris::Isa::Algorithms` class:
|
|
454
|
+
|
|
455
|
+
* as a singleton class, using one of the precision modes (see below)
|
|
456
|
+
* as a class instance
|
|
457
|
+
|
|
458
|
+
[example]
|
|
459
|
+
====
|
|
460
|
+
[source,ruby]
|
|
461
|
+
----
|
|
462
|
+
require 'atmospheris'
|
|
463
|
+
# Singleton class
|
|
464
|
+
instance = Atmospheris::Isa::NormalPrecision.instance.instance
|
|
465
|
+
instance.geometric_altitude_from_geopotential(100).to_f
|
|
466
|
+
=> 100.00157315171192
|
|
467
|
+
|
|
468
|
+
# Class instance
|
|
469
|
+
instance = Atmospheris::Isa::Algorithms.new(precision: :high)
|
|
470
|
+
instance.geometric_altitude_from_geopotential(100).to_f
|
|
471
|
+
=> 100.00157315171192
|
|
472
|
+
----
|
|
473
|
+
====
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
==== Formulas and calculations
|
|
477
|
+
|
|
478
|
+
The `Algorithms` class supports the following methods for calculating
|
|
479
|
+
atmospheric properties.
|
|
480
|
+
|
|
481
|
+
Syntax:
|
|
482
|
+
|
|
483
|
+
[source,ruby]
|
|
484
|
+
----
|
|
485
|
+
require 'atmospheris'
|
|
486
|
+
instance = Atmospheris::Isa::Algorithms.new.{method_name} <1>
|
|
487
|
+
----
|
|
488
|
+
<1> `method_name` is one of the methods listed below.
|
|
489
|
+
|
|
490
|
+
The available methods are:
|
|
491
|
+
|
|
492
|
+
Converting between geometric and geopotential altitudes:
|
|
493
|
+
|
|
494
|
+
* `geometric_altitude_from_geopotential(geopotential_altitude)`
|
|
495
|
+
* `geopotential_altitude_from_geometric(geometric_altitude)`
|
|
496
|
+
|
|
497
|
+
Obtaining the temperature value from an altitude:
|
|
498
|
+
|
|
499
|
+
* `temperature_at_layer_from_geopotential(geopotential_altitude)` (Kelvin)
|
|
500
|
+
* `temperature_at_layer_celcius(geopotential_altitude)` (Celcius)
|
|
501
|
+
|
|
502
|
+
Obtaining the pressure value from an altitude:
|
|
503
|
+
|
|
504
|
+
* `pressure_from_geopotential_mbar(geopotential_altitude)` (mbar/hPa)
|
|
505
|
+
* `pressure_from_geopotential_mmhg(geopotential_altitude)` (mmHg)
|
|
506
|
+
|
|
507
|
+
Obtaining other atmospheric properties from an altitude:
|
|
508
|
+
|
|
509
|
+
* `density_from_geopotential(geopotential_altitude)`
|
|
510
|
+
* `gravity_at_geopotential(geopotential_altitude)`
|
|
511
|
+
* `p_p_n_from_geopotential(geopotential_altitude)`
|
|
512
|
+
* `rho_rho_n_from_geopotential(geopotential_altitude)`
|
|
513
|
+
* `root_rho_rho_n_from_geopotential(geopotential_altitude)`
|
|
514
|
+
* `speed_of_sound_from_geopotential(geopotential_altitude)`
|
|
515
|
+
* `dynamic_viscosity_from_geopotential(geopotential_altitude)`
|
|
516
|
+
* `kinematic_viscosity_from_geopotential(geopotential_altitude)`
|
|
517
|
+
* `thermal_conductivity_from_geopotential(geopotential_altitude)`
|
|
518
|
+
* `pressure_scale_height_from_geopotential(geopotential_altitude)`
|
|
519
|
+
* `specific_weight_from_geopotential(geopotential_altitude)`
|
|
520
|
+
* `air_number_density_from_geopotential(geopotential_altitude)`
|
|
521
|
+
* `mean_air_particle_speed_from_geopotential(geopotential_altitude)`
|
|
522
|
+
* `air_particle_collision_frequency_from_geopotential(geopotential_altitude)`
|
|
523
|
+
* `mean_free_path_of_air_particles_from_geopotential(geopotential_altitude)`
|
|
524
|
+
|
|
525
|
+
Obtaining thermal conductivity from temperature:
|
|
526
|
+
|
|
527
|
+
* `thermal_conductivity_from_temp(temp)`
|
|
528
|
+
|
|
529
|
+
Obtaining geopotential altitude from a given pressure:
|
|
530
|
+
|
|
531
|
+
* `geopotential_altitude_from_pressure_mbar(mbar)`
|
|
532
|
+
* `geopotential_altitude_from_pressure_mmhg(mmhg)`
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
==== Precision modes
|
|
536
|
+
|
|
537
|
+
There are two precision modes available for calculations.
|
|
538
|
+
|
|
539
|
+
High precision mode::
|
|
540
|
+
Uses more accurate constants and number calculations through Ruby's BigDecimal
|
|
541
|
+
to provide results with higher precision. Suitable for applications where the
|
|
542
|
+
utmost accuracy is required.
|
|
543
|
+
|
|
544
|
+
Normal precision mode (default)::
|
|
545
|
+
Uses standard constants and number calculations to provide results with
|
|
546
|
+
sufficient accuracy for most applications.
|
|
547
|
+
|
|
548
|
+
To use the high precision mode, you can either:
|
|
549
|
+
|
|
550
|
+
* use the `Atmospheris::Isa::HighPrecision` class
|
|
551
|
+
* use the `Atmospheris::Isa::Algorithms` class then call the `set_precision(:high)` method
|
|
552
|
+
|
|
553
|
+
[example]
|
|
554
|
+
====
|
|
555
|
+
[source,ruby]
|
|
556
|
+
----
|
|
557
|
+
require 'atmospheris'
|
|
558
|
+
|
|
559
|
+
# High precision mode
|
|
560
|
+
high_precision_instance = Atmospheris::Isa::HighPrecision.instance
|
|
561
|
+
|
|
562
|
+
speed_h = Atmospheris::Isa::HighPrecision.instance.speed_of_sound_from_temp(100)
|
|
563
|
+
=> 0.200467958523516054299360531511514627125051490111885121917578012786288944852326625441743718038552367514555018117e3
|
|
564
|
+
|
|
565
|
+
speed_h.class
|
|
566
|
+
=> BigDecimal
|
|
567
|
+
|
|
568
|
+
# Normal precision mode (default)
|
|
569
|
+
normal_precision_instance = Atmospheris::Isa::NormalPrecision.instance.instance
|
|
570
|
+
|
|
571
|
+
speed_n = Atmospheris::Isa::NormalPrecision.instance.instance.speed_of_sound_from_temp(100)
|
|
572
|
+
=> 200.46795852351607
|
|
573
|
+
|
|
574
|
+
speed_n.class
|
|
575
|
+
=> Float
|
|
576
|
+
----
|
|
577
|
+
====
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
== Generating ISO 2533 tables
|
|
583
|
+
|
|
584
|
+
=== ISO 2533:1975
|
|
585
|
+
|
|
586
|
+
All tables in the 1975 edition are arranged in these steps in meters:
|
|
587
|
+
|
|
588
|
+
.ISO 2533:1975 table range: step 50 from -2k, 100 from 32k, 200 from 51k to 80k
|
|
589
|
+
----
|
|
590
|
+
(-2000..31999).step(50) +
|
|
591
|
+
(32000..50999).step(100) +
|
|
592
|
+
(51000..80000).step(200)
|
|
593
|
+
----
|
|
594
|
+
|
|
595
|
+
Tables 5 to 7 all have height information as collections (arrays) with
|
|
596
|
+
UnitsML unit metadata:
|
|
597
|
+
|
|
598
|
+
* `geometric-altitude` (collection: m, ft)
|
|
599
|
+
* `geopotential-altitude` (collection: m, ft)
|
|
600
|
+
|
|
601
|
+
All YAML tables generated contain these two keys which group altitude values
|
|
602
|
+
as the ISO 2533 tables are rendered in both types of altitudes:
|
|
603
|
+
|
|
604
|
+
* `by-geopotential-altitude`
|
|
605
|
+
* `by-geometric-altitude`
|
|
606
|
+
|
|
607
|
+
==== Table 5
|
|
608
|
+
|
|
609
|
+
Title:
|
|
610
|
+
"_Temperature (T and t), Pressure (p), Density (p) and Acceleration of free fall
|
|
611
|
+
(g) in terms of geometric altitude (h) and geopotential altitude (H)_"
|
|
612
|
+
|
|
613
|
+
Provides the following values in addition to geopotential and geometric height:
|
|
614
|
+
|
|
615
|
+
* `temperature` (collection: K, degC)
|
|
616
|
+
* `pressure` (collection: mbar, mm_Hg)
|
|
617
|
+
* `density`
|
|
618
|
+
* `acceleration`
|
|
619
|
+
|
|
620
|
+
[source,ruby]
|
|
621
|
+
----
|
|
622
|
+
Atmospheris::Export::Iso25331975.table_5 #=> Lutaml::Model
|
|
623
|
+
Atmospheris::Export::Iso25331975.table_5.to_yaml #=> YAML
|
|
624
|
+
----
|
|
625
|
+
|
|
626
|
+
==== Table 6
|
|
627
|
+
|
|
628
|
+
Title:
|
|
629
|
+
"_Relations of p'pn, p/pn and bar(p/pn), Speed of sound (a), Dynamic viscosity
|
|
630
|
+
(p), Kinematic viscosity (v) and Thermal conductivity (lambda) in terms of
|
|
631
|
+
geometric altitude (h), and geopotential altitude (H)_"
|
|
632
|
+
|
|
633
|
+
Provides the following values in addition to geopotential and geometric height:
|
|
634
|
+
|
|
635
|
+
* `ppn`
|
|
636
|
+
* `rhorhon`
|
|
637
|
+
* `sqrt-rhorhon`
|
|
638
|
+
* `speed-of-sound`
|
|
639
|
+
* `dynamic-viscosity`
|
|
640
|
+
* `kinematic-viscosity`
|
|
641
|
+
* `thermal-conductivity`
|
|
642
|
+
|
|
643
|
+
[source,ruby]
|
|
644
|
+
----
|
|
645
|
+
Atmospheris::Export::Iso25331975.table_6 #=> Lutaml::Model
|
|
646
|
+
Atmospheris::Export::Iso25331975.table_6.to_yaml #=> YAML
|
|
647
|
+
----
|
|
648
|
+
|
|
649
|
+
==== Table 7
|
|
650
|
+
|
|
651
|
+
Title:
|
|
652
|
+
"_Pressure scale height (H_p) Specific weight (gamma), Air number density (n),
|
|
653
|
+
Mean air-particle speed (v), Air-particle collision frequency (omega) and Mean
|
|
654
|
+
free path of air particles (l) in terms of geometric altitude (h) and
|
|
655
|
+
geopotential altitude (H)_"
|
|
656
|
+
|
|
657
|
+
* `pressure-scale-height`
|
|
658
|
+
* `specific-weight`
|
|
659
|
+
* `air-number-density`
|
|
660
|
+
* `mean-speed`
|
|
661
|
+
* `frequency`
|
|
662
|
+
* `mean-free-path`
|
|
663
|
+
|
|
664
|
+
[source,ruby]
|
|
665
|
+
----
|
|
666
|
+
Atmospheris::Export::Iso25331975.table_7 #=> Lutaml::Model
|
|
667
|
+
Atmospheris::Export::Iso25331975.table_7.to_yaml #=> YAML
|
|
668
|
+
----
|
|
669
|
+
|
|
670
|
+
|
|
671
|
+
=== ISO 2533 ADD 1:1985
|
|
672
|
+
|
|
673
|
+
Addendum 1 adds "Hypsometrical tables".
|
|
674
|
+
|
|
675
|
+
==== Table 1 (hPa)
|
|
676
|
+
|
|
677
|
+
Title:
|
|
678
|
+
"_Geopotential altitude as a function of barometric pressure
|
|
679
|
+
for 5 <= p < 20 hPa at intervals of 0.01 hPa_"
|
|
680
|
+
|
|
681
|
+
For the range of `(5.0..19.99).step(0.01)` in hPa.
|
|
682
|
+
|
|
683
|
+
Provides:
|
|
684
|
+
|
|
685
|
+
* `pressure` (collection: mbar, mm_Hg)
|
|
686
|
+
* `geopotential-altitude`
|
|
687
|
+
|
|
688
|
+
[source,ruby]
|
|
689
|
+
----
|
|
690
|
+
Atmospheris::Export::Iso25331985.table_1 #=> Lutaml::Model
|
|
691
|
+
Atmospheris::Export::Iso25331985.table_1.to_yaml #=> YAML
|
|
692
|
+
----
|
|
693
|
+
|
|
694
|
+
==== Table 2 (hPa)
|
|
695
|
+
|
|
696
|
+
Title:
|
|
697
|
+
"_Geopotential altitude as a function of barometric pressure
|
|
698
|
+
for 20 <= p < 1200 hPa at intervals of 0.1 hPa_"
|
|
699
|
+
|
|
700
|
+
Same as Table 1 but for the range of `(20.0..1199.9).step(0.1)` in hPa.
|
|
701
|
+
|
|
702
|
+
[source,ruby]
|
|
703
|
+
----
|
|
704
|
+
Atmospheris::Export::Iso25331985.table_2 #=> Lutaml::Model
|
|
705
|
+
Atmospheris::Export::Iso25331985.table_2.to_yaml #=> YAML
|
|
706
|
+
----
|
|
707
|
+
|
|
708
|
+
==== Table 3 (mmHg)
|
|
709
|
+
|
|
710
|
+
Title:
|
|
711
|
+
"_Geopotential altitude as a function of barometric pressure for 4 <= p < 10
|
|
712
|
+
mmHg at intervals of 0.01 mmHg_"
|
|
713
|
+
|
|
714
|
+
Same as Table 1 but for the range of `(4.0..9.99).step(0.01)` and results in mmhg.
|
|
715
|
+
|
|
716
|
+
Provides:
|
|
717
|
+
|
|
718
|
+
* `pressure` (collection: mbar, mm_Hg)
|
|
719
|
+
* `geopotential-altitude`
|
|
720
|
+
|
|
721
|
+
[source,ruby]
|
|
722
|
+
----
|
|
723
|
+
Atmospheris::Export::Iso25331985.table_3 #=> Lutaml::Model
|
|
724
|
+
Atmospheris::Export::Iso25331985.table_3.to_yaml #=> YAML
|
|
725
|
+
----
|
|
726
|
+
|
|
727
|
+
==== Table 4 (mmHg)
|
|
728
|
+
|
|
729
|
+
Title:
|
|
730
|
+
"_Geopotential altitude as a function of barometric pressure for 10 <= p < 900
|
|
731
|
+
mmHg at intervals of 0.1 mmHg_"
|
|
732
|
+
|
|
733
|
+
Same as Table 3 but for the range of `(10.0..899.9).step(0.1)` and results in mmhg.
|
|
734
|
+
|
|
735
|
+
[source,ruby]
|
|
736
|
+
----
|
|
737
|
+
Atmospheris::Export::Iso25331985.table_4 #=> Lutaml::Model
|
|
738
|
+
Atmospheris::Export::Iso25331985.table_4.to_yaml #=> YAML
|
|
739
|
+
----
|
|
740
|
+
|
|
741
|
+
==== Table 5 (hPa) and Table 6 (mmHg)
|
|
742
|
+
|
|
743
|
+
The difference is Table 5 is in hPa while Table 6 is in mmHg.
|
|
744
|
+
|
|
745
|
+
Title:
|
|
746
|
+
"_Barometric pressure, in hectopascals, as a function of geopotential altitude
|
|
747
|
+
for -1000 <= H < +4600 m at intervals of 1m_"
|
|
748
|
+
|
|
749
|
+
Provides:
|
|
750
|
+
|
|
751
|
+
* `geopotential-altitude`
|
|
752
|
+
* `pressure` (collection: mbar, mm_Hg)
|
|
753
|
+
|
|
754
|
+
Range of `(-1000..4599).step(1)`.
|
|
755
|
+
|
|
756
|
+
[source,ruby]
|
|
757
|
+
----
|
|
758
|
+
Atmospheris::Export::Iso25331985.table_56 #=> Lutaml::Model
|
|
759
|
+
Atmospheris::Export::Iso25331985.table_56.to_yaml #=> YAML
|
|
760
|
+
----
|
|
761
|
+
|
|
762
|
+
=== ISO 2533 ADD 2:1997
|
|
763
|
+
|
|
764
|
+
Addendum 2 is exactly like ISO 2533:1975 with the tables but extended the tables:
|
|
765
|
+
|
|
766
|
+
* 1975's range is -2km to 80km. 1997 provides -5km to 2km (yes -2km to 2km overlaps...)
|
|
767
|
+
* 1975 tables only provide H and h in meters. 1997 adds a lookup table of H and h in feet.
|
|
768
|
+
|
|
769
|
+
.ISO 2533 ADD 2:1997 Tables 1 to 3 have height range in meters
|
|
770
|
+
----
|
|
771
|
+
(-5000..2000).step(50)
|
|
772
|
+
----
|
|
773
|
+
|
|
774
|
+
.ISO 2533 ADD 2:1997 Tables 4 to 6 have height range in feet
|
|
775
|
+
----
|
|
776
|
+
(-16500..-13999).step(250) +
|
|
777
|
+
(-14000..104999).step(200) +
|
|
778
|
+
(105000..262500).step(500)
|
|
779
|
+
----
|
|
780
|
+
|
|
781
|
+
|
|
782
|
+
==== Table 1 (-5km to 2km)
|
|
783
|
+
|
|
784
|
+
Title:
|
|
785
|
+
"_Temperature (T and t), pressure (p), density (p) and acceleration of free fall
|
|
786
|
+
(g) in terms of geometric altitude (h) and geopotential altitude (H) --
|
|
787
|
+
Altitudes in metres_"
|
|
788
|
+
|
|
789
|
+
Exactly same as ISO 2533:1975 Table 5, but with a different height range.
|
|
790
|
+
|
|
791
|
+
In addition, pressure at mmHg is no longer produced, but the implementation
|
|
792
|
+
still provides it for completeness.
|
|
793
|
+
|
|
794
|
+
[source,ruby]
|
|
795
|
+
----
|
|
796
|
+
Atmospheris::Export::Iso25331997.table_1 #=> Lutaml::Model
|
|
797
|
+
Atmospheris::Export::Iso25331997.table_1.to_yaml #=> YAML
|
|
798
|
+
----
|
|
799
|
+
|
|
800
|
+
==== Table 2 (-5km to 2km)
|
|
801
|
+
|
|
802
|
+
Title:
|
|
803
|
+
"_Relations of p'pn, p/pn and bar(p/pn), Speed of sound (a), Dynamic viscosity
|
|
804
|
+
(p), Kinematic viscosity (v) and Thermal conductivity (lambda) in terms of
|
|
805
|
+
geometric altitude (h), and geopotential altitude (H) -- Altitudes in metres_"
|
|
806
|
+
|
|
807
|
+
Exactly same as ISO 2533:1975 Table 6, but with a different height range.
|
|
808
|
+
|
|
809
|
+
[source,ruby]
|
|
810
|
+
----
|
|
811
|
+
Atmospheris::Export::Iso25331997.table_2 #=> Lutaml::Model
|
|
812
|
+
Atmospheris::Export::Iso25331997.table_2.to_yaml #=> YAML
|
|
813
|
+
----
|
|
814
|
+
|
|
815
|
+
==== Table 3 (-5km to 2km)
|
|
816
|
+
|
|
817
|
+
Title:
|
|
818
|
+
"_Pressure scale height (H_p) Specific weight (gamma), Air number density (n),
|
|
819
|
+
Mean air-particle speed (v), Air-particle collision frequency (omega) and Mean
|
|
820
|
+
free path of air particles (l) in terms of geometric altitude (h) and
|
|
821
|
+
geopotential altitude (H) -- Altitudes in metres_"
|
|
822
|
+
|
|
823
|
+
Exactly same as ISO 2533:1975 Table 7, but with a different height range.
|
|
824
|
+
|
|
825
|
+
[source,ruby]
|
|
826
|
+
----
|
|
827
|
+
Atmospheris::Export::Iso25331997.table_3 #=> Lutaml::Model
|
|
828
|
+
Atmospheris::Export::Iso25331997.table_3.to_yaml #=> YAML
|
|
829
|
+
----
|
|
830
|
+
|
|
831
|
+
==== Table 4 (-16.5kft to 262.5kft)
|
|
832
|
+
|
|
833
|
+
Title:
|
|
834
|
+
"_Temperature (T and t), pressure (p), density (p) and acceleration of free fall
|
|
835
|
+
(g) in terms of geometric altitude (h) and geopotential altitude (H) --
|
|
836
|
+
Altitudes in feet_"
|
|
837
|
+
|
|
838
|
+
Exactly same as ISO 2533:1975 Table 5, but in feet and different range.
|
|
839
|
+
|
|
840
|
+
Pressure at mmHg is not produced, but the implementation still provides it
|
|
841
|
+
for completeness.
|
|
842
|
+
|
|
843
|
+
[source,ruby]
|
|
844
|
+
----
|
|
845
|
+
Atmospheris::Export::Iso25331997.table_4 #=> Lutaml::Model
|
|
846
|
+
Atmospheris::Export::Iso25331997.table_4.to_yaml #=> YAML
|
|
847
|
+
----
|
|
848
|
+
|
|
849
|
+
==== Table 5 (-16.5kft to 262.5kft)
|
|
850
|
+
|
|
851
|
+
Title:
|
|
852
|
+
"_Relations of p'pn, p/pn and bar(p/pn), Speed of sound (a), Dynamic viscosity
|
|
853
|
+
(p), Kinematic viscosity (v) and Thermal conductivity (lambda) in terms of
|
|
854
|
+
geometric altitude (h), and geopotential altitude (H) -- Altitudes in feet_"
|
|
855
|
+
|
|
856
|
+
Exactly same as ISO 2533:1975 Table 6, but in feet and different range.
|
|
857
|
+
|
|
858
|
+
[source,ruby]
|
|
859
|
+
----
|
|
860
|
+
Atmospheris::Export::Iso25331997.table_5 #=> Lutaml::Model
|
|
861
|
+
Atmospheris::Export::Iso25331997.table_5.to_yaml #=> YAML
|
|
862
|
+
----
|
|
863
|
+
|
|
864
|
+
==== Table 6 (-16.5kft to 262.5kft)
|
|
865
|
+
|
|
866
|
+
Title:
|
|
867
|
+
"_Pressure scale height (H_p) Specific weight (gamma), Air number density (n),
|
|
868
|
+
Mean air-particle speed (v), Air-particle collision frequency (omega) and Mean
|
|
869
|
+
free path of air particles (l) in terms of geometric altitude (h) and
|
|
870
|
+
geopotential altitude (H) -- Altitudes in feet_"
|
|
871
|
+
|
|
872
|
+
Exactly same as ISO 2533:1975 Table 7, but in feet and different range.
|
|
873
|
+
|
|
874
|
+
[source,ruby]
|
|
875
|
+
----
|
|
876
|
+
Atmospheris::Export::Iso25331997.table_6 #=> Lutaml::Model
|
|
877
|
+
Atmospheris::Export::Iso25331997.table_6.to_yaml #=> YAML
|
|
878
|
+
----
|
|
879
|
+
|
|
880
|
+
|
|
881
|
+
=== ISO 2533:2025
|
|
882
|
+
|
|
883
|
+
==== General
|
|
884
|
+
|
|
885
|
+
ISO 2533 is now being revised targeting a 2025 publication, which will be 50
|
|
886
|
+
years since the last edition (1975) and 28 years since it was last updated
|
|
887
|
+
(1997).
|
|
888
|
+
|
|
889
|
+
It is currently in the CD stage (Committee Draft) and is expected to be published in 2025.
|
|
890
|
+
|
|
891
|
+
* ISO NP 2533:2024. approved in 2024.
|
|
892
|
+
* ISO WD 2533:2024. launched: 2024-11-22, closed: 2025-02-17.
|
|
893
|
+
* ISO CD 2533:2024. pending.
|
|
894
|
+
|
|
895
|
+
ISO 2533:2025 covers all content in the previously published Addenda, including:
|
|
896
|
+
|
|
897
|
+
* Standard atmosphere values from altitude -5km to 80km (geometric and geopotential)
|
|
898
|
+
+
|
|
899
|
+
NOTE: The 1975 edition provided values from -2km to 80km (even though it said 32km in the title).
|
|
900
|
+
+
|
|
901
|
+
NOTE: The 1997 ADD 2 provided values from -5km to 2km.
|
|
902
|
+
|
|
903
|
+
* Standard atmosphere values from altitude -16,500ft to 262,500ft (geometric and geopotential)
|
|
904
|
+
+
|
|
905
|
+
NOTE: The 1997 ADD 2 provided these values.
|
|
906
|
+
|
|
907
|
+
* Hypsometrical tables (altitude as a function of barometric pressure) (geometric and geopotential; hPa/mbar)
|
|
908
|
+
+
|
|
909
|
+
NOTE: The 1985 ADD 1 provided these hypsometrical tables in hPa/mbar and mmHg.
|
|
910
|
+
In the 2024 edition only hPa/mbar is provided.
|
|
911
|
+
|
|
912
|
+
This document will also align to the values provided in
|
|
913
|
+
https://store.icao.int/en/manual-of-the-icao-standard-atmosphere-extended-to-80-kilometres-262500-feet-doc-7488[ICAO Doc 7488/3].
|
|
914
|
+
|
|
915
|
+
All YAML tables generated contain these two keys which group altitude values
|
|
916
|
+
as the ISO 2533 tables are rendered in both types of altitudes:
|
|
917
|
+
|
|
918
|
+
* `by-geopotential-altitude`
|
|
919
|
+
* `by-geometric-altitude`
|
|
920
|
+
|
|
921
|
+
The `Iso25332025` class provides the following methods to generate tables:
|
|
922
|
+
|
|
923
|
+
`table_atmosphere_meters`:: Atmosphere attributes by altitude (m). Grouped by
|
|
924
|
+
`by-geopotential-altitude` and `by-geometric-altitude`. Each entry underneath is
|
|
925
|
+
an `AltitudeAttrs` object. The altitude interval values follow these steps:
|
|
926
|
+
+
|
|
927
|
+
.Step 50 from -5k, 100 from 32k, 200 from 51k to 80k.
|
|
928
|
+
----
|
|
929
|
+
(-5000..31950).step(50) +
|
|
930
|
+
(32000..50900).step(100) +
|
|
931
|
+
(51000..80000).step(200)
|
|
932
|
+
----
|
|
933
|
+
|
|
934
|
+
`table_atmosphere_feet`:: Atmosphere attributes by altitude (ft). Grouped by
|
|
935
|
+
`by-geopotential-altitude` and `by-geometric-altitude`. Each entry underneath is
|
|
936
|
+
an `AltitudeAttrs` object. The altitude interval values follow these steps:
|
|
937
|
+
+
|
|
938
|
+
.Step 250 from -16500, 200 from -14000, 500 from 105000 to 262500
|
|
939
|
+
----
|
|
940
|
+
(-16500..-13750).step(250) +
|
|
941
|
+
(-14000..104800).step(200) +
|
|
942
|
+
(105000..262500).step(500)
|
|
943
|
+
----
|
|
944
|
+
|
|
945
|
+
`table_hypsometrical_altitude`:: Atmosphere attributes by altitude (m). This is
|
|
946
|
+
the same as `table_atmosphere_meters` except with a modified step.
|
|
947
|
+
+
|
|
948
|
+
.Step 1 from -1000 to 4599
|
|
949
|
+
----
|
|
950
|
+
(-1000..4599).step(1)
|
|
951
|
+
----
|
|
952
|
+
|
|
953
|
+
`table_hypsometrical_mbar`:: Hypsometrical table by pressure (mbar). This is a
|
|
954
|
+
table that provides altitude values per unit of pressure. Each entry underneath
|
|
955
|
+
is a `PressureAttrs` object. It follows this step schedule:
|
|
956
|
+
+
|
|
957
|
+
.Step 0.01 from 5 to 20, 0.1 from 20 to 1770.9
|
|
958
|
+
----
|
|
959
|
+
(5.0..19.99).step(0.01) +
|
|
960
|
+
(20.0..1770.9).step(0.1)
|
|
961
|
+
----
|
|
962
|
+
|
|
963
|
+
.Generating the ISO 2533:2025 tables
|
|
964
|
+
[example]
|
|
965
|
+
====
|
|
966
|
+
[source,ruby]
|
|
967
|
+
----
|
|
968
|
+
# Defaults to precision mode `:reduced`
|
|
969
|
+
Atmospheris::Export::Iso25332025.table_atmosphere_meters #=> Lutaml::Model
|
|
970
|
+
Atmospheris::Export::Iso25332025.table_atmosphere_meters.to_yaml #=> YAML
|
|
971
|
+
|
|
972
|
+
# To use precision mode `:high`
|
|
973
|
+
x = Atmospheris::Export::Iso25332025.table_atmosphere_meters(precision: :high)
|
|
974
|
+
x.to_yaml #=> YAML
|
|
975
|
+
----
|
|
976
|
+
====
|
|
977
|
+
|
|
978
|
+
The above table methods are used as the data sources for the data tables in ISO 2533:2025:
|
|
979
|
+
|
|
980
|
+
* `table_atmosphere_meters`: Table 5 (meters), Table 6 (meters), Table 7
|
|
981
|
+
(meters). This data table is split into 3 tables for readability reasons.
|
|
982
|
+
|
|
983
|
+
* `table_atmosphere_feet`: Table 8 (feet), Table 9 (feet), Table 10 (feet).
|
|
984
|
+
Similarly, this data table is split into 3 tables for readability reasons.
|
|
985
|
+
|
|
986
|
+
* `table_hypsometrical_altitude`: Table 11 (mbar).
|
|
987
|
+
|
|
988
|
+
* `table_hypsometrical_mbar`: Table 12 (geopotential), Table 13 (geometric).
|
|
989
|
+
|
|
990
|
+
|
|
991
|
+
==== Table 5 (meters)
|
|
992
|
+
|
|
993
|
+
NOTE: This corresponds to ISO 2533:1975 Table 5 combined with ISO 2533:1975/ADD
|
|
994
|
+
1:1997 Table 1.
|
|
995
|
+
|
|
996
|
+
Title:
|
|
997
|
+
"_Temperature (T and t), Pressure (p), Density (p) and Acceleration of free fall
|
|
998
|
+
(g) in terms of geometric altitude (h) and geopotential altitude (H)_"
|
|
999
|
+
|
|
1000
|
+
This table is a subset of the `table_atmosphere_meters` method.
|
|
1001
|
+
|
|
1002
|
+
==== Table 6 (meters)
|
|
1003
|
+
|
|
1004
|
+
NOTE: This corresponds to ISO 2533:1975 Table 6 combined with ISO 2533:1975/ADD
|
|
1005
|
+
1:1997 Table 2.
|
|
1006
|
+
|
|
1007
|
+
Title:
|
|
1008
|
+
"_Relations of p'pn, p/pn and bar(p/pn), Speed of sound (a), Dynamic viscosity
|
|
1009
|
+
(p), Kinematic viscosity (v) and Thermal conductivity (lambda) in terms of
|
|
1010
|
+
geometric altitude (h), and geopotential altitude (H)_"
|
|
1011
|
+
|
|
1012
|
+
This table is a subset of the `table_atmosphere_meters` method.
|
|
1013
|
+
|
|
1014
|
+
==== Table 7 (meters)
|
|
1015
|
+
|
|
1016
|
+
NOTE: This corresponds to ISO 2533:1975 Table 7 combined with ISO 2533:1975/ADD
|
|
1017
|
+
1:1997 Table 3.
|
|
1018
|
+
|
|
1019
|
+
Title:
|
|
1020
|
+
"_Pressure scale height (H_p) Specific weight (gamma), Air number density (n),
|
|
1021
|
+
Mean air-particle speed (v), Air-particle collision frequency (omega) and Mean
|
|
1022
|
+
free path of air particles (l) in terms of geometric altitude (h) and
|
|
1023
|
+
geopotential altitude (H)_"
|
|
1024
|
+
|
|
1025
|
+
This table is a subset of the `table_atmosphere_meters` method.
|
|
1026
|
+
|
|
1027
|
+
==== Table 8 (-16.5kft to 262.5kft)
|
|
1028
|
+
|
|
1029
|
+
NOTE: This corresponds to ISO 2533:1975/ADD 2:1997 Table 4.
|
|
1030
|
+
|
|
1031
|
+
Title:
|
|
1032
|
+
"_Temperature (T and t), pressure (p), density (p) and acceleration of free fall
|
|
1033
|
+
(g) in terms of geometric altitude (h) and geopotential altitude (H) --
|
|
1034
|
+
Altitudes in feet_"
|
|
1035
|
+
|
|
1036
|
+
Exactly same as ISO 2533:1975 Table 5, but in feet and different range.
|
|
1037
|
+
|
|
1038
|
+
Pressure at mmHg is not produced, but the implementation still provides it
|
|
1039
|
+
for completeness.
|
|
1040
|
+
|
|
1041
|
+
This table is a subset of the `table_atmosphere_feet` method.
|
|
1042
|
+
|
|
1043
|
+
==== Table 9 (-16.5kft to 262.5kft)
|
|
1044
|
+
|
|
1045
|
+
NOTE: This corresponds to ISO 2533:1975/ADD 2:1997 Table 5.
|
|
1046
|
+
|
|
1047
|
+
Title:
|
|
1048
|
+
"_Relations of p'pn, p/pn and bar(p/pn), Speed of sound (a), Dynamic viscosity
|
|
1049
|
+
(p), Kinematic viscosity (v) and Thermal conductivity (lambda) in terms of
|
|
1050
|
+
geometric altitude (h), and geopotential altitude (H) -- Altitudes in feet_"
|
|
1051
|
+
|
|
1052
|
+
Exactly same as ISO 2533:1975 Table 6, but in feet and different range.
|
|
1053
|
+
|
|
1054
|
+
This table is a subset of the `table_atmosphere_feet` method.
|
|
1055
|
+
|
|
1056
|
+
==== Table 10 (-16.5kft to 262.5kft)
|
|
1057
|
+
|
|
1058
|
+
NOTE: This corresponds to ISO 2533:1975/ADD 2:1997 Table 6.
|
|
1059
|
+
|
|
1060
|
+
Title:
|
|
1061
|
+
"_Pressure scale height (H_p) Specific weight (gamma), Air number density (n),
|
|
1062
|
+
Mean air-particle speed (v), Air-particle collision frequency (omega) and Mean
|
|
1063
|
+
free path of air particles (l) in terms of geometric altitude (h) and
|
|
1064
|
+
geopotential altitude (H) -- Altitudes in feet_"
|
|
1065
|
+
|
|
1066
|
+
Exactly same as ISO 2533:1975 Table 7, but in feet and different range.
|
|
1067
|
+
|
|
1068
|
+
This table is a subset of the `table_atmosphere_feet` method.
|
|
1069
|
+
|
|
1070
|
+
|
|
1071
|
+
==== Table 11 (mbar)
|
|
1072
|
+
|
|
1073
|
+
NOTE: This corresponds to ISO 2533:1975/ADD 1:1985 Table 1 combined with Table 2.
|
|
1074
|
+
|
|
1075
|
+
Title:
|
|
1076
|
+
"_Geometric and geopotential altitude as a function of barometric pressure
|
|
1077
|
+
for 5 <= p < 20 hPa at intervals of 0.01 hPa and
|
|
1078
|
+
20 <= p < 1200 hPa at intervals of 0.1 hPa__"
|
|
1079
|
+
|
|
1080
|
+
For the range of `(5.0..19.99).step(0.01) + (20.0..1199.9).step(0.1)` in hPa.
|
|
1081
|
+
|
|
1082
|
+
Provides:
|
|
1083
|
+
|
|
1084
|
+
* `pressure` (collection: mbar, mm_Hg)
|
|
1085
|
+
* `geopotential-altitude` (collection: m, ft)
|
|
1086
|
+
* `geometric-altitude` (collection: m, ft)
|
|
1087
|
+
|
|
1088
|
+
[source,ruby]
|
|
1089
|
+
----
|
|
1090
|
+
# Defaults to precision mode `:reduced`
|
|
1091
|
+
Atmospheris::Export::Iso25332025.table_hypsometrical_mbar #=> Lutaml::Model
|
|
1092
|
+
Atmospheris::Export::Iso25332025.table_hypsometrical_mbar.to_yaml #=> YAML
|
|
1093
|
+
|
|
1094
|
+
# To use precision mode `:high`
|
|
1095
|
+
x = Atmospheris::Export::Iso25332025.table_hypsometrical_mbar(precision: :high)
|
|
1096
|
+
x.to_yaml #=> YAML
|
|
1097
|
+
----
|
|
1098
|
+
|
|
1099
|
+
|
|
1100
|
+
==== Table 12 (geopotential altitude, m)
|
|
1101
|
+
|
|
1102
|
+
NOTE: This corresponds to ISO 2533:1975/ADD 1:1985 Table 5 but in geopotential altitude.
|
|
1103
|
+
|
|
1104
|
+
Title:
|
|
1105
|
+
"_Barometric pressure, in hectopascals, as a function of geopotential altitude
|
|
1106
|
+
for -1000 <= H < +4600 m at intervals of 1m_"
|
|
1107
|
+
|
|
1108
|
+
This table is a subset of the `table_atmosphere_meters` method.
|
|
1109
|
+
|
|
1110
|
+
|
|
1111
|
+
==== Table 13 (geometric altitude, m)
|
|
1112
|
+
|
|
1113
|
+
NOTE: This corresponds to ISO 2533:1975/ADD 1:1985 Table 5, in geometric altitude.
|
|
1114
|
+
|
|
1115
|
+
Title:
|
|
1116
|
+
"_Barometric pressure, in hectopascals, as a function of geometric altitude
|
|
1117
|
+
for -1000 <= H < +4600 m at intervals of 1m_"
|
|
1118
|
+
|
|
1119
|
+
This table is a subset of the `table_atmosphere_meters` method.
|
|
1120
|
+
|
|
1121
|
+
== XML Schema
|
|
1122
|
+
|
|
1123
|
+
An XSD schema for the XML serialization format is provided at
|
|
1124
|
+
`schema/atmospheris.xsd`.
|
|
1125
|
+
|
|
1126
|
+
The schema uses the XML namespace `urn:iso:std:iso:2533:tech:xsd` following
|
|
1127
|
+
the RFC 5141 pattern for ISO technical XML schema resources. All elements
|
|
1128
|
+
are namespace-qualified (`elementFormDefault="qualified"`).
|
|
1129
|
+
|
|
1130
|
+
The schema defines the following root elements:
|
|
1131
|
+
|
|
1132
|
+
`atmospheris`:: Polymorphic root element. Two variants:
|
|
1133
|
+
+
|
|
1134
|
+
--
|
|
1135
|
+
* **Hypsometrical table**: contains `<hypsometrical-attributes>` records
|
|
1136
|
+
(pressure → altitude lookup).
|
|
1137
|
+
* **ISO 2533:2025 table**: contains `<by-geometric-altitude>` and
|
|
1138
|
+
`<by-geopotential-altitude>` sections, each with
|
|
1139
|
+
`<atmospheris-attributes>` records.
|
|
1140
|
+
--
|
|
1141
|
+
+
|
|
1142
|
+
[example]
|
|
1143
|
+
====
|
|
1144
|
+
[source,xml]
|
|
1145
|
+
----
|
|
1146
|
+
<!-- Hypsometrical table variant -->
|
|
1147
|
+
<atmospheris xmlns="urn:iso:std:iso:2533:tech:xsd">
|
|
1148
|
+
<hypsometrical-attributes>
|
|
1149
|
+
<pressure unitsml="mbar" type="float">1013.25</pressure>
|
|
1150
|
+
<pressure unitsml="mm_Hg" type="float">760.0</pressure>
|
|
1151
|
+
<geometric-altitude unitsml="m" type="float">0.0</geometric-altitude>
|
|
1152
|
+
<geometric-altitude unitsml="ft" type="float">0.0</geometric-altitude>
|
|
1153
|
+
<geopotential-altitude unitsml="m" type="float">0.0</geopotential-altitude>
|
|
1154
|
+
<geopotential-altitude unitsml="ft" type="float">0.0</geopotential-altitude>
|
|
1155
|
+
</hypsometrical-attributes>
|
|
1156
|
+
</atmospheris>
|
|
1157
|
+
|
|
1158
|
+
<!-- ISO 2533:2025 table variant -->
|
|
1159
|
+
<atmospheris xmlns="urn:iso:std:iso:2533:tech:xsd">
|
|
1160
|
+
<by-geometric-altitude>
|
|
1161
|
+
<atmospheris-attributes>...</atmospheric-attributes>
|
|
1162
|
+
</by-geometric-altitude>
|
|
1163
|
+
<by-geopotential-altitude>
|
|
1164
|
+
<atmospheris-attributes>...</atmospheric-attributes>
|
|
1165
|
+
</by-geopotential-altitude>
|
|
1166
|
+
</atmospheris>
|
|
1167
|
+
----
|
|
1168
|
+
====
|
|
1169
|
+
|
|
1170
|
+
`atmosphere-attributes`:: Full atmospheric property record (ISO 2533:2025).
|
|
1171
|
+
Contains all altitude, temperature, pressure, density, and derived properties.
|
|
1172
|
+
|
|
1173
|
+
`hypsometrical-attributes`:: Pressure-to-altitude record. Contains pressure
|
|
1174
|
+
and altitude values.
|
|
1175
|
+
|
|
1176
|
+
`attributes-group`:: Wrapper for a collection of `<atmospheris-attributes>`.
|
|
1177
|
+
|
|
1178
|
+
All value elements share a common pattern:
|
|
1179
|
+
|
|
1180
|
+
* Text content: the numeric value
|
|
1181
|
+
* `unitsml` attribute (optional): the UnitsML unit identifier (e.g., `m`,
|
|
1182
|
+
`ft`, `K`, `mbar`)
|
|
1183
|
+
* `type` attribute (required): either `"float"` or `"integer"`
|
|
1184
|
+
|
|
1185
|
+
[source,xml]
|
|
1186
|
+
----
|
|
1187
|
+
<temperature unitsml="K" type="float">288.15</temperature>
|
|
1188
|
+
<geometric-altitude unitsml="m" type="integer">5000</geometric-altitude>
|
|
1189
|
+
<ppn type="float">0.53338</ppn> <!-- dimensionless, no unitsml -->
|
|
1190
|
+
----
|
|
1191
|
+
|
|
1192
|
+
|
|
1193
|
+
== Testing
|
|
1194
|
+
|
|
1195
|
+
=== General
|
|
1196
|
+
|
|
1197
|
+
[source,sh]
|
|
1198
|
+
----
|
|
1199
|
+
$ bundle exec rake
|
|
1200
|
+
----
|
|
1201
|
+
|
|
1202
|
+
=== Re-generate fixture tables
|
|
1203
|
+
|
|
1204
|
+
The `spec/fixtures/iso*` directories contains YAML files that are used to
|
|
1205
|
+
generate the ISO 2533 tables.
|
|
1206
|
+
|
|
1207
|
+
To re-generate the tables, run:
|
|
1208
|
+
|
|
1209
|
+
[source,sh]
|
|
1210
|
+
----
|
|
1211
|
+
$ bundle exec rake clean generate
|
|
1212
|
+
----
|
|
1213
|
+
|
|
1214
|
+
These tasks are defined in the `Rakefile`.
|
|
1215
|
+
|
|
1216
|
+
=== Algorithms
|
|
1217
|
+
|
|
1218
|
+
Tests are encoded in `spec/fixtures/tests.yml` in the following format:
|
|
1219
|
+
|
|
1220
|
+
[source,yaml]
|
|
1221
|
+
----
|
|
1222
|
+
- H: -2000.0
|
|
1223
|
+
h: -1999.0
|
|
1224
|
+
TK: 301.15
|
|
1225
|
+
TC: 28.0
|
|
1226
|
+
p_mbar: 1277.74
|
|
1227
|
+
p_mmhg: 958.382
|
|
1228
|
+
rho: 1.47808
|
|
1229
|
+
g: 9.8128
|
|
1230
|
+
p_p_n: 1.26103
|
|
1231
|
+
rho_rho_n: 1.20659
|
|
1232
|
+
root_rho_rho_n: 1.09845
|
|
1233
|
+
a: 347.886
|
|
1234
|
+
mu: 1.8514e-05
|
|
1235
|
+
v: 1.2526e-05
|
|
1236
|
+
lambda: 0.026359
|
|
1237
|
+
H_p: 8809.5
|
|
1238
|
+
gamma: 14.504
|
|
1239
|
+
n: 3.0734e+25
|
|
1240
|
+
v_bar: 469.18
|
|
1241
|
+
omega: 8535100000.0
|
|
1242
|
+
l: 549710000.0
|
|
1243
|
+
----
|
|
1244
|
+
|
|
1245
|
+
Each of these values are associated with a cell in the tables of the source
|
|
1246
|
+
documents.
|
|
1247
|
+
|
|
1248
|
+
The only defining value in a tests is `H` (geopotential altitude).
|
|
1249
|
+
It is used to generate all the other values.
|
|
1250
|
+
|
|
1251
|
+
|
|
1252
|
+
== Copyright and license
|
|
1253
|
+
|
|
1254
|
+
Copyright Ribose. Licensed under the 3-clause BSD license.
|