Utilities

Common utility functions.

append_description(dataset[, description])

Append variable attributes to a given dataset.

append_timestep_netcdf(filename, data, timestamp)

Append a timestep to an existing netCDF4 file.

return_if_type(variable, variablename, ...)

Return a variable if it matches an expected type.

plev_from_phlev(halflevels)

Returns full-level pressures for given half-level pressures.

dz_from_z(z)

Return the level thickness given the height array.

get_quadratic_pgrid([surface_pressure, ...])

Create matching pressure levels and half-levels.

get_pressure_grids([surface_pressure, ...])

Create matching pressures at full-levels and half-levels.

ozonesquash(o3, z, squash)

Squashes the ozone profile upwards or stretches it downwards, with no change to the shape of the profile above the ozone concentration maximum

ozone_profile_rcemip(plev[, g1, g2, g3])

Compute the ozone volumetric mixing ratio from pressure.

humidity_profile_rcemip(z[, q0, qt, zt, ...])

Compute the water vapor volumetric mixing ratio as function of height.

parse_fraction_of_day(time)

Calculate the fraction of a day.

standard_atmosphere(z[, coordinates])

International Standard Atmosphere (ISA).

prefix_dict_keys(dictionary, prefix[, delimiter])

Return a copy of a dictionary with a prefix added to every key.

find_first_below(arr, val)

Find first index in arr that falls below given val.