Previous topic

Reference Guide

Next topic

Moist Class

This Page

Backend Class

Copyright (C) 2020 AMSIMP

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

class amsimp.backend.Backend

This is the base class for AMSIMP, as such, all other classes within AMSIMP inherit this class, either directly or indirectly.

coriolis_parameter

Generates an arrray of the Coriolis parameter at various latitudes.

\[f = 2 \Omega \sin{\phi}\]
Returns

Coriolis parameter

Return type

astropy.units.quantity.Quantity

Notes

The Coriolis parameter is defined as two times the angular rotation of the Earth by the sin of the latitude you are interested in.

exit

This method deletes any file created by the software.

Notes

This command will also cause the Python interpreter to close and exit. It does not delete any forecast generated and saved by the software.

geopotential_height

Generates an arrray of geopotential height.

Returns

Geopotential height

Return type

astropy.units.quantity.Quantity

Notes

If the user did not define initial conditions on initialisation of the class, this data is retrieved from the AMSIMP Initial Conditions Data Repository on GitHub. Geopotential Height is the height above sea level of a pressure level. For example, if a station reports that the 500 hPa height at its location is 5600 m, it means that the level of the atmosphere over that station at which the atmospheric pressure is 500 hPa is 5600 meters above sea level.

gradient_latitude

Calculate the gradient of a grid of values with respect to latitude.

Parameters

parameter (astropy.units.quantity.Quantity) – Array of values of which to calculate the gradient

Returns

The gradient calculated with respect to latitude of the original array

Return type

astropy.units.quantity.Quantity

Notes

The gradient is computed using second order accurate central differences in the interior points and either first or second order accurate one-sides (forward or backwards) differences at the boundaries. The returned gradient hence has the same shape as the input array.

gradient_longitude

Calculate the gradient of a grid of values with respect to longitude.

Parameters

parameter (astropy.units.quantity.Quantity) – Array of values of which to calculate the gradient

Returns

The gradient calculated with respect to longitude of the original array

Return type

astropy.units.quantity.Quantity

Notes

The gradient is computed using second order accurate central differences in the interior points. The boundaries are joined together for the purposes of this compuation, allowing for the use of second order accurate central differences at the boundaries.

gradient_pressure

Calculate the gradient of a grid of values with respect to pressure.

Parameters

parameter (astropy.units.quantity.Quantity) – Array of values of which to calculate the gradient

Returns

The gradient calculated with respect to pressure of the original array

Return type

astropy.units.quantity.Quantity

Notes

The gradient is computed using second order accurate central differences in the interior points and either first or second order accurate one-sides (forward or backwards) differences at the boundaries. The returned gradient hence has the same shape as the input array.

latitude_lines

Generates an array of latitude lines.

Returns

Latitude lines

Return type

astropy.units.quantity.Quantity

longitude_contourf

Plots a desired atmospheric parameter on a contour plot.

Parameters
  • which (str) – Desired atmospheric parameter

  • psurface (int) – Pressure at which the contour plot is generated

Notes

For the raw data, please see the other methods found in this class. This plot is layed on top of a EckertIII global projection. The axes are latitude and longitude. If you would like a particular atmospheric parameter to be added to this method, either create an issue on GitHub or send an email to support@amsimp.com.

longitude_lines

Generates an array of longitude lines.

Returns

Longitude lines

Return type

astropy.units.quantity.Quantity

make_3dimensional_array

Convert 1-dimensional array to array with three dimensions.

Parameters
  • parameter (astropy.units.quantity.Quantity) – Input array to be converted

  • axis (int) – Defines the variable over which the given parameter varies

Returns

3-dimensional version of input array

Return type

astropy.units.quantity.Quantity

Notes

If axis is set to 0, this variable is constant pressure surfaces. If axis is set to 1, this variable is latitude. If axis is set to 2, this variable is longitude.

pressure_surfaces

Generates an array of constant pressure surfaces.

Parameters

dim_3d (bool) – If true, this will generate a 3-dimensional array

Returns

Constant pressure surfaces

Return type

astropy.units.quantity.Quantity

Notes

This is the isobaric coordinate system.

pressure_thickness

Generates an array of the thickness of a layer.

\[h = z_2 - z_1\]
Parameters
  • p1 (int) – Bottom of the layer.

  • p2 (int) – Top of the layer.

Returns

Pressure thickness

Return type

astropy.units.quantity.Quantity

Notes

Pressure thickness is defined as the distance between two pressure surfaces. Pressure thickness is determined through the hypsometric equation.

psurface_contourf

Plots a desired atmospheric parameter on a contour plot, with the axes being latitude, and pressure surfaces.

Parameters
  • which (str) – Desired atmospheric parameter

  • central_long (int) – Line of longitude at which the contour plot is generated

Notes

For the raw data, please see the other methods found in this class. This plot is layed on top of a EckertIII global projection. The axes are pressure and latitude. If you would like a particular atmospheric parameter to be added to this method, either create an issue on GitHub or send an email to support@amsimp.com.

relative_humidity

Generates an arrray of relative humidity.

Returns

Relative humidity

Return type

astropy.units.quantity.Quantity

Notes

If the user did not define initial conditions on initialisation of the class, this data is retrieved from the AMSIMP Initial Conditions Data Repository on GitHub. Relative Humidity is the amount of water vapour present in air expressed as a percentage of the amount needed for saturation at the same temperature.

temperature

Generates an arrray of temperature.

Returns

Temperature

Return type

astropy.units.quantity.Quantity

Notes

If the user did not define initial conditions on initialisation of the class, this data is retrieved from the AMSIMP Initial Conditions Data Repository on GitHub. Temperature is defined as the mean kinetic energy density of molecular motion.

thickness_contourf

Plots the thickness of a layer on a contour plot.

Parameters
  • p1 (int) – Bottom of the layer

  • p2 (int) – Top of the layer

Notes

This plot is layed on top of a EckertIII global projection. If you would like a particular atmospheric parameter to be added to this method, either create an issue on GitHub or send an email to support@amsimp.com.

troposphere_boundaryline

Generates an array of the troposphere - stratosphere boundary line.

Returns

Troposphere - stratosphere boundary line

Return type

astropy.units.quantity.Quantity

Notes

The atmosphere is divided into four distinct layers: the troposphere, the stratosphere, the mesosphere, and the thermosphere. These layers are defined and characterised by their vertical temperature profile. In the troposphere, temperature decreases with altitude; while in the stratosphere, temperature increases with altitude. This method determines the point at which temperature starts to increase with altitude (the boundary line between these two layers).

See also

temperature