Purpose

This repository provides Ruby code for calculating values defined in the following documents:

  • International Standard Atmosphere (ISA) from ISO 2533:1975

  • ICAO Standard Atmosphere (ICAO Doc 7488/3, 1994)

Which are technically identical documents but different in presentation and units (the ICAO document includes ft in addition to m).

Usage

> require 'atmospheric'
> instance = Atmospheric::Isa.method_name
> # method_name is one of the following

The available methods are:

  • geometric_altitude_from_geopotential(geopotential_altitude)

  • geopotential_altitude_from_geometric(geometric_altitude)

  • temperature_at_layer_from_H(geopotential_altitude)

  • temperature_at_layer_celcius(geopotential_altitude)

  • pressure_from_H_mbar(geopotential_altitude)

  • pressure_from_H_mmhg(geopotential_altitude)

  • density_from_H(geopotential_altitude)

  • gravity_at_geopotential(geopotential_altitude)

  • p_p_n_from_H(geopotential_altitude)

  • rho_rho_n_from_H(geopotential_altitude)

  • root_rho_rho_n_from_H(geopotential_altitude)

  • speed_of_sound_from_H(geopotential_altitude)

  • dynamic_viscosity_from_H(geopotential_altitude)

  • kinematic_viscosity_from_H(geopotential_altitude)

  • thermal_conductivity_from_H(geopotential_altitude)

  • pressure_scale_height_from_H(geopotential_altitude)

  • specific_weight_from_H(geopotential_altitude)

  • air_number_density_from_H(geopotential_altitude)

  • mean_air_particle_speed_from_H(geopotential_altitude)

  • air_particle_collision_frequency_from_H(geopotential_altitude)

  • mean_free_path_of_air_particles_from_H(geopotential_altitude)

Testing

$ rspec

Tests are encoded in spec/fixtures/tests.yml in the following format:

- H: -2000.0
  h: -1999.0
  TK: 301.15
  TC: 28.0
  p_mbar: 1277.74
  p_mmhg: 958.382
  rho: 1.47808
  g: 9.8128
  p_p_n: 1.26103
  rho_rho_n: 1.20659
  root_rho_rho_n: 1.09845
  a: 347.886
  mu: 1.8514e-05
  v: 1.2526e-05
  lambda: 0.026359
  H_p: 8809.5
  gamma: 14.504
  n: 3.0734e+25
  v_bar: 469.18
  omega: 8535100000.0
  l: 549710000.0

Each of these values are associated with a cell in the tables of the source documents.

The only defining value in a tests is H (geopotential altitude). It is used to generate all the other values.

License

Copyright Ribose and its respective owners.

TODO

  • make into module

  • expose this as a plugin to LutaML / Metanorma YAML2text