pytmosph3r.atmosphere.altitudeatmosphere

Module Contents

class AltitudeAtmosphere(model=None, n_vertical=100, n_latitudes=49, n_longitudes=64)[source]

Bases: pytmosph3r.atmosphere.atmosphere.Atmosphere

Atmospheric model with a (altitude, latitude, longitude) coordinate system. The attributes of this class are the same as InputAtmosphere, except that they have been interpolated in a spherical grid.

property n_layers: int

Number of layers in the model.

property n_levels: int

Number of levels in the model (equal to n_layers +1).

max_altitude

Max altitude in the model, calculated based on min_pressure.

altitude_levels

Altitudes of each level (separating each layer). Array of length n_levels.

altitude

Altitudes in the middle of each layer. Array of length n_layers.

aerosols

Aerosols for each point of the altitude grid, interpolated from pytmosph3r.atmosphere.InputAtmosphere.aerosols (each aerosol is a dictionary with keys {‘mmr’, ‘reff’, ‘condensate_density’}).

build()[source]

Ensure that all data has been computed and formatted in arrays of the same shape. Handle different configurations of pressure, temperature and chemistry.

index_altitude(altitude)[source]

Gives the index of the layer containing an altitude (given in m).

generate_altitude_grid()[source]

Build an atmospheric grid based on the highest altitude of the level-based atmospheric grid, discretized into n_vertical points.

interpolate_from_input()[source]

Interpolate pressure, temperature and gas mix ratios from levels to the new coordinate system.

altitude_interp(lat, lon, dest, origin, interp='log')[source]

Interpolation of the values of dest based on the information of origin, associated with the altitude of the InputAtmosphere. This function operates on the (vertical) column at the location given by (lat, lon) in the atmosphere. The interpolation uses the altitude of the altitude grid as the input variables.

Parameters:
  • lat (int) – Latitude index

  • lon (int) – Longitude index

  • dest (array) – Destination array to interpolate into

  • origin (array) – Origin array to interpolate from

  • interp (str) – ‘linear’, ‘log’, …

compute_pressure()[source]

Re-compute the pressure lower than min_pressure, using the hydrostatic equilibrium equation.

outputs()[source]