atmospheric 0.4.3 → 0.4.5
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 +4 -4
- data/LICENSE.txt +1 -1
- data/README.adoc +681 -183
- data/lib/atmospheric/export/altitude_attrs.rb +247 -0
- data/lib/atmospheric/export/altitude_convertable_model.rb +84 -0
- data/lib/atmospheric/export/altitude_table.rb +51 -0
- data/lib/atmospheric/export/hypsometrical_table.rb +38 -0
- data/lib/atmospheric/export/iso_25331975/group_one.rb +15 -27
- data/lib/atmospheric/export/iso_25331975/group_one_attrs.rb +90 -0
- data/lib/atmospheric/export/iso_25331975/group_three.rb +14 -27
- data/lib/atmospheric/export/iso_25331975/group_three_attrs.rb +89 -0
- data/lib/atmospheric/export/iso_25331975/group_two.rb +14 -28
- data/lib/atmospheric/export/iso_25331975/group_two_attrs.rb +97 -0
- data/lib/atmospheric/export/iso_25331975.rb +5 -17
- data/lib/atmospheric/export/iso_25331985/pressure_attrs.rb +19 -0
- data/lib/atmospheric/export/iso_25331985/table_five_six_attrs.rb +19 -0
- data/lib/atmospheric/export/iso_25331985.rb +42 -63
- data/lib/atmospheric/export/iso_25331997.rb +21 -39
- data/lib/atmospheric/export/iso_25332025/altitude_attrs_group.rb +27 -0
- data/lib/atmospheric/export/iso_25332025/combined_altitude_attrs_group.rb +44 -0
- data/lib/atmospheric/export/iso_25332025.rb +81 -0
- data/lib/atmospheric/export/pressure_attrs.rb +93 -0
- data/lib/atmospheric/export/{target.rb → utils.rb} +10 -13
- data/lib/atmospheric/export.rb +3 -1
- data/lib/atmospheric/isa.rb +119 -114
- data/lib/atmospheric/unit_value_float.rb +24 -0
- data/lib/atmospheric/unit_value_integer.rb +24 -0
- data/lib/atmospheric/version.rb +1 -1
- data/lib/atmospheric.rb +1 -0
- metadata +38 -28
- data/lib/atmospheric/export/hypsometrical_tables.rb +0 -34
- data/lib/atmospheric/export/iso_25331975/group_base.rb +0 -72
- data/lib/atmospheric/export/iso_25332024.rb +0 -205
- data/spec/fixtures/iso-2533-1975-table5.yaml +0 -18297
- data/spec/fixtures/iso-2533-1975-table6.yaml +0 -18298
- data/spec/fixtures/iso-2533-1975-table7.yaml +0 -16265
data/README.adoc
CHANGED
@@ -3,65 +3,508 @@
|
|
3
3
|
== Purpose
|
4
4
|
|
5
5
|
This repository provides Ruby code for calculating values defined in the
|
6
|
-
following
|
6
|
+
following standards:
|
7
7
|
|
8
8
|
* International Standard Atmosphere (ISA) from ISO 2533:1975,
|
9
9
|
ISO 2533:1975/ADD 1:1985 and ISO 2533:1975/ADD 2:1997
|
10
|
-
* ICAO Standard Atmosphere (ICAO Doc 7488/3, 1994)
|
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
11
|
|
12
|
-
Which are technically identical
|
12
|
+
Which are technically identical standards but different in presentation and
|
13
13
|
units (the ICAO document includes `ft` in addition to `m`).
|
14
14
|
|
15
|
+
This library serves as a reference implementation for the values defined in
|
16
|
+
ISO CD 2533:2025.
|
17
|
+
|
18
|
+
|
15
19
|
== Usage
|
16
20
|
|
17
|
-
===
|
21
|
+
=== General
|
18
22
|
|
19
|
-
|
23
|
+
This library contains code for two separate, but related, purposes.
|
20
24
|
|
21
|
-
|
22
|
-
|
23
|
-
to provide results with higher precision. Suitable for applications where the
|
24
|
-
utmost accuracy is required.
|
25
|
+
* Calculating atmospheric properties at different altitudes. The algorithms
|
26
|
+
are based on ISO 2533.
|
25
27
|
|
26
|
-
|
27
|
-
|
28
|
-
|
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
|
29
35
|
|
30
|
-
|
36
|
+
For the typical user who wishes to calculate atmospheric properties, there
|
37
|
+
is no need to worry about how the tables work.
|
31
38
|
|
32
|
-
|
33
|
-
|
39
|
+
To calculate atmospheric properties, either use the formulas directly or use the
|
40
|
+
`Atmospheric::Export::AltitudeAttrs` class to bulk obtain the values needed.
|
41
|
+
|
42
|
+
|
43
|
+
=== Prerequsites
|
44
|
+
|
45
|
+
Include the `atmospheric` gem in your Gemfile:
|
46
|
+
|
47
|
+
[source,ruby]
|
48
|
+
----
|
49
|
+
gem 'atmospheric'
|
50
|
+
----
|
34
51
|
|
35
|
-
|
52
|
+
Then use `require` in code:
|
36
53
|
|
37
54
|
[source,ruby]
|
38
55
|
----
|
39
56
|
require 'atmospheric'
|
57
|
+
----
|
40
58
|
|
41
|
-
# Normal precision mode (default)
|
42
|
-
normal_precision_instance = Atmospheric::Isa.new
|
43
59
|
|
44
|
-
|
45
|
-
|
60
|
+
=== Atmospheric attributes by altitude
|
61
|
+
|
62
|
+
The `Atmospheric::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 'atmospheric'
|
74
|
+
|
75
|
+
Atmospheric::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
|
+
`geometric_altitude_m`:: Geometric altitude in meters.
|
107
|
+
`geometric_altitude_ft`:: Geometric altitude in feet.
|
108
|
+
`geopotential_altitude_m`:: Geopotential altitude in meters.
|
109
|
+
`geopotential_altitude_ft`:: Geopotential altitude in feet.
|
110
|
+
`temperature_k`:: Temperature in Kelvin. This value is multiplied by 1000.
|
111
|
+
`temperature_c`:: Temperature in Celsius. This value is multiplied by 1000.
|
112
|
+
`pressure_mbar`:: Pressure in millibar.
|
113
|
+
`pressure_mmhg`:: Pressure in mmHg.
|
114
|
+
`density`:: Density in kg/m^3.
|
115
|
+
`acceleration`:: Acceleration in m/s^2.
|
116
|
+
`ppn`:: Ratio of pressure at altitude to pressure at sea level.
|
117
|
+
`rhorhon`:: Ratio of density at altitude to density at sea level.
|
118
|
+
`sqrt_rhorhon`:: Square root of the ratio of density at altitude to density at sea level.
|
119
|
+
`speed_of_sound`:: Speed of sound in m/s.
|
120
|
+
`dynamic_viscosity`:: Dynamic viscosity in kg/(m·s).
|
121
|
+
`kinematic_viscosity`:: Kinematic viscosity in m^2/s.
|
122
|
+
`thermal_conductivity`:: Thermal conductivity in W/(m·K).
|
123
|
+
`pressure_scale_height`:: Pressure scale height in meters.
|
124
|
+
`specific_weight`:: Specific weight in N/m^3.
|
125
|
+
`air_number_density`:: Air number density in particles/m^3.
|
126
|
+
`mean_speed`:: Mean speed of air particles in m/s.
|
127
|
+
`frequency`:: Frequency of air particle collisions in 1/s.
|
128
|
+
`mean_free_path`:: Mean free path of air particles in meters.
|
129
|
+
|
130
|
+
[example]
|
131
|
+
====
|
132
|
+
[source,ruby]
|
133
|
+
----
|
134
|
+
require 'atmospheric'
|
135
|
+
attrs = Atmospheric::Export::AltitudeAttrs.new.set_altitude(
|
136
|
+
value: -2000,
|
137
|
+
type: :geopotential,
|
138
|
+
unit: :meters
|
139
|
+
)
|
140
|
+
|
141
|
+
attrs.geopotential_altitude_m #=> -2000
|
142
|
+
attrs.geopotential_altitude_ft #=> -6561.68
|
143
|
+
attrs.geometric_altitude_m #=> -1999
|
144
|
+
attrs.geometric_altitude_ft #=> -6560
|
145
|
+
----
|
146
|
+
====
|
147
|
+
|
148
|
+
The object can be serialized into YAML or XML.
|
149
|
+
|
150
|
+
.AltitudeAttrs in YAML
|
151
|
+
[example]
|
152
|
+
====
|
153
|
+
[source,ruby]
|
154
|
+
----
|
155
|
+
attrs = Atmospheric::Export::AltitudeAttrs.new.set_altitude(
|
156
|
+
value: -2000,
|
157
|
+
type: :geopotential,
|
158
|
+
unit: :meters
|
159
|
+
)
|
160
|
+
|
161
|
+
attrs.to_yaml
|
162
|
+
----
|
163
|
+
|
164
|
+
[source,yaml]
|
165
|
+
----
|
166
|
+
geometric-altitude-m:
|
167
|
+
value: -1999
|
168
|
+
unitsml: m
|
169
|
+
type: integer
|
170
|
+
geometric-altitude-ft:
|
171
|
+
value: -6560
|
172
|
+
unitsml: ft
|
173
|
+
type: integer
|
174
|
+
geopotential-altitude-m:
|
175
|
+
value: -2000
|
176
|
+
unitsml: m
|
177
|
+
type: integer
|
178
|
+
geopotential-altitude-ft:
|
179
|
+
value: -6562
|
180
|
+
unitsml: ft
|
181
|
+
type: integer
|
182
|
+
temperature-k:
|
183
|
+
value: 301150
|
184
|
+
unitsml: K
|
185
|
+
type: integer
|
186
|
+
temperature-c:
|
187
|
+
value: 28000
|
188
|
+
unitsml: degC
|
189
|
+
type: integer
|
190
|
+
pressure-mbar:
|
191
|
+
value: 1277.74
|
192
|
+
unitsml: mbar
|
193
|
+
type: float
|
194
|
+
pressure-mmhg:
|
195
|
+
value: 958.382
|
196
|
+
unitsml: u:mm_Hg
|
197
|
+
type: float
|
198
|
+
density:
|
199
|
+
value: 1.47808
|
200
|
+
unitsml: kg*m^-3
|
201
|
+
type: float
|
202
|
+
acceleration:
|
203
|
+
value: 9.8128
|
204
|
+
unitsml: m*s^-2
|
205
|
+
type: float
|
206
|
+
ppn:
|
207
|
+
value: 1.26103
|
208
|
+
type: float
|
209
|
+
rhorhon:
|
210
|
+
value: 1.20659
|
211
|
+
type: float
|
212
|
+
sqrt-rhorhon:
|
213
|
+
value: 1.09845
|
214
|
+
type: float
|
215
|
+
speed-of-sound:
|
216
|
+
value: 347886
|
217
|
+
unitsml: m*s^-1
|
218
|
+
type: integer
|
219
|
+
dynamic-viscosity:
|
220
|
+
value: 1.8514e-05
|
221
|
+
unitsml: Pa*s
|
222
|
+
type: float
|
223
|
+
kinematic-viscosity:
|
224
|
+
value: 1.2526e-05
|
225
|
+
unitsml: m^2*s^-1
|
226
|
+
type: float
|
227
|
+
thermal-conductivity:
|
228
|
+
value: 0.026359
|
229
|
+
unitsml: W*m^-1*K^-1
|
230
|
+
type: float
|
231
|
+
pressure-scale-height:
|
232
|
+
value: 8809.5
|
233
|
+
unitsml: m
|
234
|
+
type: float
|
235
|
+
specific-weight:
|
236
|
+
value: 14.504
|
237
|
+
unitsml: N*m^-3
|
238
|
+
type: float
|
239
|
+
air-number-density:
|
240
|
+
value: 3.0734e+25
|
241
|
+
unitsml: m^-3
|
242
|
+
type: float
|
243
|
+
mean-speed:
|
244
|
+
value: 469.18
|
245
|
+
unitsml: m*s^-1
|
246
|
+
type: float
|
247
|
+
frequency:
|
248
|
+
value: 8535100000.0
|
249
|
+
unitsml: s^-1
|
250
|
+
type: float
|
251
|
+
mean-free-path:
|
252
|
+
value: 5.4971e-08
|
253
|
+
unitsml: m
|
254
|
+
type: float
|
255
|
+
----
|
256
|
+
====
|
257
|
+
|
258
|
+
.AltitudeAttrs in XML
|
259
|
+
[example]
|
260
|
+
====
|
261
|
+
[source,ruby]
|
262
|
+
----
|
263
|
+
attrs = Atmospheric::Export::AltitudeAttrs.new.set_altitude(
|
264
|
+
value: -2000,
|
265
|
+
type: :geopotential,
|
266
|
+
unit: :meters
|
267
|
+
)
|
268
|
+
|
269
|
+
attrs.to_xml
|
270
|
+
----
|
271
|
+
|
272
|
+
[source,xml]
|
273
|
+
----
|
274
|
+
<atmosphere-attributes>
|
275
|
+
<geometric-altitude-m unitsml="m" type="integer">-1999</geometric-altitude-m>
|
276
|
+
<geometric-altitude-ft unitsml="ft" type="integer">-6560</geometric-altitude-ft>
|
277
|
+
<geopotential-altitude-m unitsml="m" type="integer">-2000</geopotential-altitude-m>
|
278
|
+
<geopotential-altitude-ft unitsml="ft" type="integer">-6562</geopotential-altitude-ft>
|
279
|
+
<temperature-k unitsml="K" type="integer">301150</temperature-k>
|
280
|
+
<temperature-c unitsml="degC" type="integer">28000</temperature-c>
|
281
|
+
<pressure-mbar unitsml="mbar" type="float">1277.74</pressure-mbar>
|
282
|
+
<pressure-mmhg unitsml="u:mm_Hg" type="float">958.382</pressure-mmhg>
|
283
|
+
<density unitsml="kg*m^-3" type="float">1.47808</density>
|
284
|
+
<acceleration unitsml="m*s^-2" type="float">9.8128</acceleration>
|
285
|
+
<ppn type="float">1.26103</ppn>
|
286
|
+
<rhorhon type="float">1.20659</rhorhon>
|
287
|
+
<sqrt-rhorhon type="float">1.09845</sqrt-rhorhon>
|
288
|
+
<speed-of-sound unitsml="m*s^-1" type="integer">347886</speed-of-sound>
|
289
|
+
<dynamic-viscosity unitsml="Pa*s" type="float">1.8514e-05</dynamic-viscosity>
|
290
|
+
<kinematic-viscosity unitsml="m^2*s^-1" type="float">1.2526e-05</kinematic-viscosity>
|
291
|
+
<thermal-conductivity unitsml="W*m^-1*K^-1" type="float">0.026359</thermal-conductivity>
|
292
|
+
<pressure-scale-height unitsml="m" type="float">8809.5</pressure-scale-height>
|
293
|
+
<specific-weight unitsml="N*m^-3" type="float">14.504</specific-weight>
|
294
|
+
<air-number-density unitsml="m^-3" type="float">3.0734e+25</air-number-density>
|
295
|
+
<mean-speed unitsml="m*s^-1" type="float">469.18</mean-speed>
|
296
|
+
<frequency unitsml="s^-1" type="float">8535100000.0</frequency>
|
297
|
+
<mean-free-path unitsml="m" type="float">5.4971e-08</mean-free-path>
|
298
|
+
</atmosphere-attributes>
|
299
|
+
----
|
300
|
+
====
|
301
|
+
|
302
|
+
|
303
|
+
=== Altitude by pressure
|
304
|
+
|
305
|
+
The `Atmospheric::Export::PressureAttrs` class provides a way to obtain the
|
306
|
+
altitude at a given pressure value (mbar, mmhg).
|
307
|
+
|
308
|
+
Syntax:
|
309
|
+
|
310
|
+
[source,ruby]
|
311
|
+
----
|
312
|
+
require 'atmospheric'
|
313
|
+
|
314
|
+
Atmospheric::Export::PressureAttrs.new.set_pressure(
|
315
|
+
value: {pressure-value}, <1>
|
316
|
+
unit: {pressure-unit}, <2>
|
317
|
+
precision: {precision-mode} <3>
|
318
|
+
)
|
319
|
+
----
|
320
|
+
<1> Value of the pressure desired. Float.
|
321
|
+
<2> Unit of the pressure. Symbol. One of `:mbar`, `:mmhg`.
|
322
|
+
|
323
|
+
NOTE: The `set_pressure` method does not yet support high-precision mode.
|
324
|
+
|
325
|
+
Behavior of the precision mode:
|
326
|
+
|
327
|
+
`:reduced`:: (default) Uses Isa::NormalPrecision for calculations with signficant digits
|
328
|
+
rounding according to the original ISO 2533/ADD 2 specification.
|
329
|
+
|
330
|
+
`:normal`:: Uses Isa::NormalPrecision for calculations without value modification.
|
331
|
+
|
332
|
+
`:high`:: Uses Isa::HighPrecision for calculations without value modifications. This mode uses BigDecimal.
|
333
|
+
|
334
|
+
Each attribute of the `PressureAttrs` object is wrapped in a defined
|
335
|
+
data class which is associated with a https://www.unitsml.org/[UnitsML] unit.
|
336
|
+
|
337
|
+
Depending on the type of the value, it is in one of the following classes:
|
338
|
+
|
339
|
+
* Integer. Class: `UnitValueInteger`
|
340
|
+
* Float. Class: `UnitValueFloat`
|
341
|
+
|
342
|
+
The `PressureAttrs` object provides the following attributes:
|
343
|
+
|
344
|
+
`pressure_mbar`:: Pressure in millibar.
|
345
|
+
`pressure_mmhg`:: Pressure in mmHg.
|
346
|
+
`geometric_altitude_m`:: Geometric altitude in meters.
|
347
|
+
`geometric_altitude_ft`:: Geometric altitude in feet.
|
348
|
+
`geopotential_altitude_m`:: Geopotential altitude in meters.
|
349
|
+
`geopotential_altitude_ft`:: Geopotential altitude in feet.
|
350
|
+
|
351
|
+
[example]
|
352
|
+
====
|
353
|
+
[source,ruby]
|
354
|
+
----
|
355
|
+
attrs = Atmospheric::Export::PressureAttrs.new.set_pressure(
|
356
|
+
value: 5.0,
|
357
|
+
unit: :mbar
|
358
|
+
)
|
359
|
+
|
360
|
+
attrs.pressure_mbar #=> 5.0
|
361
|
+
attrs.pressure_mmhg #=> 3.7503084135
|
362
|
+
attrs.geopotential_altitude_m #=> 35776
|
363
|
+
attrs.geopotential_altitude_ft #=> 117377
|
364
|
+
attrs.geometric_altitude_m #=> 35979
|
365
|
+
attrs.geometric_altitude_ft #=> 118041
|
46
366
|
----
|
367
|
+
====
|
47
368
|
|
48
|
-
|
369
|
+
The object can be serialized into YAML or XML.
|
370
|
+
|
371
|
+
.PressureAttrs in YAML
|
372
|
+
[example]
|
373
|
+
====
|
374
|
+
[source,ruby]
|
375
|
+
----
|
376
|
+
attrs = Atmospheric::Export::PressureAttrs.new.set_pressure(
|
377
|
+
value: 5.0,
|
378
|
+
unit: :mbar
|
379
|
+
)
|
380
|
+
|
381
|
+
attrs.to_yaml
|
382
|
+
----
|
383
|
+
|
384
|
+
[source,yaml]
|
385
|
+
----
|
386
|
+
pressure-mbar:
|
387
|
+
value: 5.0
|
388
|
+
unitsml: mbar
|
389
|
+
type: float
|
390
|
+
pressure-mmhg:
|
391
|
+
value: 3.7503084135
|
392
|
+
unitsml: mmhg
|
393
|
+
type: float
|
394
|
+
geopotential-altitude-m:
|
395
|
+
value: 35776
|
396
|
+
unitsml: m
|
397
|
+
type: integer
|
398
|
+
geopotential-altitude-ft:
|
399
|
+
value: 117377
|
400
|
+
unitsml: ft
|
401
|
+
type: integer
|
402
|
+
geometric-altitude-m:
|
403
|
+
value: 35979
|
404
|
+
unitsml: m
|
405
|
+
type: integer
|
406
|
+
geometric-altitude-ft:
|
407
|
+
value: 118041
|
408
|
+
unitsml: ft
|
409
|
+
type: integer
|
410
|
+
----
|
411
|
+
====
|
412
|
+
|
413
|
+
.PressureAttrs in XML
|
414
|
+
[example]
|
415
|
+
====
|
416
|
+
[source,ruby]
|
417
|
+
----
|
418
|
+
attrs = Atmospheric::Export::PressureAttrs.new.set_pressure(
|
419
|
+
value: 5.0,
|
420
|
+
unit: :mbar
|
421
|
+
)
|
422
|
+
|
423
|
+
attrs.to_xml
|
424
|
+
----
|
425
|
+
|
426
|
+
[source,xml]
|
427
|
+
----
|
428
|
+
<hypsometrical-attributes>
|
429
|
+
<pressure-mbar unitsml="mbar" type="float">5.0</pressure-mbar>
|
430
|
+
<pressure-mmhg unitsml="mmhg" type="float">3.7503084135</pressure-mmhg>
|
431
|
+
<geometric-altitude-m unitsml="m" type="integer">35979</geometric-altitude-m>
|
432
|
+
<geometric-altitude-ft unitsml="ft" type="integer">118041</geometric-altitude-ft>
|
433
|
+
<geopotential-altitude-m unitsml="m" type="integer">35776</geopotential-altitude-m>
|
434
|
+
<geopotential-altitude-ft unitsml="ft" type="integer">117377</geopotential-altitude-ft>
|
435
|
+
</hypsometrical-attributes>
|
436
|
+
----
|
437
|
+
====
|
438
|
+
|
439
|
+
=== Algorithms
|
440
|
+
|
441
|
+
==== General
|
442
|
+
|
443
|
+
For users who wish to access the algorithms directly, the
|
444
|
+
`Atmospheric::Isa::Algorithms` class provides a set of methods for calculating
|
445
|
+
atmospheric properties at different altitudes.
|
446
|
+
|
447
|
+
ISO 2533 specifies a number of formulas for the calculation of atmospheric
|
448
|
+
properties at different altitudes.
|
449
|
+
|
450
|
+
These algorithms are implemented in the `Atmospheric::Isa::Algorithms` class.
|
451
|
+
|
452
|
+
There are two ways to use the `Atmospheric::Isa::Algorithms` class:
|
453
|
+
|
454
|
+
* as a singleton class, using one of the precision modes (see below)
|
455
|
+
* as a class instance
|
456
|
+
|
457
|
+
[example]
|
458
|
+
====
|
459
|
+
[source,ruby]
|
460
|
+
----
|
461
|
+
require 'atmospheric'
|
462
|
+
# Singleton class
|
463
|
+
instance = Atmospheric::Isa::NormalPrecision.instance.instance
|
464
|
+
instance.geometric_altitude_from_geopotential(100).to_f
|
465
|
+
=> 100.00157315171192
|
466
|
+
|
467
|
+
# Class instance
|
468
|
+
instance = Atmospheric::Isa::Algorithms.new(precision: :high)
|
469
|
+
instance.geometric_altitude_from_geopotential(100).to_f
|
470
|
+
=> 100.00157315171192
|
471
|
+
----
|
472
|
+
====
|
473
|
+
|
474
|
+
|
475
|
+
==== Formulas and calculations
|
476
|
+
|
477
|
+
The `Algorithms` class supports the following methods for calculating
|
478
|
+
atmospheric properties.
|
479
|
+
|
480
|
+
Syntax:
|
49
481
|
|
50
482
|
[source,ruby]
|
51
483
|
----
|
52
484
|
require 'atmospheric'
|
53
|
-
instance = Atmospheric::Isa.{method_name}
|
54
|
-
# {method_name} is one of the following
|
485
|
+
instance = Atmospheric::Isa::Algorithms.new.{method_name} <1>
|
55
486
|
----
|
487
|
+
<1> `method_name` is one of the methods listed below.
|
56
488
|
|
57
489
|
The available methods are:
|
58
490
|
|
491
|
+
Converting between geometric and geopotential altitudes:
|
492
|
+
|
59
493
|
* `geometric_altitude_from_geopotential(geopotential_altitude)`
|
60
494
|
* `geopotential_altitude_from_geometric(geometric_altitude)`
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
* `
|
495
|
+
|
496
|
+
Obtaining the temperature value from an altitude:
|
497
|
+
|
498
|
+
* `temperature_at_layer_from_geopotential(geopotential_altitude)` (Kelvin)
|
499
|
+
* `temperature_at_layer_celcius(geopotential_altitude)` (Celcius)
|
500
|
+
|
501
|
+
Obtaining the pressure value from an altitude:
|
502
|
+
|
503
|
+
* `pressure_from_geopotential_mbar(geopotential_altitude)` (mbar/hPa)
|
504
|
+
* `pressure_from_geopotential_mmhg(geopotential_altitude)` (mmHg)
|
505
|
+
|
506
|
+
Obtaining other atmospheric properties from an altitude:
|
507
|
+
|
65
508
|
* `density_from_geopotential(geopotential_altitude)`
|
66
509
|
* `gravity_at_geopotential(geopotential_altitude)`
|
67
510
|
* `p_p_n_from_geopotential(geopotential_altitude)`
|
@@ -78,6 +521,62 @@ The available methods are:
|
|
78
521
|
* `air_particle_collision_frequency_from_geopotential(geopotential_altitude)`
|
79
522
|
* `mean_free_path_of_air_particles_from_geopotential(geopotential_altitude)`
|
80
523
|
|
524
|
+
Obtaining thermal conductivity from temperature:
|
525
|
+
|
526
|
+
* `thermal_conductivity_from_temp(temp)`
|
527
|
+
|
528
|
+
Obtaining geopotential altitude from a given pressure:
|
529
|
+
|
530
|
+
* `geopotential_altitude_from_pressure_mbar(mbar)`
|
531
|
+
* `geopotential_altitude_from_pressure_mmhg(mmhg)`
|
532
|
+
|
533
|
+
|
534
|
+
==== Precision modes
|
535
|
+
|
536
|
+
There are two precision modes available for calculations.
|
537
|
+
|
538
|
+
High precision mode::
|
539
|
+
Uses more accurate constants and number calculations through Ruby's BigDecimal
|
540
|
+
to provide results with higher precision. Suitable for applications where the
|
541
|
+
utmost accuracy is required.
|
542
|
+
|
543
|
+
Normal precision mode (default)::
|
544
|
+
Uses standard constants and number calculations to provide results with
|
545
|
+
sufficient accuracy for most applications.
|
546
|
+
|
547
|
+
To use the high precision mode, you can either:
|
548
|
+
|
549
|
+
* use the `Atmospheric::Isa::HighPrecision` class
|
550
|
+
* use the `Atmospheric::Isa::Algorithms` class then call the `set_precision(:high)` method
|
551
|
+
|
552
|
+
[example]
|
553
|
+
====
|
554
|
+
[source,ruby]
|
555
|
+
----
|
556
|
+
require 'atmospheric'
|
557
|
+
|
558
|
+
# High precision mode
|
559
|
+
high_precision_instance = Atmospheric::Isa::HighPrecision.instance
|
560
|
+
|
561
|
+
speed_h = Atmospheric::Isa::HighPrecision.instance.speed_of_sound_from_temp(100)
|
562
|
+
=> 0.200467958523516054299360531511514627125051490111885121917578012786288944852326625441743718038552367514555018117e3
|
563
|
+
|
564
|
+
speed_h.class
|
565
|
+
=> BigDecimal
|
566
|
+
|
567
|
+
# Normal precision mode (default)
|
568
|
+
normal_precision_instance = Atmospheric::Isa::NormalPrecision.instance.instance
|
569
|
+
|
570
|
+
speed_n = Atmospheric::Isa::NormalPrecision.instance.instance.speed_of_sound_from_temp(100)
|
571
|
+
=> 200.46795852351607
|
572
|
+
|
573
|
+
speed_n.class
|
574
|
+
=> Float
|
575
|
+
----
|
576
|
+
====
|
577
|
+
|
578
|
+
|
579
|
+
|
81
580
|
|
82
581
|
== Generating ISO 2533 tables
|
83
582
|
|
@@ -96,8 +595,8 @@ Tables 5 to 7 all have height information of the following keys in the hash:
|
|
96
595
|
|
97
596
|
* `geopotential-altitude-m`
|
98
597
|
* `geopotential-altitude-ft`
|
99
|
-
* `
|
100
|
-
* `
|
598
|
+
* `geometric-altitude-m`
|
599
|
+
* `geometric-altitude-ft`
|
101
600
|
|
102
601
|
All YAML tables generated contain these two keys which group altitude values
|
103
602
|
as the ISO 2533 tables are rendered in both types of altitudes:
|
@@ -109,12 +608,12 @@ as the ISO 2533 tables are rendered in both types of altitudes:
|
|
109
608
|
|
110
609
|
Title:
|
111
610
|
"_Temperature (T and t), Pressure (p), Density (p) and Acceleration of free fall
|
112
|
-
(g) in terms of
|
611
|
+
(g) in terms of geometric altitude (h) and geopotential altitude (H)_"
|
113
612
|
|
114
613
|
Provides the following values in addition to geopotential and geometric height:
|
115
614
|
|
116
|
-
* `temperature-
|
117
|
-
* `temperature-
|
615
|
+
* `temperature-k`
|
616
|
+
* `temperature-c`
|
118
617
|
* `pressure-mbar`
|
119
618
|
* `pressure-mmhg`
|
120
619
|
* `density`
|
@@ -122,8 +621,8 @@ Provides the following values in addition to geopotential and geometric height:
|
|
122
621
|
|
123
622
|
[source,ruby]
|
124
623
|
----
|
125
|
-
Atmospheric::Export::Iso25331975.table_5
|
126
|
-
Atmospheric::Export::Iso25331975.
|
624
|
+
Atmospheric::Export::Iso25331975.table_5 #=> Lutaml::Model
|
625
|
+
Atmospheric::Export::Iso25331975.table_5.to_yaml #=> YAML
|
127
626
|
----
|
128
627
|
|
129
628
|
==== Table 6
|
@@ -131,7 +630,7 @@ Atmospheric::Export::Iso25331975.table_5_yaml #=> YAML
|
|
131
630
|
Title:
|
132
631
|
"_Relations of p'pn, p/pn and bar(p/pn), Speed of sound (a), Dynamic viscosity
|
133
632
|
(p), Kinematic viscosity (v) and Thermal conductivity (lambda) in terms of
|
134
|
-
|
633
|
+
geometric altitude (h), and geopotential altitude (H)_"
|
135
634
|
|
136
635
|
Provides the following values in addition to geopotential and geometric height:
|
137
636
|
|
@@ -145,8 +644,8 @@ Provides the following values in addition to geopotential and geometric height:
|
|
145
644
|
|
146
645
|
[source,ruby]
|
147
646
|
----
|
148
|
-
Atmospheric::Export::Iso25331975.table_6
|
149
|
-
Atmospheric::Export::Iso25331975.
|
647
|
+
Atmospheric::Export::Iso25331975.table_6 #=> Lutaml::Model
|
648
|
+
Atmospheric::Export::Iso25331975.table_6.to_yaml #=> YAML
|
150
649
|
----
|
151
650
|
|
152
651
|
==== Table 7
|
@@ -154,7 +653,7 @@ Atmospheric::Export::Iso25331975.table_6_yaml #=> YAML
|
|
154
653
|
Title:
|
155
654
|
"_Pressure scale height (H_p) Specific weight (gamma), Air number density (n),
|
156
655
|
Mean air-particle speed (v), Air-particle collision frequency (omega) and Mean
|
157
|
-
free path of air particles (l) in terms of
|
656
|
+
free path of air particles (l) in terms of geometric altitude (h) and
|
158
657
|
geopotential altitude (H)_"
|
159
658
|
|
160
659
|
* `pressure-scale-height`
|
@@ -166,8 +665,8 @@ geopotential altitude (H)_"
|
|
166
665
|
|
167
666
|
[source,ruby]
|
168
667
|
----
|
169
|
-
Atmospheric::Export::Iso25331975.table_7
|
170
|
-
Atmospheric::Export::Iso25331975.
|
668
|
+
Atmospheric::Export::Iso25331975.table_7 #=> Lutaml::Model
|
669
|
+
Atmospheric::Export::Iso25331975.table_7.to_yaml #=> YAML
|
171
670
|
----
|
172
671
|
|
173
672
|
|
@@ -190,8 +689,8 @@ Provides:
|
|
190
689
|
|
191
690
|
[source,ruby]
|
192
691
|
----
|
193
|
-
Atmospheric::Export::Iso25331985.table_1
|
194
|
-
Atmospheric::Export::Iso25331985.
|
692
|
+
Atmospheric::Export::Iso25331985.table_1 #=> Lutaml::Model
|
693
|
+
Atmospheric::Export::Iso25331985.table_1.to_yaml #=> YAML
|
195
694
|
----
|
196
695
|
|
197
696
|
==== Table 2 (hPa)
|
@@ -204,8 +703,8 @@ Same as Table 1 but for the range of `(20.0..1199.9).step(0.1)` in hPa.
|
|
204
703
|
|
205
704
|
[source,ruby]
|
206
705
|
----
|
207
|
-
Atmospheric::Export::Iso25331985.table_2
|
208
|
-
Atmospheric::Export::Iso25331985.
|
706
|
+
Atmospheric::Export::Iso25331985.table_2 #=> Lutaml::Model
|
707
|
+
Atmospheric::Export::Iso25331985.table_2.to_yaml #=> YAML
|
209
708
|
----
|
210
709
|
|
211
710
|
==== Table 3 (mmHg)
|
@@ -223,8 +722,8 @@ Provides:
|
|
223
722
|
|
224
723
|
[source,ruby]
|
225
724
|
----
|
226
|
-
Atmospheric::Export::Iso25331985.table_3
|
227
|
-
Atmospheric::Export::Iso25331985.
|
725
|
+
Atmospheric::Export::Iso25331985.table_3 #=> Lutaml::Model
|
726
|
+
Atmospheric::Export::Iso25331985.table_3.to_yaml #=> YAML
|
228
727
|
----
|
229
728
|
|
230
729
|
==== Table 4 (mmHg)
|
@@ -237,8 +736,8 @@ Same as Table 3 but for the range of `(10.0..899.9).step(0.1)` and results in mm
|
|
237
736
|
|
238
737
|
[source,ruby]
|
239
738
|
----
|
240
|
-
Atmospheric::Export::Iso25331985.table_4
|
241
|
-
Atmospheric::Export::Iso25331985.
|
739
|
+
Atmospheric::Export::Iso25331985.table_4 #=> Lutaml::Model
|
740
|
+
Atmospheric::Export::Iso25331985.table_4.to_yaml #=> YAML
|
242
741
|
----
|
243
742
|
|
244
743
|
==== Table 5 (hPa) and Table 6 (mmHg)
|
@@ -259,8 +758,8 @@ Range of `(-1000..4599).step(1)`.
|
|
259
758
|
|
260
759
|
[source,ruby]
|
261
760
|
----
|
262
|
-
Atmospheric::Export::Iso25331985.table_56
|
263
|
-
Atmospheric::Export::Iso25331985.
|
761
|
+
Atmospheric::Export::Iso25331985.table_56 #=> Lutaml::Model
|
762
|
+
Atmospheric::Export::Iso25331985.table_56.to_yaml #=> YAML
|
264
763
|
----
|
265
764
|
|
266
765
|
=== ISO 2533 ADD 2:1997
|
@@ -287,7 +786,7 @@ Addendum 2 is exactly like ISO 2533:1975 with the tables but extended the tables
|
|
287
786
|
|
288
787
|
Title:
|
289
788
|
"_Temperature (T and t), pressure (p), density (p) and acceleration of free fall
|
290
|
-
(g) in terms of
|
789
|
+
(g) in terms of geometric altitude (h) and geopotential altitude (H) --
|
291
790
|
Altitudes in metres_"
|
292
791
|
|
293
792
|
Exactly same as ISO 2533:1975 Table 5, but with a different height range.
|
@@ -297,8 +796,8 @@ still provides it for completeness.
|
|
297
796
|
|
298
797
|
[source,ruby]
|
299
798
|
----
|
300
|
-
Atmospheric::Export::Iso25331997.table_1
|
301
|
-
Atmospheric::Export::Iso25331997.
|
799
|
+
Atmospheric::Export::Iso25331997.table_1 #=> Lutaml::Model
|
800
|
+
Atmospheric::Export::Iso25331997.table_1.to_yaml #=> YAML
|
302
801
|
----
|
303
802
|
|
304
803
|
==== Table 2 (-5km to 2km)
|
@@ -306,14 +805,14 @@ Atmospheric::Export::Iso25331997.table_1_yaml #=> YAML
|
|
306
805
|
Title:
|
307
806
|
"_Relations of p'pn, p/pn and bar(p/pn), Speed of sound (a), Dynamic viscosity
|
308
807
|
(p), Kinematic viscosity (v) and Thermal conductivity (lambda) in terms of
|
309
|
-
|
808
|
+
geometric altitude (h), and geopotential altitude (H) -- Altitudes in metres_"
|
310
809
|
|
311
810
|
Exactly same as ISO 2533:1975 Table 6, but with a different height range.
|
312
811
|
|
313
812
|
[source,ruby]
|
314
813
|
----
|
315
|
-
Atmospheric::Export::Iso25331997.table_2
|
316
|
-
Atmospheric::Export::Iso25331997.
|
814
|
+
Atmospheric::Export::Iso25331997.table_2 #=> Lutaml::Model
|
815
|
+
Atmospheric::Export::Iso25331997.table_2.to_yaml #=> YAML
|
317
816
|
----
|
318
817
|
|
319
818
|
==== Table 3 (-5km to 2km)
|
@@ -321,22 +820,22 @@ Atmospheric::Export::Iso25331997.table_2_yaml #=> YAML
|
|
321
820
|
Title:
|
322
821
|
"_Pressure scale height (H_p) Specific weight (gamma), Air number density (n),
|
323
822
|
Mean air-particle speed (v), Air-particle collision frequency (omega) and Mean
|
324
|
-
free path of air particles (l) in terms of
|
823
|
+
free path of air particles (l) in terms of geometric altitude (h) and
|
325
824
|
geopotential altitude (H) -- Altitudes in metres_"
|
326
825
|
|
327
826
|
Exactly same as ISO 2533:1975 Table 7, but with a different height range.
|
328
827
|
|
329
828
|
[source,ruby]
|
330
829
|
----
|
331
|
-
Atmospheric::Export::Iso25331997.table_3
|
332
|
-
Atmospheric::Export::Iso25331997.
|
830
|
+
Atmospheric::Export::Iso25331997.table_3 #=> Lutaml::Model
|
831
|
+
Atmospheric::Export::Iso25331997.table_3.to_yaml #=> YAML
|
333
832
|
----
|
334
833
|
|
335
834
|
==== Table 4 (-16.5kft to 262.5kft)
|
336
835
|
|
337
836
|
Title:
|
338
837
|
"_Temperature (T and t), pressure (p), density (p) and acceleration of free fall
|
339
|
-
(g) in terms of
|
838
|
+
(g) in terms of geometric altitude (h) and geopotential altitude (H) --
|
340
839
|
Altitudes in feet_"
|
341
840
|
|
342
841
|
Exactly same as ISO 2533:1975 Table 5, but in feet and different range.
|
@@ -346,8 +845,8 @@ for completeness.
|
|
346
845
|
|
347
846
|
[source,ruby]
|
348
847
|
----
|
349
|
-
Atmospheric::Export::Iso25331997.table_4
|
350
|
-
Atmospheric::Export::Iso25331997.
|
848
|
+
Atmospheric::Export::Iso25331997.table_4 #=> Lutaml::Model
|
849
|
+
Atmospheric::Export::Iso25331997.table_4.to_yaml #=> YAML
|
351
850
|
----
|
352
851
|
|
353
852
|
==== Table 5 (-16.5kft to 262.5kft)
|
@@ -355,14 +854,14 @@ Atmospheric::Export::Iso25331997.table_4_yaml #=> YAML
|
|
355
854
|
Title:
|
356
855
|
"_Relations of p'pn, p/pn and bar(p/pn), Speed of sound (a), Dynamic viscosity
|
357
856
|
(p), Kinematic viscosity (v) and Thermal conductivity (lambda) in terms of
|
358
|
-
|
857
|
+
geometric altitude (h), and geopotential altitude (H) -- Altitudes in feet_"
|
359
858
|
|
360
859
|
Exactly same as ISO 2533:1975 Table 6, but in feet and different range.
|
361
860
|
|
362
861
|
[source,ruby]
|
363
862
|
----
|
364
|
-
Atmospheric::Export::Iso25331997.table_5
|
365
|
-
Atmospheric::Export::Iso25331997.
|
863
|
+
Atmospheric::Export::Iso25331997.table_5 #=> Lutaml::Model
|
864
|
+
Atmospheric::Export::Iso25331997.table_5.to_yaml #=> YAML
|
366
865
|
----
|
367
866
|
|
368
867
|
==== Table 6 (-16.5kft to 262.5kft)
|
@@ -370,27 +869,33 @@ Atmospheric::Export::Iso25331997.table_5_yaml #=> YAML
|
|
370
869
|
Title:
|
371
870
|
"_Pressure scale height (H_p) Specific weight (gamma), Air number density (n),
|
372
871
|
Mean air-particle speed (v), Air-particle collision frequency (omega) and Mean
|
373
|
-
free path of air particles (l) in terms of
|
872
|
+
free path of air particles (l) in terms of geometric altitude (h) and
|
374
873
|
geopotential altitude (H) -- Altitudes in feet_"
|
375
874
|
|
376
875
|
Exactly same as ISO 2533:1975 Table 7, but in feet and different range.
|
377
876
|
|
378
877
|
[source,ruby]
|
379
878
|
----
|
380
|
-
Atmospheric::Export::Iso25331997.table_6
|
381
|
-
Atmospheric::Export::Iso25331997.
|
879
|
+
Atmospheric::Export::Iso25331997.table_6 #=> Lutaml::Model
|
880
|
+
Atmospheric::Export::Iso25331997.table_6.to_yaml #=> YAML
|
382
881
|
----
|
383
882
|
|
384
883
|
|
385
|
-
=== ISO
|
884
|
+
=== ISO 2533:2025
|
386
885
|
|
387
886
|
==== General
|
388
887
|
|
389
|
-
ISO 2533 is now
|
390
|
-
since the last edition (1975) and
|
888
|
+
ISO 2533 is now being revised targeting a 2025 publication, which will be 50
|
889
|
+
years since the last edition (1975) and 28 years since it was last updated
|
890
|
+
(1997).
|
891
|
+
|
892
|
+
It is currently in the CD stage (Committee Draft) and is expected to be published in 2025.
|
391
893
|
|
392
|
-
ISO NP 2533:2024
|
393
|
-
|
894
|
+
* ISO NP 2533:2024. approved in 2024.
|
895
|
+
* ISO WD 2533:2024. launched: 2024-11-22, closed: 2025-02-17.
|
896
|
+
* ISO CD 2533:2024. pending.
|
897
|
+
|
898
|
+
ISO 2533:2025 covers all content in the previously published Addenda, including:
|
394
899
|
|
395
900
|
* Standard atmosphere values from altitude -5km to 80km (geometric and geopotential)
|
396
901
|
+
|
@@ -410,35 +915,81 @@ In the 2024 edition only hPa/mbar is provided.
|
|
410
915
|
This document will also align to the values provided in
|
411
916
|
https://store.icao.int/en/manual-of-the-icao-standard-atmosphere-extended-to-80-kilometres-262500-feet-doc-7488[ICAO Doc 7488/3].
|
412
917
|
|
918
|
+
All YAML tables generated contain these two keys which group altitude values
|
919
|
+
as the ISO 2533 tables are rendered in both types of altitudes:
|
413
920
|
|
414
|
-
|
921
|
+
* `by-geopotential-altitude`
|
922
|
+
* `by-geometric-altitude`
|
415
923
|
|
416
|
-
|
924
|
+
The `Iso25332025` class provides the following methods to generate tables:
|
925
|
+
|
926
|
+
`table_atmosphere_meters`:: Atmosphere attributes by altitude (m). Grouped by
|
927
|
+
`by-geopotential-altitude` and `by-geometric-altitude`. Each entry underneath is
|
928
|
+
an `AltitudeAttrs` object. The altitude interval values follow these steps:
|
929
|
+
+
|
930
|
+
.Step 50 from -5k, 100 from 32k, 200 from 51k to 80k.
|
417
931
|
----
|
418
932
|
(-5000..31950).step(50) +
|
419
933
|
(32000..50900).step(100) +
|
420
934
|
(51000..80000).step(200)
|
421
935
|
----
|
422
936
|
|
423
|
-
|
937
|
+
`table_atmosphere_feet`:: Atmosphere attributes by altitude (ft). Grouped by
|
938
|
+
`by-geopotential-altitude` and `by-geometric-altitude`. Each entry underneath is
|
939
|
+
an `AltitudeAttrs` object. The altitude interval values follow these steps:
|
940
|
+
+
|
941
|
+
.Step 250 from -16500, 200 from -14000, 500 from 105000 to 262500
|
424
942
|
----
|
425
943
|
(-16500..-13750).step(250) +
|
426
944
|
(-14000..104800).step(200) +
|
427
945
|
(105000..262500).step(500)
|
428
946
|
----
|
429
947
|
|
430
|
-
|
948
|
+
`table_hypsometrical_altitude`:: Atmosphere attributes by altitude (m). This is
|
949
|
+
the same as `table_atmosphere_meters` except with a modified step.
|
950
|
+
+
|
951
|
+
.Step 1 from -1000 to 4599
|
952
|
+
----
|
953
|
+
(-1000..4599).step(1)
|
954
|
+
----
|
431
955
|
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
956
|
+
`table_hypsometrical_mbar`:: Hypsometrical table by pressure (mbar). This is a
|
957
|
+
table that provides altitude values per unit of pressure. Each entry underneath
|
958
|
+
is a `PressureAttrs` object. It follows this step schedule:
|
959
|
+
+
|
960
|
+
.Step 0.01 from 5 to 20, 0.1 from 20 to 1770.9
|
961
|
+
----
|
962
|
+
(5.0..19.99).step(0.01) +
|
963
|
+
(20.0..1770.9).step(0.1)
|
964
|
+
----
|
436
965
|
|
437
|
-
|
438
|
-
|
966
|
+
.Generating the ISO 2533:2025 tables
|
967
|
+
[example]
|
968
|
+
====
|
969
|
+
[source,ruby]
|
970
|
+
----
|
971
|
+
# Defaults to precision mode `:reduced`
|
972
|
+
Atmospheric::Export::Iso25332025.table_atmosphere_meters #=> Lutaml::Model
|
973
|
+
Atmospheric::Export::Iso25332025.table_atmosphere_meters.to_yaml #=> YAML
|
974
|
+
|
975
|
+
# To use precision mode `:high`
|
976
|
+
x = Atmospheric::Export::Iso25332025.table_atmosphere_meters(precision: :high)
|
977
|
+
x.to_yaml #=> YAML
|
978
|
+
----
|
979
|
+
====
|
980
|
+
|
981
|
+
The above table methods are used as the data sources for the data tables in ISO 2533:2025:
|
982
|
+
|
983
|
+
* `table_atmosphere_meters`: Table 5 (meters), Table 6 (meters), Table 7
|
984
|
+
(meters). This data table is split into 3 tables for readability reasons.
|
985
|
+
|
986
|
+
* `table_atmosphere_feet`: Table 8 (feet), Table 9 (feet), Table 10 (feet).
|
987
|
+
Similarly, this data table is split into 3 tables for readability reasons.
|
988
|
+
|
989
|
+
* `table_hypsometrical_altitude`: Table 11 (mbar).
|
990
|
+
|
991
|
+
* `table_hypsometrical_mbar`: Table 12 (geopotential), Table 13 (geometric).
|
439
992
|
|
440
|
-
* `by-geopotential-altitude`
|
441
|
-
* `by-geometric-altitude`
|
442
993
|
|
443
994
|
==== Table 5 (meters)
|
444
995
|
|
@@ -447,22 +998,9 @@ NOTE: This corresponds to ISO 2533:1975 Table 5 combined with ISO 2533:1975/ADD
|
|
447
998
|
|
448
999
|
Title:
|
449
1000
|
"_Temperature (T and t), Pressure (p), Density (p) and Acceleration of free fall
|
450
|
-
(g) in terms of
|
451
|
-
|
452
|
-
Provides the following values in addition to geopotential and geometric height:
|
1001
|
+
(g) in terms of geometric altitude (h) and geopotential altitude (H)_"
|
453
1002
|
|
454
|
-
|
455
|
-
* `temperature-C`
|
456
|
-
* `pressure-mbar`
|
457
|
-
* `pressure-mmhg`
|
458
|
-
* `density`
|
459
|
-
* `acceleration`
|
460
|
-
|
461
|
-
[source,ruby]
|
462
|
-
----
|
463
|
-
Atmospheric::Export::Iso25332024.table_5 #=> Hash
|
464
|
-
Atmospheric::Export::Iso25332024.table_5_yaml #=> YAML
|
465
|
-
----
|
1003
|
+
This table is a subset of the `table_atmosphere_meters` method.
|
466
1004
|
|
467
1005
|
==== Table 6 (meters)
|
468
1006
|
|
@@ -472,23 +1010,9 @@ NOTE: This corresponds to ISO 2533:1975 Table 6 combined with ISO 2533:1975/ADD
|
|
472
1010
|
Title:
|
473
1011
|
"_Relations of p'pn, p/pn and bar(p/pn), Speed of sound (a), Dynamic viscosity
|
474
1012
|
(p), Kinematic viscosity (v) and Thermal conductivity (lambda) in terms of
|
475
|
-
|
476
|
-
|
477
|
-
Provides the following values in addition to geopotential and geometric height:
|
478
|
-
|
479
|
-
* `ppn`
|
480
|
-
* `rhorhon`
|
481
|
-
* `sqrt-rhorhon`
|
482
|
-
* `speed-of-sound`
|
483
|
-
* `dynamic-viscosity`
|
484
|
-
* `kinematic-viscosity`
|
485
|
-
* `thermal-conductivity`
|
1013
|
+
geometric altitude (h), and geopotential altitude (H)_"
|
486
1014
|
|
487
|
-
|
488
|
-
----
|
489
|
-
Atmospheric::Export::Iso25332024.table_6 #=> Hash
|
490
|
-
Atmospheric::Export::Iso25332024.table_6_yaml #=> YAML
|
491
|
-
----
|
1015
|
+
This table is a subset of the `table_atmosphere_meters` method.
|
492
1016
|
|
493
1017
|
==== Table 7 (meters)
|
494
1018
|
|
@@ -498,21 +1022,10 @@ NOTE: This corresponds to ISO 2533:1975 Table 7 combined with ISO 2533:1975/ADD
|
|
498
1022
|
Title:
|
499
1023
|
"_Pressure scale height (H_p) Specific weight (gamma), Air number density (n),
|
500
1024
|
Mean air-particle speed (v), Air-particle collision frequency (omega) and Mean
|
501
|
-
free path of air particles (l) in terms of
|
1025
|
+
free path of air particles (l) in terms of geometric altitude (h) and
|
502
1026
|
geopotential altitude (H)_"
|
503
1027
|
|
504
|
-
|
505
|
-
* `specific-weight`
|
506
|
-
* `air-number-density`
|
507
|
-
* `mean-speed`
|
508
|
-
* `frequency`
|
509
|
-
* `mean-free-path`
|
510
|
-
|
511
|
-
[source,ruby]
|
512
|
-
----
|
513
|
-
Atmospheric::Export::Iso25332024.table_7 #=> Hash
|
514
|
-
Atmospheric::Export::Iso25332024.table_7_yaml #=> YAML
|
515
|
-
----
|
1028
|
+
This table is a subset of the `table_atmosphere_meters` method.
|
516
1029
|
|
517
1030
|
==== Table 8 (-16.5kft to 262.5kft)
|
518
1031
|
|
@@ -520,7 +1033,7 @@ NOTE: This corresponds to ISO 2533:1975/ADD 2:1997 Table 4.
|
|
520
1033
|
|
521
1034
|
Title:
|
522
1035
|
"_Temperature (T and t), pressure (p), density (p) and acceleration of free fall
|
523
|
-
(g) in terms of
|
1036
|
+
(g) in terms of geometric altitude (h) and geopotential altitude (H) --
|
524
1037
|
Altitudes in feet_"
|
525
1038
|
|
526
1039
|
Exactly same as ISO 2533:1975 Table 5, but in feet and different range.
|
@@ -528,11 +1041,7 @@ Exactly same as ISO 2533:1975 Table 5, but in feet and different range.
|
|
528
1041
|
Pressure at mmHg is not produced, but the implementation still provides it
|
529
1042
|
for completeness.
|
530
1043
|
|
531
|
-
|
532
|
-
----
|
533
|
-
Atmospheric::Export::Iso25332024.table_8 #=> Hash
|
534
|
-
Atmospheric::Export::Iso25332024.table_8_yaml #=> YAML
|
535
|
-
----
|
1044
|
+
This table is a subset of the `table_atmosphere_feet` method.
|
536
1045
|
|
537
1046
|
==== Table 9 (-16.5kft to 262.5kft)
|
538
1047
|
|
@@ -541,15 +1050,11 @@ NOTE: This corresponds to ISO 2533:1975/ADD 2:1997 Table 5.
|
|
541
1050
|
Title:
|
542
1051
|
"_Relations of p'pn, p/pn and bar(p/pn), Speed of sound (a), Dynamic viscosity
|
543
1052
|
(p), Kinematic viscosity (v) and Thermal conductivity (lambda) in terms of
|
544
|
-
|
1053
|
+
geometric altitude (h), and geopotential altitude (H) -- Altitudes in feet_"
|
545
1054
|
|
546
1055
|
Exactly same as ISO 2533:1975 Table 6, but in feet and different range.
|
547
1056
|
|
548
|
-
|
549
|
-
----
|
550
|
-
Atmospheric::Export::Iso25332024.table_9 #=> Hash
|
551
|
-
Atmospheric::Export::Iso25332024.table_9_yaml #=> YAML
|
552
|
-
----
|
1057
|
+
This table is a subset of the `table_atmosphere_feet` method.
|
553
1058
|
|
554
1059
|
==== Table 10 (-16.5kft to 262.5kft)
|
555
1060
|
|
@@ -558,19 +1063,15 @@ NOTE: This corresponds to ISO 2533:1975/ADD 2:1997 Table 6.
|
|
558
1063
|
Title:
|
559
1064
|
"_Pressure scale height (H_p) Specific weight (gamma), Air number density (n),
|
560
1065
|
Mean air-particle speed (v), Air-particle collision frequency (omega) and Mean
|
561
|
-
free path of air particles (l) in terms of
|
1066
|
+
free path of air particles (l) in terms of geometric altitude (h) and
|
562
1067
|
geopotential altitude (H) -- Altitudes in feet_"
|
563
1068
|
|
564
1069
|
Exactly same as ISO 2533:1975 Table 7, but in feet and different range.
|
565
1070
|
|
566
|
-
|
567
|
-
----
|
568
|
-
Atmospheric::Export::Iso25332024.table_10 #=> Hash
|
569
|
-
Atmospheric::Export::Iso25332024.table_10_yaml #=> YAML
|
570
|
-
----
|
1071
|
+
This table is a subset of the `table_atmosphere_feet` method.
|
571
1072
|
|
572
1073
|
|
573
|
-
==== Table 11 (
|
1074
|
+
==== Table 11 (mbar)
|
574
1075
|
|
575
1076
|
NOTE: This corresponds to ISO 2533:1975/ADD 1:1985 Table 1 combined with Table 2.
|
576
1077
|
|
@@ -584,6 +1085,7 @@ For the range of `(5.0..19.99).step(0.01) + (20.0..1199.9).step(0.1)` in hPa.
|
|
584
1085
|
Provides:
|
585
1086
|
|
586
1087
|
* `pressure-mbar`
|
1088
|
+
* `pressure-mmhg`
|
587
1089
|
* `geopotential-altitude-m`
|
588
1090
|
* `geopotential-altitude-ft`
|
589
1091
|
* `geometric-altitude-m`
|
@@ -591,67 +1093,67 @@ Provides:
|
|
591
1093
|
|
592
1094
|
[source,ruby]
|
593
1095
|
----
|
594
|
-
|
595
|
-
Atmospheric::Export::
|
1096
|
+
# Defaults to precision mode `:reduced`
|
1097
|
+
Atmospheric::Export::Iso25332025.table_hypsometrical_mbar #=> Lutaml::Model
|
1098
|
+
Atmospheric::Export::Iso25332025.table_hypsometrical_mbar.to_yaml #=> YAML
|
1099
|
+
|
1100
|
+
# To use precision mode `:high`
|
1101
|
+
x = Atmospheric::Export::Iso25332025.table_hypsometrical_mbar(precision: :high)
|
1102
|
+
x.to_yaml #=> YAML
|
596
1103
|
----
|
597
1104
|
|
598
1105
|
|
599
|
-
==== Table 12 (
|
1106
|
+
==== Table 12 (geopotential altitude, m)
|
600
1107
|
|
601
|
-
NOTE: This corresponds to ISO 2533:1975/ADD 1:1985 Table 5 but in
|
1108
|
+
NOTE: This corresponds to ISO 2533:1975/ADD 1:1985 Table 5 but in geopotential altitude.
|
602
1109
|
|
603
1110
|
Title:
|
604
|
-
"_Barometric pressure, in hectopascals, as a function of
|
1111
|
+
"_Barometric pressure, in hectopascals, as a function of geopotential altitude
|
605
1112
|
for -1000 <= H < +4600 m at intervals of 1m_"
|
606
1113
|
|
607
|
-
|
608
|
-
|
609
|
-
* `geometric-altitude-m`
|
610
|
-
* `pressure-mbar`
|
611
|
-
* `pressure-mmhg`
|
612
|
-
|
613
|
-
Range of `(-1000..4599).step(1)`.
|
1114
|
+
This table is a subset of the `table_atmosphere_meters` method.
|
614
1115
|
|
615
|
-
[source,ruby]
|
616
|
-
----
|
617
|
-
Atmospheric::Export::Iso25332024.table_12 #=> Hash
|
618
|
-
Atmospheric::Export::Iso25332024.table_12_yaml #=> YAML
|
619
|
-
----
|
620
1116
|
|
621
|
-
==== Table 13 (
|
1117
|
+
==== Table 13 (geometric altitude, m)
|
622
1118
|
|
623
|
-
NOTE: This corresponds to ISO 2533:1975/ADD 1:1985 Table 5, in
|
1119
|
+
NOTE: This corresponds to ISO 2533:1975/ADD 1:1985 Table 5, in geometric altitude.
|
624
1120
|
|
625
1121
|
Title:
|
626
|
-
"_Barometric pressure, in hectopascals, as a function of
|
1122
|
+
"_Barometric pressure, in hectopascals, as a function of geometric altitude
|
627
1123
|
for -1000 <= H < +4600 m at intervals of 1m_"
|
628
1124
|
|
629
|
-
|
1125
|
+
This table is a subset of the `table_atmosphere_meters` method.
|
630
1126
|
|
631
|
-
* `geopotential-altitude-m`
|
632
|
-
* `pressure-mbar`
|
633
|
-
* `pressure-mmhg`
|
634
1127
|
|
635
|
-
Range of `(-1000..4599).step(1)`.
|
636
1128
|
|
637
|
-
|
1129
|
+
== Testing
|
1130
|
+
|
1131
|
+
=== General
|
1132
|
+
|
1133
|
+
[source,sh]
|
638
1134
|
----
|
639
|
-
|
640
|
-
Atmospheric::Export::Iso25332024.table_13_yaml #=> YAML
|
1135
|
+
$ bundle exec rake
|
641
1136
|
----
|
642
1137
|
|
1138
|
+
=== Re-generate fixture tables
|
643
1139
|
|
1140
|
+
The `spec/fixtures/iso*` directories contains YAML files that are used to
|
1141
|
+
generate the ISO 2533 tables.
|
644
1142
|
|
645
|
-
|
1143
|
+
To re-generate the tables, run:
|
646
1144
|
|
647
1145
|
[source,sh]
|
648
1146
|
----
|
649
|
-
$
|
1147
|
+
$ bundle exec rake clean generate
|
650
1148
|
----
|
651
1149
|
|
1150
|
+
These tasks are defined in the `Rakefile`.
|
1151
|
+
|
1152
|
+
=== Algorithms
|
1153
|
+
|
652
1154
|
Tests are encoded in `spec/fixtures/tests.yml` in the following format:
|
653
1155
|
|
654
|
-
[source,
|
1156
|
+
[source,yaml]
|
655
1157
|
----
|
656
1158
|
- H: -2000.0
|
657
1159
|
h: -1999.0
|
@@ -687,7 +1189,3 @@ It is used to generate all the other values.
|
|
687
1189
|
|
688
1190
|
Copyright Ribose.
|
689
1191
|
|
690
|
-
|
691
|
-
== TODO
|
692
|
-
|
693
|
-
* expose this as a plugin to LutaML / Metanorma YAML2text
|