Utilities
Atmospheric physics
Routines for calculations of various physical properties
|
Convert relative humidity to specific humidity Code from: https://github.com/PecanProject/pecan/blob/master/modules/data.atmosphere/R/metutils.R Equation for sh from standard literature, e.g. K. Emanuel (1994; eq. 4.1.4) Reference: * Emanuel, K. A. (1994): Atmospheric Convection. New York, NY: Oxford University Press, 580 pp. |
|
Convert specific humidity to relative humidity Code from: https://github.com/PecanProject/pecan/blob/master/modules/data.atmosphere/R/metutils.R |
Convert dew point temperature to specific humidity https://github.com/PecanProject/pecan/blob/master/modules/data.atmosphere/R/metutils.R |
|
Returns dew point temperature (K) at mixing ratio sh (kg/kg) and pressure p (Pa). |
|
Vapor pressure over liquid surface can be calculated from a variety of different combinations of state variables. Here, vapor pressure is calculated from mixing ratio w (kg/kg) and pressure P. Formula is given in standard literature; e.g. eq. 2.18 in Rogers&Yau (Cloud physics) and eq. 4.1.2 in Emanuel (1994). Reference: * Emanuel, K. A. (1994): Atmospheric Convection. New York, NY: Oxford University Press, 580 pp. |
|
Vapor pressure over liquid surface can be calculated from a variety of different combinations of state variables. Here, vapor pressure is calculated from specific humidity sh (kg/kg) and pressure P (Pa). Formula is given in standard literature; e.g. eq. 2.19 in Rogers & Yau (Cloud physics) and eq. 4.1.4 in Emanuel (1994). Reference: * Emanuel, K. A. (1994): Atmospheric Convection. New York, NY: Oxford University Press, 580 pp. |
|
Returns saturation vapor pressure in hPa at temperature T (Kelvin) Formula 2.17 in Rogers&Yau |
|
|
Returns saturation mixing ratio in kg/kg at temperature T (Kelvin) and pressure P (hPa). |
Returns dew point temperature (C) at vapor pressure e (Pa) Insert Td in 2.17 in Rogers&Yau and solve for Td |
|
|
Converts wind speed and direction to u and v components. |
Converts u and v components to wind speed and direction. |
|
Calculate Brunt-Vaisala frequency in layer bounded by two pressure levels. |
|
|
Returns the lifted condensation temperature in units of Kelvin. |
Returns the equivalent potential temperature in units of Kelvin. |
|
Returns the pseudo-equivalent potential temperature in units of Kelvin. |
IO handling
This module provides routines representing tools to read and write NetCDF files.
|
ncdump outputs dimensions, variables and their attribute information. |
|
Function to open netcdf file. |
|
Function to retrieve the dimensions of a netcdf file nc: Netcdf object opened with function "openFile" close: set True if you want the file to be closed after retrieval. |
|
Function to retrieve variables from a netcdf file nc: Netcdf object opened with function "openFile" params: A list of strings with the parameters to be retrieved close: set True if you want the file to be closed after retrieval. |
Takes an array of dates given in %Y%m%d.%f format and returns a corresponding datetime object |
|
|
Opens a new NetCDF file to write the input data to. |
Grid applications
Routines to remap data given source and target grids.
|
File name: fnCellBoundaries Author: Andreas Prein E-mail: prein@ucar.edu Date created: 20.03.2015 Date last modified: 20.03.2015 |
|
Estimate the cell boundaries from the cell location of regular grids |
File name: fnRemapConOperator Author: Andreas Prein E-mail: prein@ucar.edu Date created: 26.05.2017 Date last modified: 26.05.2017 |
|
|
File name: fnRemapCon Author: Andreas Prein E-mail: prein@ucar.edu Date created: 13.06.2017 Date last modified: 13.06.2017 |
|
Replace zero values of cells in the new grid that are outside the old grid's domain with NaN's. |
Config reader module
Creates and return a dictionary built from a config file.
Create a dictionary from then input config file. |
Polygons
Mask polygons
Routine for Masking Data with Polygons.
|
See available polygons and retrieve path to polygon files. |
|
Routine to mask grid points outside a specified polygon. |
Retrieve polygon arbitrarily drawn interactively on a map by mouse clicking. |
|
|
Plot polygon on map. |
|
Rotuine to mask grid points outside a specified height interval. |
Search for nearest decimal degree in an array of decimal degrees and return the index. |
Draw polygon
Draw a simple polygon using matplotlib with mouse event handling.