climakitae.tools package#
Submodules#
climakitae.tools.batch module#
- climakitae.tools.batch.batch_select(approach: str, selections: DataParameters, points: ndarray, load_data: bool = False, progress_bar: bool = True) DataArray#
Conducts batch mode analysis on a series of points for a given metric.
- Parameters:
approach (
str)selections (
DataParameters) – Selections object that describes the area of interest. The area_subset and cached_area attributes are automatically overwritten.points (
np.ndarray) – An array at lat/lon points to gather the specified data at.load_data (
boolean) – A boolean that tells the function whether or not to load the data into memory.progress_bar (
boolean) – A boolean that determines whether progress bar is displayed.
- Returns:
cells_of_interest (
DataArray) – Gridcells that the points lie within, aggregated together into one DataArray. It can or cannot be loaded into memory, depending on load_data.
climakitae.tools.derived_variables module#
Functions for deriving frequently used variables
- climakitae.tools.derived_variables.compute_dewpointtemp(temperature: DataArray, rel_hum: DataArray) DataArray#
Calculate dew point temperature
- climakitae.tools.derived_variables.compute_hdd_cdd(t2: DataArray, hdd_threshold: int, cdd_threshold: int) tuple[DataArray, DataArray]#
Compute heating degree days (HDD) and cooling degree days (CDD)
- climakitae.tools.derived_variables.compute_hdh_cdh(t2: DataArray, hdh_threshold: int, cdh_threshold: int) tuple[DataArray, DataArray]#
Compute heating degree hours (HDH) and cooling degree hours (CDH)
- climakitae.tools.derived_variables.compute_relative_humidity(pressure: DataArray, temperature: DataArray, mixing_ratio: DataArray, name: str = 'rh_derived') DataArray#
Compute relative humidity. Variable attributes need to be assigned outside of this function because the metpy function removes them
- Parameters:
- Returns:
rel_hum (
DataArray) – Relative humidity
Source: https://www.weather.gov/media/epz/wxcalc/mixingRatio.pdf
- climakitae.tools.derived_variables.compute_specific_humidity(tdps: DataArray, pressure: DataArray, name: str = 'q2_derived') DataArray#
Compute specific humidity.
- climakitae.tools.derived_variables.compute_wind_dir(u10: DataArray, v10: DataArray, name: str = 'wind_direction_derived') DataArray#
Compute wind direction at 10 meters
- Parameters:
- Returns:
wind_dir (
DataArray) – Wind direction, in [0, 360] degrees, with 0/360 defined as north, by meteorological convention
Notes
source: https://sites.google.com/view/raybellwaves/cheat-sheets/xarray
climakitae.tools.indices module#
Functions for deriving indices
- climakitae.tools.indices.effective_temp(T: DataArray) DataArray#
Compute effective temperature Effective Temp = (1/2)*(yesterday’s effective temp) + (1/2)*(today’s actual temp) To make sense of the expansion, today’s ET is consist of a portion of the actual temperature of each day up to today–half of today’s temp, 1/4 of yesterday’s temp, 1/8 of the day before yesterday’s temp etc, thus it’s “an exponentially smoothed temperature” as stated in the glossary of the reference. This derivation only considers 4 days of temperature data in the computation of EFT: today, yesterday, the day before yesterday, and two days before yesterday. Thus, the first 3 timesteps of the EFT will be NaN.
- Parameters:
T (
DataArray) – Daily air temperature in any units- Returns:
eft (
DataArray) – Effective temperature
References
- climakitae.tools.indices.fosberg_fire_index(t2_F: DataArray, rh_percent: DataArray, windspeed_mph: DataArray) DataArray#
Compute the Fosberg Fire Weather Index. Use hourly weather as inputs. Ensure that the input variables are in the correct units (see below).
- Parameters:
- Returns:
FFWI (
DataArray) – Fosberg Fire Weather Index computed for each grid cell
References
https://a.atmos.washington.edu/wrfrt/descript/definitions/fosbergindex.html sharppy/SHARPpy https://www.spc.noaa.gov/exper/firecomp/INFO/fosbinfo.html
- climakitae.tools.indices.noaa_heat_index(T: DataArray, RH: DataArray) DataArray#
Compute the NOAA Heat Index. Heat Index quantifies the perceived “real feel” of air temperature on the human body, including the impact of humidity. See references for more information on this derived variable.
- Parameters:
- Returns:
HI (
DataArray) – Heat index per timestep
References
NOAA: https://www.wpc.ncep.noaa.gov/html/heatindex_equation.shtml NCAR NCL documentation: https://www.ncl.ucar.edu/Document/Functions/Heat_stress/heat_index_nws.shtml