4.1.1.1.1.2. pamtra2.hydrometeors.core

4.1.1.1.1.2.1. Module Contents

4.1.1.1.1.2.1.1. Classes

hydrometeor

generic class to store hydrometeor properties.

softEllipsoidFixedDensity

hydrometeor class to be used for soft ellipsoids with fixed density.

softEllipsoidMassSize

hydrometeor class to be used for soft ellipsoids with variable

cloud

hydrometeor class for cloud droplets.

rain

hydrometeor class for rain.

ice

hydrometeor class for ice.

snow

hydrometeor class for snow.

4.1.1.1.1.2.1.2. Functions

DEFAULT_CALCULATION_ORDER()

DEFAULT_CALCULATION_ORDER()[source]
class hydrometeor(parent=None, name=None, discreteProperties=None, calculationOrder=None, useFuncArgDefaults=True, **kwargs)[source]

Bases: object

generic class to store hydrometeor properties.

Parameters
  • parent (pamtra2 object) – content of parent’s class

  • name (str, optional) – name of the hydrometeor

  • discreteProperties (xr.Dataset, optional) – pre-calculated discrete properties

  • calculationOrder (optional) – order for estimating the properties

  • useFuncArgDefaults (bool, optional) – if parameters are not found in any kwarg, discreteProperties, parent’s profile, then fall back to default values of the function. Helpful for debugging. default True.

  • **kwargs – All properties of the hydrometeor. Most hydrometeors require at least ‘sizeCenter’, ‘aspectRatio’, ‘mass’, ‘density’, ‘crossSectionArea’, and ‘numberConcentration’.

name

name of the hydrometeor

Type

str, optional

index

hydrometeor index in parent

Type

int

kind

liquid or frozen hydrometeor?

Type

{‘liquid’, ‘ice’}

nBins

number of size bins

Type

int

discreteProperties

calculated discrete properties

Type

xr.Dataset

calculationOrder

order for estimating the properties

useFuncArgDefaults

if parameters are not found in any of funcArgs, discreteProperties, parent’s profile, then fall back to default values of the function. Helpful for debugging. default True.

Type

bool

description

All properties of the hydrometeor. Most hydrometeors require at least ‘sizeCenter’, ‘aspectRatio’, ‘mass’, ‘density’, ‘crossSectionArea’, and ‘numberConcentration’.

Type

dict

getProfileAllBroadcasted(self, variables=None, sel={})[source]
getProfileWithParentAllBroadcasted(self, variables=None, parentVariables=None, exclude=[])[source]
property _parentProfile(self)[source]

Helper function

Returns

  • _parentProfile – Limited version of parent.profile. Contains only data belonging to

  • the hydrometeor.

_arrayOrFunc(self, thisKey, thisDesription, **fixedKwargs)[source]

Helper function calling functions if required.

Parameters
  • thisDesription – function or value or xr.DataArray

  • **fixedKwargs – additional parameters for the function not defined elsewhere

Returns

value or xr.DataArray

Return type

thisProperty

solve(self)[source]
Helper function to estimate all discrete properties of a

hydrometeor

Returns

xr.Dataset with results

Return type

discreteProperties

_postProcessing(self)[source]

clean up ‘artificial’ dimensions. Required becaus xr.apply_ufunc cannot return multiple items.

class softEllipsoidFixedDensity(*args, **kwargs)[source]

Bases: hydrometeor

hydrometeor class to be used for soft ellipsoids with fixed density.

class softEllipsoidMassSize(*args, **kwargs)[source]

Bases: hydrometeor

hydrometeor class to be used for soft ellipsoids with variable density depending on the mass-size relation.

class cloud(*args, nBins=2, numberConcentration=numberConcentration.monoDisperseWC, scattering=scattering.Mie, Dmin=1e-05 - 1e-10, Dmax=1e-05 + 1e-10, **kwargs)[source]

Bases: softEllipsoidFixedDensity

hydrometeor class for cloud droplets.

Parameters
  • parent (pamtra2 object) – content of parent’s class

  • name (str, optional) – name of the hydrometeor

  • nBins (int, optional) – number of bins. Note taht the spectral radar simulator requires >= 2 hydrometeor bins. (default 2)

  • numberConcentration (func, optional) – Function to describe the size distribution. default: numberConcentration.monoDisperseWC which requires hydrometeorContent either as kwarg or in pamtra2’s profile

  • scattering (func, optional) – Function to describe the single scattering of the hydrometeor. default: scattering.Mie

  • Dmin (float, optional) – Smallest boundary of size distribution. Note that Dmin != Dmax is required also for a monodisperse distribution. (default 1e-5 - 1e-10)

  • Dmax (float, optional) – Largest boundary of size distribution. Note that Dmin != Dmax is required also for a monodisperse distribution. (default 1e-5 + 1e-10)

  • useFuncArgDefaults (bool, optional) – if parameters are not found in any of kwargs, discreteProperties, parent’s profile, then fall back to default values of the function. Helpful for debugging. default True.

  • **kwargs – Further properties if required. Also the parameters defined in defaultArgs (see source) can be overwritten if provided.

name

name of the hydrometeor

Type

str, optional

index

hydrometeor index in parent

Type

int

kind

liquid or frozen hydrometeor?

Type

{‘liquid’, ‘ice’}

nBins

number of size bins

Type

int

discreteProperties

calculated discrete properties

Type

xr.Dataset

calculationOrder

order for estimating the properties

useFuncArgDefaults

if parameters are not found in any of funcArgs, discreteProperties, parent’s profile, then fall back to default values of the function. Helpful for debugging. default True.

Type

bool

description

All properties of the hydrometeor. Most hydrometeors require at least ‘sizeCenter’, ‘aspectRatio’, ‘mass’, ‘density’, ‘crossSectionArea’, and ‘numberConcentration’.

Type

dict

class rain(*args, nBins=50, numberConcentration=numberConcentration.exponentialN0WC, scattering=scattering.Mie, aspectRatio=1.0, Dmin=1e-06, Dmax=0.008, N0=8000000.0, **kwargs)[source]

Bases: softEllipsoidFixedDensity

hydrometeor class for rain.

Parameters
  • parent (pamtra2 object) – content of parent’s class

  • name (str, optional) – name of the hydrometeor

  • nBins (int, optional) – number of bins. Note taht the spectral radar simulator requires >= 2 hydrometeor bins. (default 50)

  • numberConcentration (func, optional) – Function to describe the size distribution. default: numberConcentration.exponentialN0WC which requires hydrometeorContent either as kwarg or in pamtra2’s profile. In addition, N0 has to be provided

  • scattering (func, optional) – Function to describe the single scattering of the hydrometeor. default: scattering.Mie

  • aspectRatio (float, optional) – hydrometeor aspect ratio (default 1.0)

  • Dmin (float, optional) – Smallest boundary of size distribution. Note that Dmin != Dmax is required also for a monodisperse distribution. (default 1e-6)

  • Dmax (float, optional) – Largest boundary of size distribution. Note that Dmin != Dmax is required also for a monodisperse distribution. (default 0.008)

  • N0 (float, optional) – N0 of exponential distribution. (default 8e6)

  • useFuncArgDefaults (bool, optional) – if parameters are not found in any of kwargs, discreteProperties, parent’s profile, then fall back to default values of the function. Helpful for debugging. default True.

  • **kwargs – Further properties if required. Also the parameters defined in defaultArgs (see source) can be overwritten if provided.

name

name of the hydrometeor

Type

str, optional

index

hydrometeor index in parent

Type

int

kind

liquid or frozen hydrometeor?

Type

{‘liquid’, ‘ice’}

nBins

number of size bins

Type

int

discreteProperties

calculated discrete properties

Type

xr.Dataset

calculationOrder

order for estimating the properties

useFuncArgDefaults

if parameters are not found in any of funcArgs, discreteProperties, parent’s profile, then fall back to default values of the function. Helpful for debugging. default True.

Type

bool

description

All properties of the hydrometeor. Most hydrometeors require at least ‘sizeCenter’, ‘aspectRatio’, ‘mass’, ‘density’, ‘crossSectionArea’, and ‘numberConcentration’.

Type

dict

class ice(*args, nBins=2, numberConcentration=numberConcentration.monoDisperseWC, scattering=scattering.Mie, Dmin=0.0001 - 1e-10, Dmax=0.0001 + 1e-10, **kwargs)[source]

Bases: softEllipsoidFixedDensity

hydrometeor class for ice.

Parameters
  • parent (pamtra2 object) – content of parent’s class

  • name (str, optional) – name of the hydrometeor

  • nBins (int, optional) – number of bins. Note taht the spectral radar simulator requires >= 2 hydrometeor bins. (default 2)

  • numberConcentration (func, optional) – Function to describe the size distribution. default: numberConcentration.monoDisperseWC which requires hydrometeorContent either as kwarg or in pamtra2’s profile

  • scattering (func, optional) – Function to describe the single scattering of the hydrometeor. default: scattering.Mie

  • Dmin (float, optional) – Smallest boundary of size distribution. Note that Dmin != Dmax is required also for a monodisperse distribution. (default 1e-5 - 1e-10)

  • Dmax (float, optional) – Largest boundary of size distribution. Note that Dmin != Dmax is required also for a monodisperse distribution. (default 1e-5 + 1e-10)

  • useFuncArgDefaults (bool, optional) – if parameters are not found in any of kwargs, discreteProperties, parent’s profile, then fall back to default values of the function. Helpful for debugging. default True.

  • **kwargs – Further properties if required. Also the parameters defined in defaultArgs (see source) can be overwritten if provided.

name

name of the hydrometeor

Type

str, optional

index

hydrometeor index in parent

Type

int

kind

liquid or frozen hydrometeor?

Type

{‘liquid’, ‘ice’}

nBins

number of size bins

Type

int

discreteProperties

calculated discrete properties

Type

xr.Dataset

calculationOrder

order for estimating the properties

useFuncArgDefaults

if parameters are not found in any of funcArgs, discreteProperties, parent’s profile, then fall back to default values of the function. Helpful for debugging. default True.

Type

bool

description

All properties of the hydrometeor. Most hydrometeors require at least ‘sizeCenter’, ‘aspectRatio’, ‘mass’, ‘density’, ‘crossSectionArea’, and ‘numberConcentration’.

Type

dict

class snow(*args, nBins=2, aspectRatio=1.0, numberConcentration=numberConcentration.exponentialN0WC, scattering=scattering.Mie, Dmin=5e-09, Dmax=0.01, N0=100000.0, massSizeA=0.0121, massSizeB=1.9, areaSizeA=0.4, areaSizeB=1.8, minDensity=100, **kwargs)[source]

Bases: softEllipsoidMassSize

hydrometeor class for snow.