geocat.comp.spherical.decomposition#
- geocat.comp.spherical.decomposition(data, scale, theta, phi, max_harm=23)#
Calculate the spherical harmonics of a dataset.
- Parameters:
data (
numpy.ndarray,xarray.DataArray) – 2-dimensional datasetscale (
numpy.ndarray,xarray.DataArray) – 2-dimensional array containing the weighting of each point in the data. This is usually the area of the voronoi cell centered on the corresponding datapoint. thegeocat.comp.spherical.scale_voronoi(theta,phi)function can provide a scale array.theta (
numpy.ndarray,xarray.DataArray) – 2-dimensional array containing the theta (longitude in radians) values for each datapoint in data.phi (
numpy.ndarray,xarray.DataArray) – 2-dimensional array containing thetheta(latitude in radians) values for each datapoint in data.Phiis zero at the top of the sphere andpiat the bottom,phi = (lat_degrees-90)*(-1)*pi/180max_harm (
int, optional) – The maximum harmonic value for both m and n. The total of harmonics calculated is(max_harm+1)*(max_harm+2)/2Defaults to 23, for 300 total harmonics.
- Returns:
decomposition (
numpy.ndarray,xarray.DataArray) – The spherical harmonic decomposition of the input data