atmospheric 0.1.0 → 0.2.0
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/README.adoc +317 -19
- data/lib/atmospheric/export/hypsometrical_tables.rb +139 -0
- data/lib/atmospheric/export/iso_25331975/group_base.rb +72 -0
- data/lib/atmospheric/export/iso_25331975/group_one.rb +36 -0
- data/lib/atmospheric/export/iso_25331975/group_three.rb +37 -0
- data/lib/atmospheric/export/iso_25331975/group_two.rb +38 -0
- data/lib/atmospheric/export/iso_25331975.rb +37 -0
- data/lib/atmospheric/export/iso_25331997.rb +105 -0
- data/lib/atmospheric/export/target.rb +32 -0
- data/lib/atmospheric/export.rb +8 -0
- data/lib/atmospheric/isa.rb +166 -89
- data/lib/atmospheric/version.rb +1 -1
- data/lib/atmospheric.rb +1 -0
- data/spec/fixtures/iso-2533-1975-table5.yaml +6036 -6036
- data/spec/fixtures/iso-2533-1975-table6.yaml +12192 -12201
- data/spec/fixtures/iso-2533-1975-table7.yaml +8128 -8128
- metadata +33 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5cf182abde57d7742252da9f6915f59c249f57333de7621099e4b075acef11b0
|
4
|
+
data.tar.gz: 4ee5305a1d85db54d25f576439b03905bda62d068f2c00208fa3dc1e63e7d8ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5030dc98cd819232d7ace9d4771de89146746640977cb4f29a5a0c6f2759abf86117b7d4f52c8f0cdf58c78171997545ac886e114d084c6a625188b20cb2f3f7
|
7
|
+
data.tar.gz: 250a571ecfc2e526eee7176eabd35a716e9c9e366b7149afad9dbb299056b5af94cbf0f2d89b055808627d2c62b45b5e7ead030b6fba8f2c82d49bfc7d65a687
|
data/README.adoc
CHANGED
@@ -13,6 +13,8 @@ units (the ICAO document includes `ft` in addition to `m`).
|
|
13
13
|
|
14
14
|
== Usage
|
15
15
|
|
16
|
+
=== Formulas and calculations
|
17
|
+
|
16
18
|
[source,ruby]
|
17
19
|
----
|
18
20
|
> require 'atmospheric'
|
@@ -24,25 +26,322 @@ The available methods are:
|
|
24
26
|
|
25
27
|
* `geometric_altitude_from_geopotential(geopotential_altitude)`
|
26
28
|
* `geopotential_altitude_from_geometric(geometric_altitude)`
|
27
|
-
* `
|
29
|
+
* `temperature_at_layer_from_geopotential(geopotential_altitude)`
|
28
30
|
* `temperature_at_layer_celcius(geopotential_altitude)`
|
29
|
-
* `
|
30
|
-
* `
|
31
|
-
* `
|
31
|
+
* `pressure_from_geopotential_mbar(geopotential_altitude)`
|
32
|
+
* `pressure_from_geopotential_mmhg(geopotential_altitude)`
|
33
|
+
* `density_from_geopotential(geopotential_altitude)`
|
32
34
|
* `gravity_at_geopotential(geopotential_altitude)`
|
33
|
-
* `
|
34
|
-
* `
|
35
|
-
* `
|
36
|
-
* `
|
37
|
-
* `
|
38
|
-
* `
|
39
|
-
* `
|
40
|
-
* `
|
41
|
-
* `
|
42
|
-
* `
|
43
|
-
* `
|
44
|
-
* `
|
45
|
-
* `
|
35
|
+
* `p_p_n_from_geopotential(geopotential_altitude)`
|
36
|
+
* `rho_rho_n_from_geopotential(geopotential_altitude)`
|
37
|
+
* `root_rho_rho_n_from_geopotential(geopotential_altitude)`
|
38
|
+
* `speed_of_sound_from_geopotential(geopotential_altitude)`
|
39
|
+
* `dynamic_viscosity_from_geopotential(geopotential_altitude)`
|
40
|
+
* `kinematic_viscosity_from_geopotential(geopotential_altitude)`
|
41
|
+
* `thermal_conductivity_from_geopotential(geopotential_altitude)`
|
42
|
+
* `pressure_scale_height_from_geopotential(geopotential_altitude)`
|
43
|
+
* `specific_weight_from_geopotential(geopotential_altitude)`
|
44
|
+
* `air_number_density_from_geopotential(geopotential_altitude)`
|
45
|
+
* `mean_air_particle_speed_from_geopotential(geopotential_altitude)`
|
46
|
+
* `air_particle_collision_frequency_from_geopotential(geopotential_altitude)`
|
47
|
+
* `mean_free_path_of_air_particles_from_geopotential(geopotential_altitude)`
|
48
|
+
|
49
|
+
|
50
|
+
== Generating ISO 2533 tables
|
51
|
+
|
52
|
+
=== ISO 2533:1975
|
53
|
+
|
54
|
+
All tables in the 1975 edition are arranged in these steps in meters:
|
55
|
+
|
56
|
+
.ISO 2533:1975 table range: step 50 from -2k, 100 above 32k, 200 above 51k to 80k
|
57
|
+
----
|
58
|
+
(-2000..31999).step(50) +
|
59
|
+
(32000..50999).step(100) +
|
60
|
+
(51000..80000).step(200)
|
61
|
+
----
|
62
|
+
|
63
|
+
Tables 5 to 7 all have height information of the following keys in the hash:
|
64
|
+
|
65
|
+
* `geopotential-altitude-m`
|
66
|
+
* `geopotential-altitude-ft`
|
67
|
+
* `geometrical-altitude-m`
|
68
|
+
* `geometrical-altitude-ft`
|
69
|
+
|
70
|
+
==== Table 5
|
71
|
+
|
72
|
+
Title:
|
73
|
+
"_Temperature (T and t), Pressure (p), Density (p) and Acceleration of free fall
|
74
|
+
(g) in terms of geometrical altitude (h) and geopotential altitude (H)_"
|
75
|
+
|
76
|
+
Provides the following values in addition to geopotential and geometric height:
|
77
|
+
|
78
|
+
* `temperature-K`
|
79
|
+
* `temperature-C`
|
80
|
+
* `pressure-mbar`
|
81
|
+
* `pressure-mmHg`
|
82
|
+
* `density`
|
83
|
+
* `acceleration`
|
84
|
+
|
85
|
+
[source,ruby]
|
86
|
+
----
|
87
|
+
Atmospheric::Export::Iso25331975.table_5 #=> Hash
|
88
|
+
Atmospheric::Export::Iso25331975.table_5_yaml #=> YAML
|
89
|
+
----
|
90
|
+
|
91
|
+
==== Table 6
|
92
|
+
|
93
|
+
Title:
|
94
|
+
"_Relations of p'pn, p/pn and bar(p/pn), Speed of sound (a), Dynamic viscosity
|
95
|
+
(p), Kinematic viscosity (v) and Thermal conductivity (lambda) in terms of
|
96
|
+
geometrical altitude (h), and geopotential altitude (H)_"
|
97
|
+
|
98
|
+
Provides the following values in addition to geopotential and geometric height:
|
99
|
+
|
100
|
+
* `ppn`
|
101
|
+
* `rhorhon`
|
102
|
+
* `sqrt-rhorhon`
|
103
|
+
* `speed-of-sound`
|
104
|
+
* `dynamic-viscosity`
|
105
|
+
* `kinematic-viscosity`
|
106
|
+
* `thermal-conductivity`
|
107
|
+
|
108
|
+
[source,ruby]
|
109
|
+
----
|
110
|
+
Atmospheric::Export::Iso25331975.table_6 #=> Hash
|
111
|
+
Atmospheric::Export::Iso25331975.table_6_yaml #=> YAML
|
112
|
+
----
|
113
|
+
|
114
|
+
==== Table 7
|
115
|
+
|
116
|
+
Title:
|
117
|
+
"_Pressure scale height (H_p) Specific weight (gamma), Air number density (n),
|
118
|
+
Mean air-particle speed (v), Air-particle collision frequency (omega) and Mean
|
119
|
+
free path of air particles (l) in terms of geometrical altitude (h) and
|
120
|
+
geopotential altitude (H)_"
|
121
|
+
|
122
|
+
* `pressure-scale-height`
|
123
|
+
* `specific-weight`
|
124
|
+
* `air-number-density`
|
125
|
+
* `mean-speed`
|
126
|
+
* `frequency`
|
127
|
+
* `mean-free-path`
|
128
|
+
|
129
|
+
[source,ruby]
|
130
|
+
----
|
131
|
+
Atmospheric::Export::Iso25331975.table_7 #=> Hash
|
132
|
+
Atmospheric::Export::Iso25331975.table_7_yaml #=> YAML
|
133
|
+
----
|
134
|
+
|
135
|
+
|
136
|
+
=== ISO 2533 ADD 1:1985
|
137
|
+
|
138
|
+
Addendum 1 adds "Hypsometrical tables".
|
139
|
+
|
140
|
+
==== Table 1 (hPa)
|
141
|
+
|
142
|
+
Title:
|
143
|
+
"_Geopotential altitude as a function of barometric pressure
|
144
|
+
for 5 <= p < 20 hPa at intervals of 0.01 hPa_"
|
145
|
+
|
146
|
+
For the range of `(5.0..19.99).step(0.01)` in hPa.
|
147
|
+
|
148
|
+
Provides:
|
149
|
+
|
150
|
+
* `pressure-mbar`
|
151
|
+
* `geopotential-altitude`
|
152
|
+
|
153
|
+
[source,ruby]
|
154
|
+
----
|
155
|
+
Atmospheric::Export::HypsometricalTables.table_1 #=> Hash
|
156
|
+
Atmospheric::Export::HypsometricalTables.table_1_yaml #=> YAML
|
157
|
+
----
|
158
|
+
|
159
|
+
==== Table 2 (hPa)
|
160
|
+
|
161
|
+
Title:
|
162
|
+
"_Geopotential altitude as a function of barometric pressure
|
163
|
+
for 20 <= p < 1200 hPa at intervals of 0.1 hPa_"
|
164
|
+
|
165
|
+
Same as Table 1 but for the range of `(20.0..1199.9).step(0.1)` in hPa.
|
166
|
+
|
167
|
+
[source,ruby]
|
168
|
+
----
|
169
|
+
Atmospheric::Export::HypsometricalTables.table_2 #=> Hash
|
170
|
+
Atmospheric::Export::HypsometricalTables.table_2_yaml #=> YAML
|
171
|
+
----
|
172
|
+
|
173
|
+
==== Table 3 (mmHg)
|
174
|
+
|
175
|
+
Title:
|
176
|
+
"_Geopotential altitude as a function of barometric pressure for 4 <= p < 10
|
177
|
+
mmHg at intervals of 0.01 mmHg_"
|
178
|
+
|
179
|
+
Same as Table 1 but for the range of `(4.0..9.99).step(0.01)` and results in mmhg.
|
180
|
+
|
181
|
+
Provides:
|
182
|
+
|
183
|
+
* `pressure-mmhg`
|
184
|
+
* `geopotential-altitude`
|
185
|
+
|
186
|
+
[source,ruby]
|
187
|
+
----
|
188
|
+
Atmospheric::Export::HypsometricalTables.table_3 #=> Hash
|
189
|
+
Atmospheric::Export::HypsometricalTables.table_3_yaml #=> YAML
|
190
|
+
----
|
191
|
+
|
192
|
+
==== Table 4 (mmHg)
|
193
|
+
|
194
|
+
Title:
|
195
|
+
"_Geopotential altitude as a function of barometric pressure for 10 <= p < 900
|
196
|
+
mmHg at intervals of 0.1 mmHg_"
|
197
|
+
|
198
|
+
Same as Table 3 but for the range of `(10.0..899.9).step(0.1)` and results in mmhg.
|
199
|
+
|
200
|
+
[source,ruby]
|
201
|
+
----
|
202
|
+
Atmospheric::Export::HypsometricalTables.table_4 #=> Hash
|
203
|
+
Atmospheric::Export::HypsometricalTables.table_4_yaml #=> YAML
|
204
|
+
----
|
205
|
+
|
206
|
+
==== Table 5 (hPa) and Table 6 (mmHg)
|
207
|
+
|
208
|
+
The difference is Table 5 is in hPa while Table 6 is in mmHg.
|
209
|
+
|
210
|
+
Title:
|
211
|
+
"_Barometric pressure, in hectopascals, as a function of geopotential altitude
|
212
|
+
for -1000 <= H < +4600 m at intervals of 1m_"
|
213
|
+
|
214
|
+
Provides:
|
215
|
+
|
216
|
+
* `geopotential-altitude`
|
217
|
+
* `pressure-mbar`
|
218
|
+
* `pressure-mmhg`
|
219
|
+
|
220
|
+
Range of `(-1000..4599).step(1)`.
|
221
|
+
|
222
|
+
[source,ruby]
|
223
|
+
----
|
224
|
+
Atmospheric::Export::HypsometricalTables.table_56 #=> Hash
|
225
|
+
Atmospheric::Export::HypsometricalTables.table_56_yaml #=> YAML
|
226
|
+
----
|
227
|
+
|
228
|
+
=== ISO 2533 ADD 2:1997
|
229
|
+
|
230
|
+
Addendum 2 is exactly like ISO 2533:1975 with the tables but extended the tables:
|
231
|
+
|
232
|
+
* 1975's range is -2km to 80km. 1997 provides -5km to 2km (yes -2km to 2km overlaps...)
|
233
|
+
* 1975 tables only provide H and h in meters. 1997 adds a lookup table of H and h in feet.
|
234
|
+
|
235
|
+
.ISO 2533 ADD 2:1997 Tables 1 to 3 have height range in meters
|
236
|
+
----
|
237
|
+
(-5000..2000).step(50)
|
238
|
+
----
|
239
|
+
|
240
|
+
.ISO 2533 ADD 2:1997 Tables 4 to 6 have height range in feet
|
241
|
+
----
|
242
|
+
(-16500..-13999).step(250) +
|
243
|
+
(-14000..104999).step(200) +
|
244
|
+
(105000..262500).step(500)
|
245
|
+
----
|
246
|
+
|
247
|
+
|
248
|
+
==== Table 1 (-5km to 2km)
|
249
|
+
|
250
|
+
Title:
|
251
|
+
"_Temperature (T and t), pressure (p), density (p) and acceleration of free fall
|
252
|
+
(g) in terms of geometrical altitude (h) and geopotential altitude (H) --
|
253
|
+
Altitudes in metres_"
|
254
|
+
|
255
|
+
Exactly same as ISO 2533:1975 Table 5, but with a different height range.
|
256
|
+
|
257
|
+
In addition, pressure at mmHg is no longer produced, but the implementation
|
258
|
+
still provides it for completeness.
|
259
|
+
|
260
|
+
[source,ruby]
|
261
|
+
----
|
262
|
+
Atmospheric::Export::Iso25331997.table_1 #=> Hash
|
263
|
+
Atmospheric::Export::Iso25331997.table_1_yaml #=> YAML
|
264
|
+
----
|
265
|
+
|
266
|
+
==== Table 2 (-5km to 2km)
|
267
|
+
|
268
|
+
Title:
|
269
|
+
"_Relations of p'pn, p/pn and bar(p/pn), Speed of sound (a), Dynamic viscosity
|
270
|
+
(p), Kinematic viscosity (v) and Thermal conductivity (lambda) in terms of
|
271
|
+
geometrical altitude (h), and geopotential altitude (H) -- Altitudes in metres_"
|
272
|
+
|
273
|
+
Exactly same as ISO 2533:1975 Table 6, but with a different height range.
|
274
|
+
|
275
|
+
[source,ruby]
|
276
|
+
----
|
277
|
+
Atmospheric::Export::Iso25331997.table_2 #=> Hash
|
278
|
+
Atmospheric::Export::Iso25331997.table_2_yaml #=> YAML
|
279
|
+
----
|
280
|
+
|
281
|
+
==== Table 3 (-5km to 2km)
|
282
|
+
|
283
|
+
Title:
|
284
|
+
"_Pressure scale height (H_p) Specific weight (gamma), Air number density (n),
|
285
|
+
Mean air-particle speed (v), Air-particle collision frequency (omega) and Mean
|
286
|
+
free path of air particles (l) in terms of geometrical altitude (h) and
|
287
|
+
geopotential altitude (H) -- Altitudes in metres_"
|
288
|
+
|
289
|
+
Exactly same as ISO 2533:1975 Table 7, but with a different height range.
|
290
|
+
|
291
|
+
[source,ruby]
|
292
|
+
----
|
293
|
+
Atmospheric::Export::Iso25331997.table_3 #=> Hash
|
294
|
+
Atmospheric::Export::Iso25331997.table_3_yaml #=> YAML
|
295
|
+
----
|
296
|
+
|
297
|
+
==== Table 4 (-16.5kft to 262.5kft)
|
298
|
+
|
299
|
+
Title:
|
300
|
+
"_Temperature (T and t), pressure (p), density (p) and acceleration of free fall
|
301
|
+
(g) in terms of geometrical altitude (h) and geopotential altitude (H) --
|
302
|
+
Altitudes in feet_"
|
303
|
+
|
304
|
+
Exactly same as ISO 2533:1975 Table 5, but in feet and different range.
|
305
|
+
|
306
|
+
Pressure at mmHg is not produced, but the implementation still provides it
|
307
|
+
for completeness.
|
308
|
+
|
309
|
+
[source,ruby]
|
310
|
+
----
|
311
|
+
Atmospheric::Export::Iso25331997.table_4 #=> Hash
|
312
|
+
Atmospheric::Export::Iso25331997.table_4_yaml #=> YAML
|
313
|
+
----
|
314
|
+
|
315
|
+
==== Table 5 (-16.5kft to 262.5kft)
|
316
|
+
|
317
|
+
Title:
|
318
|
+
"_Relations of p'pn, p/pn and bar(p/pn), Speed of sound (a), Dynamic viscosity
|
319
|
+
(p), Kinematic viscosity (v) and Thermal conductivity (lambda) in terms of
|
320
|
+
geometrical altitude (h), and geopotential altitude (H) -- Altitudes in feet_"
|
321
|
+
|
322
|
+
Exactly same as ISO 2533:1975 Table 6, but in feet and different range.
|
323
|
+
|
324
|
+
[source,ruby]
|
325
|
+
----
|
326
|
+
Atmospheric::Export::Iso25331997.table_5 #=> Hash
|
327
|
+
Atmospheric::Export::Iso25331997.table_5_yaml #=> YAML
|
328
|
+
----
|
329
|
+
|
330
|
+
==== Table 6 (-16.5kft to 262.5kft)
|
331
|
+
|
332
|
+
Title:
|
333
|
+
"_Pressure scale height (H_p) Specific weight (gamma), Air number density (n),
|
334
|
+
Mean air-particle speed (v), Air-particle collision frequency (omega) and Mean
|
335
|
+
free path of air particles (l) in terms of geometrical altitude (h) and
|
336
|
+
geopotential altitude (H) -- Altitudes in feet_"
|
337
|
+
|
338
|
+
Exactly same as ISO 2533:1975 Table 7, but in feet and different range.
|
339
|
+
|
340
|
+
[source,ruby]
|
341
|
+
----
|
342
|
+
Atmospheric::Export::Iso25331997.table_6 #=> Hash
|
343
|
+
Atmospheric::Export::Iso25331997.table_6_yaml #=> YAML
|
344
|
+
----
|
46
345
|
|
47
346
|
|
48
347
|
== Testing
|
@@ -88,10 +387,9 @@ It is used to generate all the other values.
|
|
88
387
|
|
89
388
|
== License
|
90
389
|
|
91
|
-
Copyright Ribose
|
390
|
+
Copyright Ribose.
|
92
391
|
|
93
392
|
|
94
393
|
== TODO
|
95
394
|
|
96
|
-
* make into module
|
97
395
|
* expose this as a plugin to LutaML / Metanorma YAML2text
|
@@ -0,0 +1,139 @@
|
|
1
|
+
require_relative "./target"
|
2
|
+
|
3
|
+
module Atmospheric
|
4
|
+
module Export
|
5
|
+
|
6
|
+
module HypsometricalTables
|
7
|
+
class TableBase
|
8
|
+
include Target
|
9
|
+
|
10
|
+
def to_h
|
11
|
+
d = { "rows" => [] }
|
12
|
+
steps.each do |p|
|
13
|
+
d["rows"] << row(p)
|
14
|
+
end
|
15
|
+
d
|
16
|
+
end
|
17
|
+
|
18
|
+
def steps
|
19
|
+
(0..0)
|
20
|
+
end
|
21
|
+
|
22
|
+
def row(p)
|
23
|
+
{}
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
class TableOne < TableBase
|
28
|
+
def steps
|
29
|
+
(5.0..19.99).step(0.01)
|
30
|
+
end
|
31
|
+
|
32
|
+
def row(p)
|
33
|
+
{
|
34
|
+
"pressure-mbar" => p.round(2),
|
35
|
+
"geopotential-altitude" => Isa.geopotential_altitude_from_pressure_mbar(p.round(2)).round,
|
36
|
+
}
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
class TableTwo < TableBase
|
41
|
+
def steps
|
42
|
+
(20.0..1199.9).step(0.1)
|
43
|
+
end
|
44
|
+
|
45
|
+
def row(p)
|
46
|
+
{
|
47
|
+
"pressure-mbar" => p.round(1),
|
48
|
+
"geopotential-altitude" => Isa.geopotential_altitude_from_pressure_mbar(p.round(1)).round,
|
49
|
+
}
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
class TableThree < TableBase
|
54
|
+
def steps
|
55
|
+
(4.0..9.99).step(0.01)
|
56
|
+
end
|
57
|
+
|
58
|
+
def row(p)
|
59
|
+
{
|
60
|
+
"pressure-mmhg" => p.round(2),
|
61
|
+
"geopotential-altitude" => Isa.geopotential_altitude_from_pressure_mmhg(p.round(2)).round,
|
62
|
+
}
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
class TableFour < TableBase
|
67
|
+
def steps
|
68
|
+
(10.0..899.9).step(0.1)
|
69
|
+
end
|
70
|
+
|
71
|
+
def row(p)
|
72
|
+
{
|
73
|
+
"pressure-mmhg" => p.round(1),
|
74
|
+
"geopotential-altitude" => Isa.geopotential_altitude_from_pressure_mmhg(p.round(1)).round,
|
75
|
+
}
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
class TableFiveSix < TableBase
|
80
|
+
def steps
|
81
|
+
(-1000..4599).step(1)
|
82
|
+
end
|
83
|
+
|
84
|
+
def row(h)
|
85
|
+
{
|
86
|
+
"geopotential-altitude" => h,
|
87
|
+
"pressure-mbar" => round_to_sig_figs(Isa.pressure_from_geopotential_mbar(h.to_f), 6),
|
88
|
+
"pressure-mmhg" => round_to_sig_figs(Isa.pressure_from_geopotential_mmhg(h.to_f), 6),
|
89
|
+
}
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
class << self
|
94
|
+
|
95
|
+
def table_1
|
96
|
+
TableOne.new.to_h
|
97
|
+
end
|
98
|
+
|
99
|
+
def table_1_yaml
|
100
|
+
TableOne.new.to_yaml
|
101
|
+
end
|
102
|
+
|
103
|
+
def table_2
|
104
|
+
TableTwo.new.to_h
|
105
|
+
end
|
106
|
+
|
107
|
+
def table_2_yaml
|
108
|
+
TableTwo.new.to_yaml
|
109
|
+
end
|
110
|
+
|
111
|
+
def table_3
|
112
|
+
TableThree.new.to_h
|
113
|
+
end
|
114
|
+
|
115
|
+
def table_3_yaml
|
116
|
+
TableThree.new.to_yaml
|
117
|
+
end
|
118
|
+
|
119
|
+
def table_4
|
120
|
+
TableFour.new.to_h
|
121
|
+
end
|
122
|
+
|
123
|
+
def table_4_yaml
|
124
|
+
TableFour.new.to_yaml
|
125
|
+
end
|
126
|
+
|
127
|
+
def table_56
|
128
|
+
TableFiveSix.new.to_h
|
129
|
+
end
|
130
|
+
|
131
|
+
def table_56_yaml
|
132
|
+
TableFiveSix.new.to_yaml
|
133
|
+
end
|
134
|
+
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
end
|
139
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require_relative "../target"
|
2
|
+
|
3
|
+
module Atmospheric
|
4
|
+
module Export
|
5
|
+
module Iso25331975
|
6
|
+
class GroupBase
|
7
|
+
include Target
|
8
|
+
|
9
|
+
def row_big_h(h, unit: :meters)
|
10
|
+
hgpm, hgpf = values_in_m_ft(h, unit: unit)
|
11
|
+
hgmm = Isa.geometric_altitude_from_geopotential(hgpm)
|
12
|
+
hgmf = m_to_ft(hgmm).round
|
13
|
+
height_hash(hgmm, hgmf, hgpm, hgpf)
|
14
|
+
.merge(self.row_from_geopotential(hgpm))
|
15
|
+
end
|
16
|
+
|
17
|
+
def row_small_h(h, unit: :meters)
|
18
|
+
hgmm, hgmf = values_in_m_ft(h, unit: unit)
|
19
|
+
hgpm = Isa.geopotential_altitude_from_geometric(hgmm)
|
20
|
+
hgpf = m_to_ft(hgpm).round
|
21
|
+
height_hash(hgmm, hgmf, hgpm, hgpf)
|
22
|
+
.merge(self.row_from_geopotential(hgpm))
|
23
|
+
end
|
24
|
+
|
25
|
+
def height_hash(hgmm, hgmf, hgpm, hgpf)
|
26
|
+
{
|
27
|
+
"geopotential-altitude-m" => hgmm,
|
28
|
+
"geopotential-altitude-ft" => hgmf,
|
29
|
+
"geometrical-altitude-m" => hgpm.round,
|
30
|
+
"geometrical-altitude-ft" => hgpf.round,
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
def values_in_m_ft(value, unit: :meters)
|
35
|
+
case unit
|
36
|
+
when :meters
|
37
|
+
[value.to_f, m_to_ft(value)]
|
38
|
+
when :feet
|
39
|
+
[ft_to_m(value), value.to_f]
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
# Step 50 from -2k to 40k, step 100 above 32k, 200 above 51k to 80k
|
44
|
+
def steps
|
45
|
+
(
|
46
|
+
(-2000..31999).step(50) +
|
47
|
+
(32000..50999).step(100) +
|
48
|
+
(51000..80000).step(200)
|
49
|
+
)
|
50
|
+
end
|
51
|
+
|
52
|
+
def steps_unit
|
53
|
+
:meters
|
54
|
+
end
|
55
|
+
|
56
|
+
def to_h(unit: steps_unit)
|
57
|
+
d = {
|
58
|
+
"rows-h" => [],
|
59
|
+
"rows-H" => []
|
60
|
+
}
|
61
|
+
|
62
|
+
steps.each do |h|
|
63
|
+
d["rows-h"] << row_small_h(h, unit: unit)
|
64
|
+
d["rows-H"] << row_big_h(h, unit: unit)
|
65
|
+
end
|
66
|
+
d
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require_relative "./group_base"
|
2
|
+
# rubocop:disable Metrics/AbcSize
|
3
|
+
# rubocop:disable Metrics/BlockLength
|
4
|
+
# rubocop:disable Metrics/CyclomaticComplexity
|
5
|
+
# rubocop:disable Metrics/MethodLength
|
6
|
+
# rubocop:disable Metrics/PerceivedComplexity
|
7
|
+
# rubocop:disable Layout/LineLength
|
8
|
+
# rubocop:disable Layout/HashAlignment
|
9
|
+
module Atmospheric
|
10
|
+
module Export
|
11
|
+
module Iso25331975
|
12
|
+
|
13
|
+
class GroupOne < GroupBase
|
14
|
+
# In meters only
|
15
|
+
def row_from_geopotential(gp_h_f)
|
16
|
+
{
|
17
|
+
"temperature-K" => (Isa.temperature_at_layer_from_geopotential(gp_h_f) * 1000.0).round,
|
18
|
+
"temperature-C" => (Isa.temperature_at_layer_celcius(gp_h_f) * 1000.0).round,
|
19
|
+
"pressure-mbar" => round_to_sig_figs(Isa.pressure_from_geopotential_mbar(gp_h_f), 6),
|
20
|
+
"pressure-mmHg" => round_to_sig_figs(Isa.pressure_from_geopotential_mmhg(gp_h_f), 6),
|
21
|
+
"density" => round_to_sig_figs(Isa.density_from_geopotential(gp_h_f), 6),
|
22
|
+
"acceleration" => Isa.gravity_at_geopotential(gp_h_f).round(4),
|
23
|
+
}
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
30
|
+
# rubocop:enable Metrics/AbcSize
|
31
|
+
# rubocop:enable Metrics/BlockLength
|
32
|
+
# rubocop:enable Metrics/CyclomaticComplexity
|
33
|
+
# rubocop:enable Metrics/MethodLength
|
34
|
+
# rubocop:enable Metrics/PerceivedComplexity
|
35
|
+
# rubocop:enable Layout/LineLength
|
36
|
+
# rubocop:enable Layout/HashAlignment
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require_relative "./group_base"
|
2
|
+
# rubocop:disable Metrics/AbcSize
|
3
|
+
# rubocop:disable Metrics/BlockLength
|
4
|
+
# rubocop:disable Metrics/CyclomaticComplexity
|
5
|
+
# rubocop:disable Metrics/MethodLength
|
6
|
+
# rubocop:disable Metrics/PerceivedComplexity
|
7
|
+
# rubocop:disable Layout/LineLength
|
8
|
+
# rubocop:disable Layout/HashAlignment
|
9
|
+
module Atmospheric
|
10
|
+
module Export
|
11
|
+
module Iso25331975
|
12
|
+
|
13
|
+
class GroupThree < GroupBase
|
14
|
+
# In meters only
|
15
|
+
def row_from_geopotential(gp_h_f)
|
16
|
+
{
|
17
|
+
"pressure-scale-height" => Isa.pressure_scale_height_from_geopotential(gp_h_f).round(1),
|
18
|
+
"specific-weight" => round_to_sig_figs(Isa.specific_weight_from_geopotential(gp_h_f), 5),
|
19
|
+
"air-number-density" => round_to_sig_figs(Isa.air_number_density_from_geopotential(gp_h_f), 5),
|
20
|
+
"mean-speed" => Isa.mean_air_particle_speed_from_geopotential(gp_h_f).round(2),
|
21
|
+
"frequency" => round_to_sig_figs(Isa.air_particle_collision_frequency_from_geopotential(gp_h_f), 5),
|
22
|
+
"mean-free-path" => round_to_sig_figs(Isa.mean_free_path_of_air_particles_from_geopotential(gp_h_f), 5),
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
31
|
+
# rubocop:enable Metrics/AbcSize
|
32
|
+
# rubocop:enable Metrics/BlockLength
|
33
|
+
# rubocop:enable Metrics/CyclomaticComplexity
|
34
|
+
# rubocop:enable Metrics/MethodLength
|
35
|
+
# rubocop:enable Metrics/PerceivedComplexity
|
36
|
+
# rubocop:enable Layout/LineLength
|
37
|
+
# rubocop:enable Layout/HashAlignment
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require_relative "./group_base"
|
2
|
+
# rubocop:disable Metrics/AbcSize
|
3
|
+
# rubocop:disable Metrics/BlockLength
|
4
|
+
# rubocop:disable Metrics/CyclomaticComplexity
|
5
|
+
# rubocop:disable Metrics/MethodLength
|
6
|
+
# rubocop:disable Metrics/PerceivedComplexity
|
7
|
+
# rubocop:disable Layout/LineLength
|
8
|
+
# rubocop:disable Layout/HashAlignment
|
9
|
+
module Atmospheric
|
10
|
+
module Export
|
11
|
+
module Iso25331975
|
12
|
+
|
13
|
+
class GroupTwo < GroupBase
|
14
|
+
# In meters only
|
15
|
+
def row_from_geopotential(gp_h_f)
|
16
|
+
{
|
17
|
+
"ppn" => round_to_sig_figs(Isa.p_p_n_from_geopotential(gp_h_f), 6),
|
18
|
+
"rhorhon" => round_to_sig_figs(Isa.rho_rho_n_from_geopotential(gp_h_f), 6),
|
19
|
+
"sqrt-rhorhon" => round_to_sig_figs(Isa.root_rho_rho_n_from_geopotential(gp_h_f), 6),
|
20
|
+
"speed-of-sound" => (Isa.speed_of_sound_from_geopotential(gp_h_f) * 1000.0).round,
|
21
|
+
"dynamic-viscosity" => round_to_sig_figs(Isa.dynamic_viscosity_from_geopotential(gp_h_f), 5),
|
22
|
+
"kinematic-viscosity" => round_to_sig_figs(Isa.kinematic_viscosity_from_geopotential(gp_h_f), 5),
|
23
|
+
"thermal-conductivity" => round_to_sig_figs(Isa.thermal_conductivity_from_geopotential(gp_h_f), 5),
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
# rubocop:enable Metrics/AbcSize
|
33
|
+
# rubocop:enable Metrics/BlockLength
|
34
|
+
# rubocop:enable Metrics/CyclomaticComplexity
|
35
|
+
# rubocop:enable Metrics/MethodLength
|
36
|
+
# rubocop:enable Metrics/PerceivedComplexity
|
37
|
+
# rubocop:enable Layout/LineLength
|
38
|
+
# rubocop:enable Layout/HashAlignment
|