Internal API

Routines

Extraction and Diagnostic Routines

The routines below are called internally by wrf.getvar().

wrf.cape.get_2dcape Return the 2d fields of CAPE, CIN, LCL, and LFC.
wrf.cape.get_3dcape Return the three-dimensional CAPE and CIN.
wrf.cloudfrac.get_cloudfrac Return the cloud fraction.
wrf.ctt.get_ctt Return the cloud top temperature.
wrf.dbz.get_dbz Return the simulated radar reflectivity.
wrf.dbz.get_max_dbz Return the maximum simulated radar reflectivity.
wrf.dewpoint.get_dp Return the dewpoint temperature.
wrf.dewpoint.get_dp_2m Return the 2m dewpoint temperature.
wrf.geoht.get_geopt Return the geopotential.
wrf.geoht.get_height Return the geopotential height.
wrf.helicity.get_srh Return the storm relative helicity.
wrf.helicity.get_uh Return the updraft helicity.
wrf.omega.get_omega Return Omega.
wrf.pressure.get_pressure Return the pressure in the specified units.
wrf.pressure.get_pressure_hpa Return the pressure in [hPa].
wrf.pw.get_pw Return the preciptiable water.
wrf.rh.get_rh Return the relative humidity.
wrf.rh.get_rh_2m Return the 2m relative humidity.
wrf.slp.get_slp Return the sea level pressure in the specified units.
wrf.temp.get_theta Return the potential temperature.
wrf.temp.get_temp Return the temperature in the specified units.
wrf.temp.get_eth Return the equivalent potential temperature.
wrf.temp.get_tv Return the virtual temperature.
wrf.temp.get_tw Return the wetbulb temperature.
wrf.temp.get_tk Return the temperature in [K].
wrf.temp.get_tc Return the temperature in [degC].
wrf.terrain.get_terrain Return the terrain height in the specified units.
wrf.times.get_times Return a sequence of time objects.
wrf.times.get_xtimes Return a sequence of time objects.
wrf.uvmet.get_uvmet Return the u,v wind components rotated to earth coordinates.
wrf.uvmet.get_uvmet10 Return the u,v components for the 10m winds rotated to earth coordinates.
wrf.uvmet.get_uvmet_wspd_wdir Return the wind speed and wind direction for the wind rotated to earth coordinates.
wrf.uvmet.get_uvmet10_wspd_wdir Return the wind speed and wind direction for the 10m wind rotated to earth coordinates.
wrf.vorticity.get_avo Return the absolute vorticity.
wrf.vorticity.get_pvo Return the potential vorticity.
wrf.wind.get_u_destag Return the u-component of the wind on mass points.
wrf.wind.get_v_destag Return the v-component of the wind on mass points.
wrf.wind.get_w_destag Return the w-component of the wind on mass points.
wrf.wind.get_destag_wspd_wdir Return the wind speed and wind direction for the wind in the projected coordinate space.
wrf.wind.get_destag_wspd_wdir10 Return the wind speed and wind direction for the 10m wind in projected coordinate space.

Decorators

Algorithm Decorators

The decorators below are used for performing common operations related to diagnostic and interpolation calculations.

wrf.decorators.convert_units A decorator that converts the units from the wrapped function’s output.
wrf.decorators.left_iteration A decorator to handle iterating over the leftmost dimensions.
wrf.decorators.cast_type A decorator to handle type casting.
wrf.decorators.extract_and_transpose A decorator to extract the data array from a xarray.DataArray
wrf.decorators.check_args A decorator to check that the wrapped function’s arguments are valid.
wrf.specialdec.uvmet_left_iter A decorator to handle iterating over the leftmost dimensions for the uvmet diagnostic.
wrf.specialdec.cape_left_iter A decorator to handle iterating over the leftmost dimensions for the cape diagnostic.
wrf.specialdec.cloudfrac_left_iter A decorator to handle iterating over the leftmost dimensions for the cloud fraction diagnostic.

Metadata Decorators

The decorators below are used for performing common operations related to setting metadata.

wrf.metadecorators.copy_and_set_metadata A decorator that sets the metadata for a wrapped function’s output.
wrf.metadecorators.set_wind_metadata A decorator that sets the metadata for a wrapped wind function’s output.
wrf.metadecorators.set_cape_metadata A decorator that sets the metadata for a wrapped CAPE function’s output.
wrf.metadecorators.set_cloudfrac_metadata A decorator that sets the metadata for a wrapped cloud fraction function’s output.
wrf.metadecorators.set_latlon_metadata A decorator that sets the metadata for a wrapped latlon function’s output.
wrf.metadecorators.set_height_metadata A decorator that sets the metadata for a wrapped height function’s output.
wrf.metadecorators.set_interp_metadata A decorator that sets the metadata for a wrapped interpolation function.
wrf.metadecorators.set_alg_metadata A decorator that sets the metadata for a wrapped raw diagnostic function.
wrf.metadecorators.set_uvmet_alg_metadata A decorator that sets the metadata for the wrapped raw UVMET diagnostic function.
wrf.metadecorators.set_cape_alg_metadata A decorator that sets the metadata for the wrapped raw CAPE diagnostic function.
wrf.metadecorators.set_cloudfrac_alg_metadata A decorator that sets the metadata for the wrapped raw cloud fraction diagnostic function.
wrf.metadecorators.set_destag_metadata A decorator that sets the metadata for the wrapped raw destaggering function.

Decorator Utilities

The routines below are used within the decorators.

wrf.either A callable class that determines which variable is present in the file.
wrf.combine_dims A callable class that mixes dimension sizes from different function arguments.
wrf.from_var A callable class that retrieves attributes from the function argument.
wrf.from_args Return a mapping of argument name to value for the called function.
wrf.args_to_list Return all of the function arguments, including defaults, as a list.
wrf.arg_location Return the function arguments as a single list along with the index within that list for a specified argument name.

Classes

Iterable Wrapper Class

The class below is an Iterable wrapper class and provides an __iter__ function that always returns the beginning of the sequence, regardless of the Iterable type.

wrf.IterWrapper A wrapper class for generators and custom iterable classes that returns a new iterator to the start of the sequence when IterWrapper.__iter__() is called.