Normalization

The Eq. 3 primitive shared by every test.

The Eq. 3 normalization primitive used by every DEBRA test.

shachen.norm.normalize(x, bounds: Bounds)[source]

N(x) = clip((x - MIN) / (MAX - MIN), 0, 1) (Miller et al. 2017, Eq. 3).

Works on scalars, numpy arrays, and xarray DataArrays. bounds.min may exceed bounds.max (used for the cos-zenith blends specified in zenith-angle space): the sense of the ramp reverses.

shachen.norm.normalize_cos_zenith(zenith_deg, zenith_bounds_deg: Bounds, exponent: float)[source]

N(cos(theta); cos(MIN_deg), cos(MAX_deg)) ** exponent (Eqs. 20-21, 25).