metanorma / atmospheric

International Standard Atmosphere / ICAO Standard Atmosphere (ISA) from ICAO 7488 / ISO 2533
BSD 2-Clause "Simplified" License
1 stars 1 forks source link

Add table export functionality #31

Closed newbthenewbd closed 5 months ago

newbthenewbd commented 5 months ago

A simple Ruby application making use of the procedures:

require "atmospheric"

Atmospheric::Export.iso_2533_1975_table5_to_yaml("table5.yaml")
Atmospheric::Export.iso_2533_1975_table6_to_yaml("table6.yaml")
Atmospheric::Export.iso_2533_1975_table7_to_yaml("table7.yaml")

I attach the resulting tables: image

:upside_down_face:

tables.zip

Metanorma PR checklist

newbthenewbd commented 5 months ago

Going to add the addendum tables to this PR, too...

newbthenewbd commented 5 months ago

A small surprise with the addendum 1 tables: the formulae calculate geopotential altitude as a function of pressure... and their choice depends on geopotential altitude :upside_down_face:

Assuming that the functions are monotonic, I suppose that we first calculate the boundary conditions for pressure, and choose further based on that? Shall do it early Monday morning :face_in_clouds:

As for the happier news, a zipfile including the addendum 2 tables roughly as I figured they should be done follows! :)

tables.zip

newbthenewbd commented 5 months ago

OK, all the tables are here!

Exporting example:

require "atmospheric"

Atmospheric::Export.iso_2533_1975_table5_to_yaml("iso-2533-1975-table5.yaml")
Atmospheric::Export.iso_2533_1975_table6_to_yaml("iso-2533-1975-table6.yaml")
Atmospheric::Export.iso_2533_1975_table7_to_yaml("iso-2533-1975-table7.yaml")

Atmospheric::Export.iso_2533_add_1_1985_table1_to_yaml("iso-2533-add-1-1985-table1.yaml")
Atmospheric::Export.iso_2533_add_1_1985_table2_to_yaml("iso-2533-add-1-1985-table2.yaml")
Atmospheric::Export.iso_2533_add_1_1985_table3_to_yaml("iso-2533-add-1-1985-table3.yaml")
Atmospheric::Export.iso_2533_add_1_1985_table4_to_yaml("iso-2533-add-1-1985-table4.yaml")
Atmospheric::Export.iso_2533_add_1_1985_table5_to_yaml("iso-2533-add-1-1985-table5.yaml")
Atmospheric::Export.iso_2533_add_1_1985_table6_to_yaml("iso-2533-add-1-1985-table6.yaml")

Atmospheric::Export.iso_2533_add_2_1997_table1_to_yaml("iso-2533-add-2-1997-table1.yaml")
Atmospheric::Export.iso_2533_add_2_1997_table2_to_yaml("iso-2533-add-2-1997-table2.yaml")
Atmospheric::Export.iso_2533_add_2_1997_table3_to_yaml("iso-2533-add-2-1997-table3.yaml")
Atmospheric::Export.iso_2533_add_2_1997_table4_to_yaml("iso-2533-add-2-1997-table4.yaml")
Atmospheric::Export.iso_2533_add_2_1997_table5_to_yaml("iso-2533-add-2-1997-table5.yaml")
Atmospheric::Export.iso_2533_add_2_1997_table6_to_yaml("iso-2533-add-2-1997-table6.yaml")

Generated results: tables.zip

Par for the course, small divergences from the original values exist :(

It is also quite a mess to Rubocop, but I believe that a deduplicating refactor that I am potentially thinking of might actually make it less straightforward to read than it currently is - opinions?

ronaldtse commented 5 months ago

Merging first. Thanks!