Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add table export functionality #31

Merged
merged 1 commit into from
Mar 26, 2024
Merged

Conversation

newbthenewbd
Copy link
Contributor

@newbthenewbd newbthenewbd commented Mar 23, 2024

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

🙃

tables.zip

Metanorma PR checklist

@newbthenewbd
Copy link
Contributor Author

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

@newbthenewbd
Copy link
Contributor Author

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 🙃

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 😶‍🌫️

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

tables.zip

@newbthenewbd newbthenewbd linked an issue Mar 25, 2024 that may be closed by this pull request
@newbthenewbd
Copy link
Contributor Author

newbthenewbd commented Mar 25, 2024

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
Copy link
Contributor

Merging first. Thanks!

@ronaldtse ronaldtse merged commit 0460b43 into metanorma:main Mar 26, 2024
2 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants