Skip to content

Instantly share code, notes, and snippets.

@jorgepiloto
Created August 8, 2019 10:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jorgepiloto/0dc3e4a01aeaa33e28629256341e47a1 to your computer and use it in GitHub Desktop.
Save jorgepiloto/0dc3e4a01aeaa33e28629256341e47a1 to your computer and use it in GitHub Desktop.
Creates atmospheric tables
from astropy.io import ascii
from astropy import units as u
from poliastro.atmosphere.models import COESA62
from prettytable import PrettyTable
import numpy as np
coesa62 = COESA62()
t = PrettyTable()
t.align='l'
t.border=False
t.add_column("Z [km]", coesa62._Zb_table.to(u.km).round(0).value)
t.add_column("H [km]", coesa62._Hb_table.to(u.km).round(0).value)
t.add_column("Tm [K]", coesa62._Tb_table.to(u.K).round(2).value)
t.add_column("p[mbar]", coesa62._pb_table.to(u.mbar).value)
atmosphere_file = open('coesa62.dat', 'w')
atmosphere_file.write(str(t))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment