Skip to content
Juan Luis Cano Rodríguez edited this page May 15, 2014 · 8 revisions

Here are some thoughts about how the package should be (actually taken from the features) and what consequences they have.

  • Pythonic interface - It should be intuitive and simple to use
  • Use of SI units - Perhaps astropy.units should be used! I tried in poliastro successfully
  • Support of NumPy arrays - Vectorization is a must! The very first use case is obtaining an array of properties in a domain of altitudes. This is perfect for plotting, but complicates library code.
  • Support for both Python 2 and 3 - Probably some continuous integration server is needed! Travis CI works very well.
  • Fully tested and documented - I need full coverage and better docs. API references are not enough.

Use cases

Retrieve an array of properties

import astropy.units as u
from skaero.atmosphere import coesa

h = np.linspace(0 * u.km, 20 * u.km)
T = coesa.temperature(h)  # Notice vectorization is needed here
assert T.shape == h.shape   # An array is returned
assert T.unit == u.Kelvin  # With proper units

Retrieve all properties

Warnings:

  • A single array can contain a single unit. Therefore I cannot mix them.
  • Using pandas DataFrames won't fix the problem: they don't get on well with astropy.units.
  • Inverse calculations should only be possible if the variable is monotonic. Perhaps just altitude and pressure. Pressure altitude is a widely used quantity and should be taken into account. -- I wouldn't call them inverse calculations anymore.
# Slow
T = coesa.temperature(h)
p = coesa.pressure(h)
pass
# Ugly
T = coesa.alt2temp(h)
p = coesa.alt2press(h)
# Good?
h, T, p, rho = coesa.table(h)  # Four vectors are returned
# Using pressure altitude
h, T, p, rho = coesa.table(p=101325 * u.Pascal)
Clone this wiki locally