atmospheric 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a79840dc839bcb8bc34dff87457e0438b340ae3f042f622e192c498a58350d6e
4
- data.tar.gz: 9937af10b863a3625ac9220ba0ee5cd9d29e932dba2a535e2840daf484532b3c
3
+ metadata.gz: bf95b194179f8f4a0842f86dfbd015d592ce5996724ab676e4c7c68ea91cf5ae
4
+ data.tar.gz: 993855f78a4953b7bc4c6086253e6df7c1fccf95168f2c5d8768daa95cc8a2bc
5
5
  SHA512:
6
- metadata.gz: '09a8e44dfecea5ff75f7a12430488e6cdb49ad0dd9db87efeb68be1bba2de1b4d1410ee083745e89cfb051d6843f13254069c68ed11ea90c0cb75dcbe4f2f21d'
7
- data.tar.gz: 21c712485bffb13371a9882ad501b64ef8c052ce9ea25c4a9fc7066c88563d9e66bec0f56ef408d357b6d8100c2290d957b977c996c3dcdad4ebde6dc80aa5f2
6
+ metadata.gz: b1cbe16fcfe115bb7070bdc1fa9b509a2dcc1c74f2de32637390fbcc64427e045531fba3f52097438ec71f17e61eac9a5a3199a8cd6f61b40e91bb51d8056c3b
7
+ data.tar.gz: 83871c6f2c5dc35dd4399563a4f69dad74e9a477c01af92dddefca66ca6bea8b8ac6562cf0b875ef2bafbc64975a3944b534e721bc3737871b6dfff0b9361ef5
data/README.adoc CHANGED
@@ -5,7 +5,8 @@
5
5
  This repository provides Ruby code for calculating values defined in the
6
6
  following documents:
7
7
 
8
- * International Standard Atmosphere (ISA) from ISO 2533:1975
8
+ * International Standard Atmosphere (ISA) from ISO 2533:1975,
9
+ ISO 2533:1975/ADD 1:1985 and ISO 2533:1975/ADD 2:1997
9
10
  * ICAO Standard Atmosphere (ICAO Doc 7488/3, 1994)
10
11
 
11
12
  Which are technically identical documents but different in presentation and
@@ -53,7 +54,7 @@ The available methods are:
53
54
 
54
55
  All tables in the 1975 edition are arranged in these steps in meters:
55
56
 
56
- .ISO 2533:1975 table range: step 50 from -2k, 100 above 32k, 200 above 51k to 80k
57
+ .ISO 2533:1975 table range: step 50 from -2k, 100 from 32k, 200 from 51k to 80k
57
58
  ----
58
59
  (-2000..31999).step(50) +
59
60
  (32000..50999).step(100) +
@@ -67,6 +68,12 @@ Tables 5 to 7 all have height information of the following keys in the hash:
67
68
  * `geometrical-altitude-m`
68
69
  * `geometrical-altitude-ft`
69
70
 
71
+ All YAML tables generated contain these two keys which group altitude values
72
+ as the ISO 2533 tables are rendered in both types of altitudes:
73
+
74
+ * `by-geopotential-altitude`
75
+ * `by-geometric-altitude`
76
+
70
77
  ==== Table 5
71
78
 
72
79
  Title:
@@ -78,7 +85,7 @@ Provides the following values in addition to geopotential and geometric height:
78
85
  * `temperature-K`
79
86
  * `temperature-C`
80
87
  * `pressure-mbar`
81
- * `pressure-mmHg`
88
+ * `pressure-mmhg`
82
89
  * `density`
83
90
  * `acceleration`
84
91
 
@@ -152,8 +159,8 @@ Provides:
152
159
 
153
160
  [source,ruby]
154
161
  ----
155
- Atmospheric::Export::HypsometricalTables.table_1 #=> Hash
156
- Atmospheric::Export::HypsometricalTables.table_1_yaml #=> YAML
162
+ Atmospheric::Export::Iso25331985.table_1 #=> Hash
163
+ Atmospheric::Export::Iso25331985.table_1_yaml #=> YAML
157
164
  ----
158
165
 
159
166
  ==== Table 2 (hPa)
@@ -166,8 +173,8 @@ Same as Table 1 but for the range of `(20.0..1199.9).step(0.1)` in hPa.
166
173
 
167
174
  [source,ruby]
168
175
  ----
169
- Atmospheric::Export::HypsometricalTables.table_2 #=> Hash
170
- Atmospheric::Export::HypsometricalTables.table_2_yaml #=> YAML
176
+ Atmospheric::Export::Iso25331985.table_2 #=> Hash
177
+ Atmospheric::Export::Iso25331985.table_2_yaml #=> YAML
171
178
  ----
172
179
 
173
180
  ==== Table 3 (mmHg)
@@ -185,8 +192,8 @@ Provides:
185
192
 
186
193
  [source,ruby]
187
194
  ----
188
- Atmospheric::Export::HypsometricalTables.table_3 #=> Hash
189
- Atmospheric::Export::HypsometricalTables.table_3_yaml #=> YAML
195
+ Atmospheric::Export::Iso25331985.table_3 #=> Hash
196
+ Atmospheric::Export::Iso25331985.table_3_yaml #=> YAML
190
197
  ----
191
198
 
192
199
  ==== Table 4 (mmHg)
@@ -199,8 +206,8 @@ Same as Table 3 but for the range of `(10.0..899.9).step(0.1)` and results in mm
199
206
 
200
207
  [source,ruby]
201
208
  ----
202
- Atmospheric::Export::HypsometricalTables.table_4 #=> Hash
203
- Atmospheric::Export::HypsometricalTables.table_4_yaml #=> YAML
209
+ Atmospheric::Export::Iso25331985.table_4 #=> Hash
210
+ Atmospheric::Export::Iso25331985.table_4_yaml #=> YAML
204
211
  ----
205
212
 
206
213
  ==== Table 5 (hPa) and Table 6 (mmHg)
@@ -221,8 +228,8 @@ Range of `(-1000..4599).step(1)`.
221
228
 
222
229
  [source,ruby]
223
230
  ----
224
- Atmospheric::Export::HypsometricalTables.table_56 #=> Hash
225
- Atmospheric::Export::HypsometricalTables.table_56_yaml #=> YAML
231
+ Atmospheric::Export::Iso25331985.table_56 #=> Hash
232
+ Atmospheric::Export::Iso25331985.table_56_yaml #=> YAML
226
233
  ----
227
234
 
228
235
  === ISO 2533 ADD 2:1997
@@ -344,6 +351,263 @@ Atmospheric::Export::Iso25331997.table_6_yaml #=> YAML
344
351
  ----
345
352
 
346
353
 
354
+ === ISO NP 2533:2024
355
+
356
+ ==== General
357
+
358
+ ISO 2533 is now proposed to be revised for a 2024/2025 version, 49 years
359
+ since the last edition (1975) and 27 years since it was last updated (1997).
360
+
361
+ ISO NP 2533:2024 will likely include all content in the previously published
362
+ Addenda, including:
363
+
364
+ * Standard atmosphere values from altitude -5km to 80km (geometric and geopotential)
365
+ +
366
+ NOTE: The 1975 edition provided values from -2km to 80km (even though it said 32km in the title).
367
+ +
368
+ NOTE: The 1997 ADD 2 provided values from -5km to 2km.
369
+
370
+ * Standard atmosphere values from altitude -16,500ft to 262,500ft (geometric and geopotential)
371
+ +
372
+ NOTE: The 1997 ADD 2 provided these values.
373
+
374
+ * Hypsometrical tables (altitude as a function of barometric pressure) (geometric and geopotential; hPa/mbar)
375
+ +
376
+ NOTE: The 1985 ADD 1 provided these hypsometrical tables in hPa/mbar and mmHg.
377
+ In the 2024 edition only hPa/mbar is provided.
378
+
379
+ This document will also align to the values provided in
380
+ https://store.icao.int/en/manual-of-the-icao-standard-atmosphere-extended-to-80-kilometres-262500-feet-doc-7488[ICAO Doc 7488/3].
381
+
382
+
383
+ All tables in the new edition are arranged in these steps.
384
+
385
+ .ISO 2533:2024 atmosphere values (m): step 50 from -5k, 100 from 32k, 200 from 51k to 80k
386
+ ----
387
+ (-5000..31950).step(50) +
388
+ (32000..50900).step(100) +
389
+ (51000..80000).step(200)
390
+ ----
391
+
392
+ .ISO 2533:2024 atmosphere values (ft): step 250 from -16500, 200 from -14000, 500 from 105000 to 262500
393
+ ----
394
+ (-16500..-13750).step(250) +
395
+ (-14000..104800).step(200) +
396
+ (105000..262500).step(500)
397
+ ----
398
+
399
+ Tables 5 to 10 all have height information of the following keys in the hash:
400
+
401
+ * `geopotential-altitude-m`
402
+ * `geopotential-altitude-ft`
403
+ * `geometrical-altitude-m`
404
+ * `geometrical-altitude-ft`
405
+
406
+ All YAML tables generated contain these two keys which group altitude values
407
+ as the ISO 2533 tables are rendered in both types of altitudes:
408
+
409
+ * `by-geopotential-altitude`
410
+ * `by-geometric-altitude`
411
+
412
+ ==== Table 5 (meters)
413
+
414
+ NOTE: This corresponds to ISO 2533:1975 Table 5 combined with ISO 2533:1975/ADD
415
+ 1:1997 Table 1.
416
+
417
+ Title:
418
+ "_Temperature (T and t), Pressure (p), Density (p) and Acceleration of free fall
419
+ (g) in terms of geometrical altitude (h) and geopotential altitude (H)_"
420
+
421
+ Provides the following values in addition to geopotential and geometric height:
422
+
423
+ * `temperature-K`
424
+ * `temperature-C`
425
+ * `pressure-mbar`
426
+ * `pressure-mmhg`
427
+ * `density`
428
+ * `acceleration`
429
+
430
+ [source,ruby]
431
+ ----
432
+ Atmospheric::Export::Iso25332024.table_5 #=> Hash
433
+ Atmospheric::Export::Iso25332024.table_5_yaml #=> YAML
434
+ ----
435
+
436
+ ==== Table 6 (meters)
437
+
438
+ NOTE: This corresponds to ISO 2533:1975 Table 6 combined with ISO 2533:1975/ADD
439
+ 1:1997 Table 2.
440
+
441
+ Title:
442
+ "_Relations of p'pn, p/pn and bar(p/pn), Speed of sound (a), Dynamic viscosity
443
+ (p), Kinematic viscosity (v) and Thermal conductivity (lambda) in terms of
444
+ geometrical altitude (h), and geopotential altitude (H)_"
445
+
446
+ Provides the following values in addition to geopotential and geometric height:
447
+
448
+ * `ppn`
449
+ * `rhorhon`
450
+ * `sqrt-rhorhon`
451
+ * `speed-of-sound`
452
+ * `dynamic-viscosity`
453
+ * `kinematic-viscosity`
454
+ * `thermal-conductivity`
455
+
456
+ [source,ruby]
457
+ ----
458
+ Atmospheric::Export::Iso25332024.table_6 #=> Hash
459
+ Atmospheric::Export::Iso25332024.table_6_yaml #=> YAML
460
+ ----
461
+
462
+ ==== Table 7 (meters)
463
+
464
+ NOTE: This corresponds to ISO 2533:1975 Table 7 combined with ISO 2533:1975/ADD
465
+ 1:1997 Table 3.
466
+
467
+ Title:
468
+ "_Pressure scale height (H_p) Specific weight (gamma), Air number density (n),
469
+ Mean air-particle speed (v), Air-particle collision frequency (omega) and Mean
470
+ free path of air particles (l) in terms of geometrical altitude (h) and
471
+ geopotential altitude (H)_"
472
+
473
+ * `pressure-scale-height`
474
+ * `specific-weight`
475
+ * `air-number-density`
476
+ * `mean-speed`
477
+ * `frequency`
478
+ * `mean-free-path`
479
+
480
+ [source,ruby]
481
+ ----
482
+ Atmospheric::Export::Iso25332024.table_7 #=> Hash
483
+ Atmospheric::Export::Iso25332024.table_7_yaml #=> YAML
484
+ ----
485
+
486
+ ==== Table 8 (-16.5kft to 262.5kft)
487
+
488
+ NOTE: This corresponds to ISO 2533:1975/ADD 2:1997 Table 4.
489
+
490
+ Title:
491
+ "_Temperature (T and t), pressure (p), density (p) and acceleration of free fall
492
+ (g) in terms of geometrical altitude (h) and geopotential altitude (H) --
493
+ Altitudes in feet_"
494
+
495
+ Exactly same as ISO 2533:1975 Table 5, but in feet and different range.
496
+
497
+ Pressure at mmHg is not produced, but the implementation still provides it
498
+ for completeness.
499
+
500
+ [source,ruby]
501
+ ----
502
+ Atmospheric::Export::Iso25332024.table_8 #=> Hash
503
+ Atmospheric::Export::Iso25332024.table_8_yaml #=> YAML
504
+ ----
505
+
506
+ ==== Table 9 (-16.5kft to 262.5kft)
507
+
508
+ NOTE: This corresponds to ISO 2533:1975/ADD 2:1997 Table 5.
509
+
510
+ Title:
511
+ "_Relations of p'pn, p/pn and bar(p/pn), Speed of sound (a), Dynamic viscosity
512
+ (p), Kinematic viscosity (v) and Thermal conductivity (lambda) in terms of
513
+ geometrical altitude (h), and geopotential altitude (H) -- Altitudes in feet_"
514
+
515
+ Exactly same as ISO 2533:1975 Table 6, but in feet and different range.
516
+
517
+ [source,ruby]
518
+ ----
519
+ Atmospheric::Export::Iso25332024.table_9 #=> Hash
520
+ Atmospheric::Export::Iso25332024.table_9_yaml #=> YAML
521
+ ----
522
+
523
+ ==== Table 10 (-16.5kft to 262.5kft)
524
+
525
+ NOTE: This corresponds to ISO 2533:1975/ADD 2:1997 Table 6.
526
+
527
+ Title:
528
+ "_Pressure scale height (H_p) Specific weight (gamma), Air number density (n),
529
+ Mean air-particle speed (v), Air-particle collision frequency (omega) and Mean
530
+ free path of air particles (l) in terms of geometrical altitude (h) and
531
+ geopotential altitude (H) -- Altitudes in feet_"
532
+
533
+ Exactly same as ISO 2533:1975 Table 7, but in feet and different range.
534
+
535
+ [source,ruby]
536
+ ----
537
+ Atmospheric::Export::Iso25332024.table_10 #=> Hash
538
+ Atmospheric::Export::Iso25332024.table_10_yaml #=> YAML
539
+ ----
540
+
541
+
542
+ ==== Table 11 (hPa)
543
+
544
+ NOTE: This corresponds to ISO 2533:1975/ADD 1:1985 Table 1 combined with Table 2.
545
+
546
+ Title:
547
+ "_Geopotential altitude as a function of barometric pressure
548
+ for 5 <= p < 20 hPa at intervals of 0.01 hPa and
549
+ 20 <= p < 1200 hPa at intervals of 0.1 hPa__"
550
+
551
+ For the range of `(5.0..19.99).step(0.01) + (20.0..1199.9).step(0.1)` in hPa.
552
+
553
+ Provides:
554
+
555
+ * `pressure-mbar`
556
+ * `geopotential-altitude-m`
557
+
558
+ [source,ruby]
559
+ ----
560
+ Atmospheric::Export::Iso25332024.table_11 #=> Hash
561
+ Atmospheric::Export::Iso25332024.table_11_yaml #=> YAML
562
+ ----
563
+
564
+
565
+ ==== Table 12 (hPa)
566
+
567
+ NOTE: This corresponds to ISO 2533:1975/ADD 1:1985 Table 5 but in geometric altitude.
568
+
569
+ Title:
570
+ "_Barometric pressure, in hectopascals, as a function of geometric altitude
571
+ for -1000 <= H < +4600 m at intervals of 1m_"
572
+
573
+ Provides:
574
+
575
+ * `geometric-altitude-m`
576
+ * `pressure-mbar`
577
+ * `pressure-mmhg`
578
+
579
+ Range of `(-1000..4599).step(1)`.
580
+
581
+ [source,ruby]
582
+ ----
583
+ Atmospheric::Export::Iso25332024.table_12 #=> Hash
584
+ Atmospheric::Export::Iso25332024.table_12_yaml #=> YAML
585
+ ----
586
+
587
+ ==== Table 13 (hPa)
588
+
589
+ NOTE: This corresponds to ISO 2533:1975/ADD 1:1985 Table 5, in geopotential altitude.
590
+
591
+ Title:
592
+ "_Barometric pressure, in hectopascals, as a function of geopotential altitude
593
+ for -1000 <= H < +4600 m at intervals of 1m_"
594
+
595
+ Provides:
596
+
597
+ * `geopotential-altitude-m`
598
+ * `pressure-mbar`
599
+ * `pressure-mmhg`
600
+
601
+ Range of `(-1000..4599).step(1)`.
602
+
603
+ [source,ruby]
604
+ ----
605
+ Atmospheric::Export::Iso25332024.table_13 #=> Hash
606
+ Atmospheric::Export::Iso25332024.table_13_yaml #=> YAML
607
+ ----
608
+
609
+
610
+
347
611
  == Testing
348
612
 
349
613
  [source,sh]
@@ -7,10 +7,10 @@ module Atmospheric
7
7
  class TableBase
8
8
  include Target
9
9
 
10
- def to_h
10
+ def to_h(unit: steps_unit)
11
11
  d = { "rows" => [] }
12
12
  steps.each do |p|
13
- d["rows"] << row(p)
13
+ d["rows"] << row(p, unit: unit)
14
14
  end
15
15
  d
16
16
  end
@@ -19,120 +19,15 @@ module Atmospheric
19
19
  (0..0)
20
20
  end
21
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)
22
+ def steps_unit
23
+ :mbar
82
24
  end
83
25
 
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
- }
26
+ def row(p, unit: steps_unit)
27
+ {}
90
28
  end
91
29
  end
92
30
 
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
31
  end
137
32
 
138
33
  end
@@ -24,10 +24,10 @@ module Atmospheric
24
24
 
25
25
  def height_hash(hgmm, hgmf, hgpm, hgpf)
26
26
  {
27
- "geopotential-altitude-m" => hgmm.round,
28
- "geopotential-altitude-ft" => hgmf.round,
29
- "geometrical-altitude-m" => hgpm.round,
30
- "geometrical-altitude-ft" => hgpf.round,
27
+ "geometrical-altitude-m" => hgmm.round,
28
+ "geometrical-altitude-ft" => hgmf.round,
29
+ "geopotential-altitude-m" => hgpm.round,
30
+ "geopotential-altitude-ft" => hgpf.round,
31
31
  }
32
32
  end
33
33
 
@@ -43,8 +43,8 @@ module Atmospheric
43
43
  # Step 50 from -2k to 40k, step 100 above 32k, 200 above 51k to 80k
44
44
  def steps
45
45
  (
46
- (-2000..31999).step(50) +
47
- (32000..50999).step(100) +
46
+ (-2000..31950).step(50) +
47
+ (32000..50900).step(100) +
48
48
  (51000..80000).step(200)
49
49
  )
50
50
  end
@@ -56,7 +56,7 @@ module Atmospheric
56
56
  def to_h(unit: steps_unit)
57
57
  d = {
58
58
  "by-geometrical-altitude" => [],
59
- "by-geopotential-altitude" => []
59
+ "by-geopotential-altitude" => [],
60
60
  }
61
61
 
62
62
  steps.each do |h|
@@ -17,7 +17,7 @@ module Atmospheric
17
17
  "temperature-K" => (Isa.temperature_at_layer_from_geopotential(gp_h_f) * 1000.0).round,
18
18
  "temperature-C" => (Isa.temperature_at_layer_celcius(gp_h_f) * 1000.0).round,
19
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),
20
+ "pressure-mmhg" => round_to_sig_figs(Isa.pressure_from_geopotential_mmhg(gp_h_f), 6),
21
21
  "density" => round_to_sig_figs(Isa.density_from_geopotential(gp_h_f), 6),
22
22
  "acceleration" => Isa.gravity_at_geopotential(gp_h_f).round(4),
23
23
  }
@@ -0,0 +1,136 @@
1
+ require_relative "./target"
2
+ require_relative "./hypsometrical_tables"
3
+
4
+ module Atmospheric
5
+ module Export
6
+
7
+ module Iso25331985
8
+
9
+ class TableOne < HypsometricalTables::TableBase
10
+ # TODO: when Ruby's step does not create inaccurate floating point numbers
11
+ # This is a hack to solve a Ruby bug with floating point calcuations
12
+ # > (20.0..1770.9).step(0.1).to_a
13
+ # ...
14
+ # 1769.4,
15
+ # 1769.5,
16
+ # 1769.6000000000001, # <== we need to clean these
17
+ # 1769.7,
18
+ # 1769.8000000000002, # <== we need to clean these
19
+ # The last `map` should be removed if this bug is fixed
20
+ def steps
21
+ (5.0..19.99).step(0.01).to_a.map {|v| v.round(2)}
22
+ end
23
+
24
+ def steps_unit
25
+ :mbar
26
+ end
27
+
28
+ def row(p, unit: steps_unit)
29
+ method_name = "geopotential_altitude_from_pressure_#{unit}"
30
+ value = Isa.send(method_name, p).round
31
+ {
32
+ "pressure-#{unit}" => p,
33
+ "geopotential-altitude" => value,
34
+ }
35
+ end
36
+ end
37
+
38
+ class TableTwo < HypsometricalTables::TableBase
39
+ def steps
40
+ (20.0..1199.9).step(0.1).to_a.map {|v| v.round(1)}
41
+ end
42
+
43
+ def row(p, unit:)
44
+ method_name = "geopotential_altitude_from_pressure_#{unit}"
45
+ value = Isa.send(method_name, p).round
46
+ {
47
+ "pressure-#{unit}" => p,
48
+ "geopotential-altitude" => value,
49
+ }
50
+ end
51
+ end
52
+
53
+ # Same as Table 1 with mmHg
54
+ class TableThree < TableOne
55
+ def steps
56
+ (4.0..9.99).step(0.01).to_a.map {|v| v.round(2)}
57
+ end
58
+
59
+ def steps_unit
60
+ :mmhg
61
+ end
62
+ end
63
+
64
+ # Same as Table 3 with mmHg
65
+ class TableFour < TableTwo
66
+ def steps
67
+ (10.0..899.9).step(0.1).to_a.map {|v| v.round(1)}
68
+ end
69
+
70
+ def steps_unit
71
+ :mmhg
72
+ end
73
+ end
74
+
75
+ class TableFiveSix < HypsometricalTables::TableBase
76
+ def steps
77
+ (-1000..4599).step(1)
78
+ end
79
+
80
+ def row(h, unit:)
81
+ {
82
+ "geopotential-altitude" => h,
83
+ "pressure-mbar" => round_to_sig_figs(Isa.pressure_from_geopotential_mbar(h.to_f), 6),
84
+ "pressure-mmhg" => round_to_sig_figs(Isa.pressure_from_geopotential_mmhg(h.to_f), 6),
85
+ }
86
+ end
87
+ end
88
+
89
+ class << self
90
+
91
+ def table_1
92
+ TableOne.new.to_h
93
+ end
94
+
95
+ def table_1_yaml
96
+ TableOne.new.to_yaml
97
+ end
98
+
99
+ def table_2
100
+ TableTwo.new.to_h
101
+ end
102
+
103
+ def table_2_yaml
104
+ TableTwo.new.to_yaml
105
+ end
106
+
107
+ def table_3
108
+ TableThree.new.to_h
109
+ end
110
+
111
+ def table_3_yaml
112
+ TableThree.new.to_yaml
113
+ end
114
+
115
+ def table_4
116
+ TableFour.new.to_h
117
+ end
118
+
119
+ def table_4_yaml
120
+ TableFour.new.to_yaml
121
+ end
122
+
123
+ def table_56
124
+ TableFiveSix.new.to_h
125
+ end
126
+
127
+ def table_56_yaml
128
+ TableFiveSix.new.to_yaml
129
+ end
130
+
131
+ end
132
+
133
+ end
134
+
135
+ end
136
+ end
@@ -1,4 +1,5 @@
1
1
  require_relative "./target"
2
+ require_relative "./iso_25331975"
2
3
 
3
4
  module Atmospheric
4
5
  module Export
@@ -26,8 +27,8 @@ module Atmospheric
26
27
  module GroupBaseFeet
27
28
  def steps
28
29
  (
29
- (-16500..-13999).step(250) +
30
- (-14000..104999).step(200) +
30
+ (-16500..-13750).step(250) +
31
+ (-14000..104800).step(200) +
31
32
  (105000..262500).step(500)
32
33
  )
33
34
  end