The following routines are tagged as

TitleExcerpt
backend_module() Return the specified backend module used for the spherical harmonic transforms in pyshtools. Usage module = backend_module([backend, nthreads]) Parameters backend : str, optional, default = preferred_backend() Name of the preferred backend, either ‘shtools’ or ‘ducc’. nthreads : int, optional, default = 1 Number of threads to use...
convert() Convert an array of spherical harmonic coefficients to a different normalization convention. Usage coeffs_out = convert(coeffs_in, [normalization_in, normalization_out, csphase_in, csphase_out, lmax]) Returns coeffs_out : ndarray, size (2, lmax+1, lmax+1) An array of spherical harmonic coefficients with the new normalization convention. Parameters coeffs_in : ndarray...
cross_spectrum() Return the cross-spectrum of the spherical harmonic coefficients as a function of spherical harmonic degree. Usage array = cross_spectrum(clm1, clm2, [normalization, degrees, lmax, convention, unit, base]) Returns array : ndarray, shape (len(degrees)) 1-D ndarray of the spectrum. Parameters clm1 : ndarray, shape (2, lmax...
figstyle() Set matplotlib parameters for creating publication quality graphics. Usage figstyle([rel_width, screen_dpi, aspect_ratio, max_width, figsize, units]) Parameters rel_width : float, optional, default = 0.75 The relative width of the plot (from 0 to 1) wih respect to width. screen_dpi : int, optional, default = 114 The screen resolution...
mag_spectrum() Return the spectrum of the magnetic field as a function of spherical harmonic degree. Usage array = mag_spectrum(clm, a, r, [potential, normalization, degrees, lmax, convention, unit, base]) Returns array : ndarray, shape (len(degrees)) 1-D ndarray of the spectrum. Parameters clm : ndarray, shape (2,...
preferred_backend() Return the name of the current preferred backend used for the spherical harmonic transforms in pyshtools as a string. Usage preferred_backend()
preferred_backend_module() Return a reference to the current preferred backend module used for the spherical harmonic transforms in pyshtools. Usage module = preferred_backend_module()
BAtoHilmDH() Calculate iteratively the relief along an interface of constant density contrast that corresponds to a given Bouguer anomaly using the algorithm of Wieczorek and Phillips (1998). Usage cilm = BAtoHilmDH (ba, grid, nmax, mass, r0, rho, [filter_type, filter_deg, lmax, lmax_calc, smapling]) Returns cilm : float, dimension (2,...
BAtoHilmRhoHDH() Calculate iteratively the relief along an interface with lateral density variations that corresponds to a given Bouguer anomaly using the algorithm of Wieczorek and Phillips (1998). Usage cilm = BAtoHilmRhoHDH (ba, grid, rho, nmax, mass, r0, [filter_type, filter_deg, lmax, lmax_calc, sampling) Returns cilm : float, dimension (2,...
CilmMinusDH() Calculate the gravitational potential interior to relief referenced to a spherical interface using the finite-amplitude algorithm of Wieczorek and Phillips (1998). Usage cilm, d = CilmMinusDH (gridin, nmax, mass, rho, [lmax, n, sampling]) Returns cilm : float, dimension (2, lmax+1, lmax+1) The real spherical harmonic coefficients (geodesy...
CilmMinusRhoHDH() Calculate the gravitational potential interior to relief with lateral variations in density referenced to a spherical interface using the finite-amplitude algorithm of Wieczorek and Phillips (1998). Usage cilm, d = CilmMinusRhoHDH (gridin, nmax, mass, rho, [lmax, n, sampling]) Returns cilm : float, dimension (2, lmax+1, lmax+1) The...
CilmPlusDH() Calculate the gravitational potential exterior to relief referenced to a spherical interface using the finite-amplitude algorithm of Wieczorek and Phillips (1998). Usage cilm, d = CilmPlusDH (gridin, nmax, mass, rho, [lmax, n, sampling]) Returns cilm : float, dimension (2, lmax+1, lmax+1) The real spherical harmonic coefficients (geodesy...
CilmPlusRhoHDH() Calculate the gravitational potential exterior to relief with lateral variations in density referenced to a spherical interface using the finite-amplitude algorithm of Wieczorek and Phillips (1998). Usage cilm, d = CilmPlusRhoHDH (gridin, nmax, mass, rho, [lmax, n, sampling]) Returns cilm : float, dimension (2, lmax+1, lmax+1) The...
ComputeDG82() Compute the tridiagonal matrix of Grunbaum et al. (1982) that commutes with the space-concentration kernel of a spherical cap. Usage dg82 = ComputeDG82 (lmax, m, theta0) Returns dg82 : float, dimension (lmax-abs(m)+1, lmax-abs(m)+1) The tridiagonal matrix of Grunbaum et al. (1982) that commutes with the space-concentration kernel...
ComputeDM() Compute the space-concentration kernel of a spherical cap. Usage dm = ComputeDM (lmax, m, theta0, [degrees]) Returns dm : float, dimension (lmax+1, lmax+1) The space-concentration kernel or angular order m. Parameters lmax : integer The spherical harmonic bandwidth of the windows. m : integer...
ComputeDMap() Compute the space-concentration kernel of an arbitrary mask on the sphere. Usage dij = ComputeDMap (dh_mask, lmax, [n, sampling, degrees]) Returns dij : float, dimension ( (lmax+1)**2, (lmax+1)**2 ) The space-concentration kernel corresponding to the mask dh_mask. Parameters dh_mask : integer, dimension (nin, sampling*nin)...
Curve2Mask() Given a set of latitude and longitude coordinates representing a closed curve, output a gridded binary mask. Usage mask_dh = Curve2Mask (n, profile, np, [nprofile, sampling, extend]) Returns dh_mask : integer, dimension (nlat, nlong) A Driscoll and Healy (1994) sampled grid representing a mask denoted by a...
DHaj() Compute the latitudinal weights used in the Driscoll and Healy (1994) spherical harmonic transform. Usage aj = DHaj (n, [extend]) Returns aj : float, dimension (n) or (n+1) The latitudinal weights used in the spherical harmonic transform. Parameters n : integer The number of...
djpi2() Compute the rotation matrix d(pi/2) used in rotating data expressed in spherical harmonics. Usage dj = djpi2 (lmax) Returns dj : float, dimension (lmax+1, lmax+1, lmax+1) The rotation matrix dj(pi/2). Parameters lmax : integer The maximum spherical harmonic degree of the spherical harmonic rotation....
DownContFilterMA() Compute the minimum-amplitude downward continuation filter of Wieczorek and Phillips (1998). Usage wl = DownContFilterMA (l, half, r, d) Returns wl : float, ndarray The amplitude of the downward continuation filter. Parameters l : integer, array_like The spherical harmonic degree. half : integer, array_like...
DownContFilterMC() Compute the minimum-curvature downward continuation filter of Wieczorek and Phillips (1998). Usage wl = DownContFilterMC (l, half, r, d) Returns wl : float, ndarray The amplitude of the downward continuation filter. Parameters l : integer, array_like The spherical harmonic degree. half : integer, array_like...
GLQGridCoord() Compute the latitude and longitude coordinates used in Gauss-Legendre quadrature grids. Usage latglq, longlq = GLQGridCoord (lmax, [extend]) Returns latglq : float, dimension (lmax+1) The latitude coordinates of a Gauss-Legendre quadrature grid in degrees. longlq : float, dimension (nlong) The longitude coordinates of a Gauss-Lengendre quadrature grid...
legendre() Compute all the associated Legendre functions up to a maximum degree and order. Usage plm = legendre (lmax, z, [normalization, csphase, cnorm, packed]) Returns plm : float, dimension (lmax+1, lmax+1) or ((lmax+1)*(lmax+2)/2) An array of associated Legendre functions, plm[l, m], where l and m are the degree...
legendre_lm() Compute the associated Legendre function for specific degrees and orders. Usage plm = legendre_lm (l, m, z, [normalization, csphase, cnorm]) Returns plm : float, ndarray The associated Legendre functions for degree l and order m. Parameters l : integer, array_like The spherical harmonic degree....
MakeCircleCoord() Compute the coordinates of a circle placed at a given latitude and longitude. Usage coord = MakeCircleCoord (lat, lon, theta0, [cinterval]) Returns coord : float, dimension(360/cinterval, 2) The latitude [:,0] and longitude [:,1] coordinates of the circle in degrees. Parameters lat : float The...
MakeEllipseCoord() Compute the coordinates of an ellipse placed at a given latitude and longitude. Usage coord = MakeEllipseCoord (lat, lon, dec, a_theta, b_theta, [cinterval]) Returns coord :float, dimension(360/cinterval, 2) The latitude [:,0] and longitude [:,1] coordinates of the ellipse in degrees. Parameters lat : float...
MakeGeoidGridDH() Create a global map of the geoid. Usage geoid = MakeGeoidGridDH (cilm, r0, gm, potref, [lmax, omega, r, order, lmax_calc, a, f, sampling, extend]) Returns geoid : float, dimension (nlat, nlong) A global grid of the height to the potential potref above a flattened ellipsoid of equatorial...
MakeGradientDH() Compute the gradient of a scalar function and return grids of the two horizontal components that conform with Driscoll and Healy’s (1994) sampling theorem. Usage theta, phi = MakeGradientDH (cilm, [lmax, sampling, lmax_calc, extend, radius]) Returns theta : float, dimension (nlat, nlong) A 2D map of the...
MakeGravGradGridDH() Create 2D cylindrical maps on a flattened ellipsoid of the components of the gravity “gradient” tensor in a local north-oriented reference frame. Usage vxx, vyy, vzz, vxy, vxz, vyz = MakeGravGradGridDH (cilm, gm, r0, [a, f, lmax, sampling, lmax_calc, extend]) Returns vxx : float, dimension (nlat, nlong)...
MakeGravGridDH() Create 2D cylindrical maps on a flattened and rotating ellipsoid of all three components of the gravity, the gravity disturbance, and the gravitational potential. Usage rad, theta, phi, total, pot = MakeGravGridDH (cilm, gm, r0, [a, f, lmax, sampling, lmax_calc, omega, normal_gravity, extend]) Returns rad : float,...
MakeGravGridPoint() Determine the three components of the gravity vector at a single point. Usage value = MakeGravGridPoint (cilm, gm, r0, r, lat, lon, [lmax, omega, dealloc]) Returns value : float, dimension (3) Vector components (r, theta, phi) of the gravity at (r, lat, lon). Parameters ...
MakeGrid2D() Create a 2D cylindrical map of arbitrary grid spacing from a set of spherical harmonic coefficients. Usage grid = MakeGrid2D (cilm, interval, [lmax, norm, csphase, f, a, north, south, east, west, dealloc]) Returns grid : float, dimension ((north-south)/interval+1, (east-west)/interval+1) A 2D equally spaced map of the input...
MakeGridDH() Create a 2D map from a set of spherical harmonic coefficients using the Driscoll and Healy (1994) sampling theorem. Usage griddh = MakeGridDH (cilm, [lmax, norm, sampling, csphase, lmax_calc, extend]) Returns griddh : float, dimension (nlat, nlong) A 2D map of the input spherical harmonic coefficients cilm...
MakeGridDHC() Create a 2D complex map from a set of complex spherical harmonic coefficients that conforms with Driscoll and Healy’s (1994) sampling theorem. Usage griddh = MakeGridDHC (cilm, [lmax, norm, sampling, csphase, lmax_calc, extend]) Returns griddh : complex, dimension (nlat, nlong) A 2D complex map of the input...
MakeGridGLQ() Create a 2D map from a set of spherical harmonic coefficients sampled on the Gauss-Legendre quadrature nodes. Usage gridglq = MakeGridGLQ (cilm, zero, [lmax, norm, csphase, lmax_calc, extend]) Returns gridglq : float, dimension (nlat, nlong) A 2D map of the function sampled on the Gauss-Legendre quadrature nodes,...
MakeGridGLQC() Create a 2D complex map from a set of complex spherical harmonic coefficients sampled on the Gauss-Legendre quadrature nodes. Usage gridglq = MakeGridGLQC (cilm, zero, [lmax, norm, csphase, lmax_calc, extend]) Returns gridglq : complex, dimension (nlat, nlong) A 2D complex map of the function sampled on the...
MakeGridPoint() Evaluate a real function expressed in real spherical harmonics at a set of points. Usage value = MakeGridPoint (cilm, lat, lon, [lmax, norm, csphase, dealloc]) Returns value : float, ndarray Value of the function at (lat, lon). Parameters cilm : float, dimension (2, lmaxin+1,...
MakeGridPointC() Evaluate a complex function expressed in complex spherical harmonics at a set of points. Usage value = MakeGridPointC (cilm, lat, lon, [lmax, norm, csphase, dealloc]) Returns value : complex, ndarray Value of the function at (lat, lon). Parameters cilm : complex, dimension (2, lmaxin+1,...
MakeMagGradGridDH() Create 2D cylindrical maps on a flattened ellipsoid of the components of the magnetic tensor in a local north-oriented reference frame. Usage vxx, vyy, vzz, vxy, vxz, vyz = MakeMagGradGridDH (cilm, r0, [a, f, lmax, sampling, lmax_calc, extend]) Returns vxx : float, dimension (nlat, nlong) A 2D...
MakeMagGridDH() Create 2D cylindrical maps on a flattened ellipsoid of all three vector components of the magnetic field, the magnitude of the magnetic field, and the magnetic potential. Usage rad, theta, phi, total, pot = MakeMagGridDH (cilm, r0, [lmax, a, f, sampling, lmax_calc, extend]) Returns rad : float,...
MakeMagGridPoint() Determine the three components of the magnetic field vector at a single point. Usage value = MakeMagGridPoint (cilm, a, r, lat, lon, [lmax, dealloc]) Returns value : float, dimension (3) Vector components (r, theta, phi) of the magnetic field at (r, lat, lon). Parameters ...
NormalGravity() Calculate the normal gravity on a flattened ellipsoid in geocentric coordinates using the formula of Somigliana. Usage value = NormalGravity (geocentriclat, gm, omega, a, b) Returns value : float, ndarray The normal gravity in SI units. Parameters geocentriclat: float, array_like Geocentric latitude in degrees....
PlBar() Compute all the 4-pi (geodesy) normalized Legendre polynomials. Usage p = PlBar (lmax, z) Returns p : float, dimension (lmax+1) An array of 4-pi (geodesy) normalized Legendre polynomials up to degree lmax. Degree l corresponds to array index l. Parameters lmax : integer The...
PlBar_d1() Compute all the 4-pi (geodesy) normalized Legendre polynomials and first derivatives. Usage p, dp = PlBar_d1 (lmax, z) Returns p : float, dimension (lmax+1) An array of 4-pi (geodesy) normalized Legendre polynomials up to degree lmax. Degree l corresponds to array index l. dp : float, dimension...
PLegendre() Compute all the unnormalized Legendre polynomials. Usage p = PLegendre (lmax, z) Returns p : float, dimension (lmax+1) An array of unnormalized Legendre polynomials up to degree lmax. Degree l corresponds to array index l. Parameters lmax : integer The maximum degree of the...
PLegendre_d1() Compute all the unnormalized Legendre polynomials and first derivatives. Usage p, dp = PLegendre_d1 (lmax, z) Returns p : float, dimension (lmax+1) An array of unnormalized Legendre polynomials up to degree lmax. Degree l corresponds to array index l. dp : float, dimension (lmax+1) An array of...
PLegendreA() Compute all the unnormalized associated Legendre functions. Usage p = PLegendreA (lmax, z, [csphase]) Returns p : float, dimension ((lmax+1)*(lmax+2)/2) An array of unnormalized associated Legendre functions up to degree lmax. The index corresponds to l*(l+1)/2+m. Parameters lmax : integer The maximum degree of...
PLegendreA_d1() Compute all the unnormalized associated Legendre functions and first derivatives. Usage p, dp = PLegendreA_d1 (lmax, z, [csphase]) Returns p : float, dimension ((lmax+1)*(lmax+2)/2) An array of unnormalized associated Legendre functions up to degree lmax. The index corresponds to l*(l+1)/2+m. dp : float, dimension ((lmax+1)*(lmax+2)/2) An array...
PlmBar() Compute all the 4-pi (geodesy) normalized associated Legendre functions. Usage p = PlmBar (lmax, z, [csphase, cnorm]) Returns p : float, dimension ((lmax+1)*(lmax+2)/2) An array of 4-pi (geodesy) normalized associated Legendre functions up to degree lmax. The index corresponds to l*(l+1)/2+m. Parameters lmax :...
PlmBar_d1() Compute all the 4-pi (geodesy) normalized associated Legendre functions and first derivatives. Usage p, dp = PlmBar_d1 (lmax, z, [csphase, cnorm]) Returns p : float, dimension ((lmax+1)*(lmax+2)/2) An array of 4-pi (geodesy) normalized associated Legendre functions up to degree lmax. The index corresponds to l*(l+1)/2+m. dp :...
PlmIndex() Compute the index of a array of Legendre functions corresponding to degree l and angular order m. Usage index = PlmIndex (l, m) Returns index : integer, ndarray Index of an array of associated Legendre functions corresponding to degree l and angular order m. Parameters...
PlmON() Compute all the orthonormalized associated Legendre functions. Usage p = PlmON (lmax, z, [csphase, cnorm]) Returns p : float, dimension ((lmax+1)*(lmax+2)/2) An array of orthonormalized associated Legendre functions up to degree lmax. The index corresponds to l*(l+1)/2+m. Parameters lmax : integer The maximum degree...
PlmON_d1() Compute all the orthonormalized associated Legendre functions and first derivatives. Usage p, dp = PlmON_d1 (lmax, z, [csphase, cnorm]) Returns p : float, dimension ((lmax+1)*(lmax+2)/2) An array of orthonormalized associated Legendre functions up to degree lmax. The index corresponds to l*(l+1)/2+m. dp : float, dimension ((lmax+1)*(lmax+2)/2) An...
PlmSchmidt() Compute all the Schmidt semi-normalized associated Legendre functions. Usage p = PlmSchmidt (lmax, z, [csphase, cnorm]) Returns p : float, dimension ((lmax+1)*(lmax+2)/2) An array of Schmidt-normalized associated Legendre functions up to degree lmax. The index corresponds to l*(l+1)/2+m. Parameters lmax : integer The maximum...
PlmSchmidt_d1() Compute all the Schmidt semi-normalized associated Legendre functions and first derivatives. Usage p, dp = PlmSchmidt_d1 (lmax, z, [csphase, cnorm]) Returns p : float, dimension ((lmax+1)*(lmax+2)/2) An array of Schmidt-normalized associated Legendre functions up to degree lmax. The index corresponds to l*(l+1)/2+m. dp : float, dimension ((lmax+1)*(lmax+2)/2)...
PlON() Compute all the orthonormalized Legendre polynomials. Usage p = PlON (lmax, z) Returns p : float, dimension (lmax+1) An array of orthonormalized Legendre polynomials up to degree lmax. Degree l corresponds to array index l. Parameters lmax : integer The maximum degree of the...
PlON_d1() Compute all the orthonormalized Legendre polynomials and first derivatives. Usage p, dp = PlON_d1 (lmax, z) Returns p : float, dimension (lmax+1) An array of orthonormalized Legendre polynomials up to degree lmax. Degree l corresponds to array index l. dp : float, dimension (lmax+1) An array of...
PlSchmidt() Compute all the Schmidt-normalized Legendre polynomials. Usage p = PlSchmidt (lmax, z) Returns p : float, dimension (lmax+1) An array of Schmidt-normalized Legendre polynomials up to degree lmax. Degree l corresponds to array index l. Parameters lmax : integer The maximum degree of the...
PlSchmidt_d1() Compute all the Schmidt-normalized Legendre polynomials and first derivatives. Usage p, dp = PlSchmidt_d1 (lmax, z) Returns p : float, dimension (lmax+1) An array of Schmidt-normalized Legendre polynomials up to degree lmax. Degree l corresponds to array index l. dp : float, dimension (lmax+1) An array of...
SHAdmitCorr() Calculate the admittance and correlation spectra of two real functions. Usage admit, error, corr = SHAdmitCorr (gilm, tilm, [lmax]) Returns admit : float, dimension (lmax+1) The admittance function, which is equal to Sgt/Stt. error : float, dimension (lmax+1) The uncertainty of the admittance function, assuming that gilm...
SHBias() Calculate the (cross-)power spectrum expectation of a windowed function from its global spectrum. Usage outcspectra = SHBias (shh, incspectra, [ldata, lwin, save_cg]) Returns outcspectra : float, dimension (ldata+lwin+1) The expectation of the localized (cross-)power spectrum. Parameters shh : float, dimension (lwinin+1) The power spectrum...
SHBiasAdmitCorr() Calculate the expected multitaper admittance and correlation spectra associated with the input global cross-power spectra of two functions. Usage admit, corr = SHAdmitCorr (sgt, sgg, stt, tapers, [lmax, lwin, k, mtdef, taper_wt]) Returns admit : float, dimension (lmax-lwin+1) The biased admittance spectrum obtained using the localized (cross-)power...
SHBiasK() Calculate the multitaper (cross-)power spectrum expectation of a function localized by spherical cap windows. Usage outcspectra = SHBiasK (tapers, incspectra, [lwin, k, ldata, taper_wt, save_cg]) Returns outcspectra : float, dimension (ldata+lwin+1) The expectation of the localized multitaper power spectrum. Parameters tapers : float, dimension...
SHBiasKMask() Calculate the multitaper (cross-)power spectrum expectation of a function localized by arbitrary windows derived from a mask. Usage outcspectra = SHBiasK (tapers, incspectra, [lwin, k, ldata, taper_wt, save_cg]) Returns outcspectra : float, dimension (ldata+lwin+1) The expectation of the multitaper localized power spectrum. Parameters tapers...
SHCilmToCindex() Convert a three-dimensional array of spherical harmonic coefficients to a two-dimensional indexed array. Usage cindex = SHCilmToCindex (cilm, [lmax]) Returns cindex : float, dimension (2, (lmax+1)*(lmax+2)/2) The indexed output spherical harmonic coefficients. Parameters cilm : float, dimension (2, lmaxin+1, lmaxin+1) The input spherical harmonic...
SHCilmToVector() Convert a three-dimensional array of real spherical harmonic coefficients to a 1-dimensional indexed vector. Usage vector = SHCilmToVector (cilm, [lmax]) Returns vector : float, dimension ( (lmax+1)**2 ) The indexed output real spherical harmonic coefficients. Parameters cilm : float, dimension (2, lmaxin+1, lmaxin+1) The...
SHCindexToCilm() Convert a two-dimensional indexed array of spherical harmonic coefficients to a three-dimensional array. Usage cilm = SHCindexToCilm (cindex, [lmax]) Returns cilm : float, dimension (2, lmax+1, lmax+1) The input spherical harmonic coefficients. cilm[0,:,:] and cilm[1,:,:] correspond to either the real and imaginary components, or cosine and sine...
SHConfidence() Compute the probability that two functions are correlated at a given spherical harmonic degree for a given correlation coefficient. Usage prob = SHConfidence (l, corr) Returns prob : float, ndarray Probability that two functions expressed in spherical coefficients with spectral correlation corr are correlated at degree l....
SHctor() Convert complex spherical harmonics to real form. Usage rcilm = SHctor (ccilm, [lmax, convention, switchcs]) Returns rcilm : float, dimension (2, lmax+1, lamx+1) The output real spherical harmonic coefficients. rcilm[0,:,:] and rcilm[1,:,:] correspond to the cosine and sine terms, respectively. Parameters ccilm : float,...
SHExpandDH() Expand an equally sampled or equally spaced grid into spherical harmonics using Driscoll and Healy’s (1994) sampling theorem. Usage cilm = SHExpandDH (griddh, [norm, sampling, csphase, lmax_calc]) Returns cilm : float, dimension (2, n/2, n/2) or (2, lmax_calc+1, lmax_calc+1) The real spherical harmonic coefficients of the function....
SHExpandDHC() Expand an equally sampled or equally spaced complex grid into complex spherical harmonics using Driscoll and Healy’s (1994) sampling theorem. Usage cilm = SHExpandDHC (griddh, [norm, sampling, csphase, lmax_calc]) Returns cilm : complex, dimension (2, n/2, n/2) or (2, lmax_calc+1, lmax_calc+1) The complex spherical harmonic coefficients of...
SHExpandGLQ() Expand a 2D grid sampled on the Gauss-Legendre quadrature nodes into spherical harmonics. Usage cilm = SHExpandGLQ (gridglq, w, zero, [norm, csphase, lmax_calc]) Returns cilm : float, dimension (2, lmax+1, lmax+1) or (2, lmax_calc+1, lmax_calc+1) The real spherical harmonic coefficients of the function. The coefficients C0lm and...
SHExpandGLQC() Expand a 2D grid sampled on the Gauss-Legendre quadrature nodes into spherical harmonics. Usage cilm = SHExpandGLQC (gridglq, w, zero, [norm, csphase, lmax_calc]) Returns cilm : complex, dimension (2, lmax+1, lmax+1) or (2, lmax_calc+1, lmax_calc+1) The complex spherical harmonic coefficients of the complex function. The first index...
SHExpandLSQ() Expand a set of irregularly sampled data points into spherical harmonics using a least squares inversion. Usage cilm, chi2 = SHExpandLSQ (d, lat, lon, lmax, [norm, csphase]) Returns cilm : float, dimension (2, lmax+1, lmax+1) The real spherical harmonic coefficients of the function. The coefficients C0lm and...
SHExpandWLSQ() Expand a set of irregularly sampled data points into spherical harmonics using a weighted least squares inversion. Usage cilm, chi2 = SHExpandLSQ (d, w, lat, lon, lmax, [norm, csphase]) Returns cilm : float, dimension (2, lmax+1, lmax+1) The real spherical harmonic coefficients of the function. The coefficients...
SHFindLWin() Determine the spherical-harmonic bandwidth that is necessary to achieve a certain concentration factor. Usage lwin = SHFindLWin (theta0, m, alpha, [taper_number]) Returns lwin : integer The spherical harmonic bandwidth. Parameters theta0 : float The angular radius of the spherical cap in radians. m :...
SHGLQ() Precompute the weights and nodes used in the Gauss-Legendre quadrature based spherical harmonics routines. Usage zero, w = SHGLQ (lmax) Returns zero : float, dimension (lmax+1) The nodes used in the Gauss-Legendre quadrature over latitude, determined from a call to PreGLQ. w : float, dimension (lmax+1) The...
SHLocalizedAdmitCorr() Calculate the localized admittance and correlation spectra of two functions at a given location using spherical cap localization windows. Usage admit, corr, admit_error, corr_error = SHLocalizedAdmitCorr (gilm, tilm, tapers, taper_order, lat, lon, [k, lwin, lmax, taper_wt, mtdef, k1linsig]) Returns admit : float, dimension (lmax-lwin+1) The admittance function,...
SHMTCouplingMatrix() This routine returns the multitaper coupling matrix for a given set of power spectra of arbitrary localization windows. This matrix relates the expectation of the localized multitaper spectrum to the expectation of the power spectrum of the global function. Usage Mmt = SHMTCouplingMatrix (lmax, tapers_power, [lwin, k, taper_wt]) <h2...
SHMTDebias() Invert for the global power spectrum given a multitaper spectrum estimate formed with spherical cap localization windows. Usage mtdebias, lmid = SHMTDebias (mtspectra, tapers, nl, [lmax, lwin, k, taper_wt]) Returns mtdebias : float, dimension (2, n) The global power spectrum (column 1) and uncertainty (column 2). The...
SHMTVar() Calculate the theoretical variance of a multitaper spectral estimate for a given input power spectrum. Usage variance = SHMTVar (l, tapers, taper_order, sff, [kmax, lwin, taper_wt, nocross]) Returns variance : float The variance of the multitaper spectral estimate for degree l. Parameters l :...
SHMTVarOpt() Calculate the theoretical minimum variance of a localized multitaper spectral estimate and the corresponding optimal weights to apply to each localized spectrum. Usage var_opt, var_unit, weight_opt = SHMTVarOpt (l, tapers, taper_order, sff, [lwin, kmax, nocross]) Returns var_opt : float, dimension (kmax) The minimum variance of the multitaper...
SHMultiply() Multiply two functions and determine the spherical harmonic coefficients of the resulting function. Usage shout = SHMultiply (sh1, sh2, [lmax1, lmax2, norm, csphase]) Returns shout : float, dimension (2, lmax1+lmax2+1, lmax1+lmax2+1) The real spherical harmonic coefficients corresponding to the multiplication of sh1 and sh2 in the space...
SHMultiTaperCSE() Perform a localized multitaper cross-spectral analysis using spherical cap windows. Usage mtse, sd = SHMultiTaperCSE (sh1, sh2, tapers, taper_order, [lmax1, lmax2, lmaxt, k, lat, lon, taper_wt, norm, csphase]) Returns mtse : float, dimension (lmax-lmaxt+1) The localized multitaper cross-power spectrum estimate. lmax is the smaller of lmax1 and...
SHMultiTaperMaskCSE() Perform a localized multitaper cross-spectral analysis using arbitrary windows derived from a mask. Usage mtse, sd = SHMultiTaperMaskCSE (sh1, sh2, tapers, [lmax1, lmax2, lmaxt, k, taper_wt, norm, csphase]) Returns mtse : float, dimension (lmax-lmaxt+1) The localized multitaper cross-power spectrum estimate. lmax is the smaller of lmax1 and...
SHMultiTaperMaskSE() Perform a localized multitaper spectral analysis using arbitrary windows derived from a mask. Usage mtse, sd = SHMultiTaperMaskSE (sh, tapers, [lmax, lmaxt, k, taper_wt, norm, csphase]) Returns mtse : float dimension (lmax-lmaxt+1) The localized multitaper power spectrum estimate. sd : float, dimension (lmax-lmaxt+1) The standard error of...
SHMultiTaperSE() Perform a localized multitaper spectral analysis using spherical cap windows. Usage mtse, sd = SHMultiTaperSE (sh, tapers, taper_order, [lmax, lmaxt, k, lat, lon, taper_wt, norm, csphase]) Returns mtse : float dimension (lmax-lmaxt+1) The localized multitaper power spectrum estimate. sd : float, dimension (lmax-lmaxt+1) The standard error of...
shread() Read shtools-formatted spherical harmonic coefficients from a text file. Usage coeffs, [errors], lmaxout, [header], [header2] = shread( filename, [error=True, header=True, header2=True, lmax, skip, encoding]) Returns coeffs : ndarray, size(2, lmaxout+1, lmaxout+1) The spherical harmonic coefficients. errors : ndarray, size(2, lmaxout+1, lmaxout+1) The errors associated with the spherical...
SHRead2() Read spherical harmonic coefficients from a CHAMP or GRACE-like ascii-formatted file. Usage cilm, lmax, gm, r0_pot, dot, doystart, doyend, epoch = SHRead2 (filename, lmaxin) Returns cilm : float, dimension (2, lmaxin+1, lmaxin+1) The spherical harmonic coefficients contained in filename. lmax : integer The maximum spherical harmonic degree...
SHRead2Error() Read spherical harmonic coefficients from a CHAMP or GRACE-like ascii-formatted file. Usage cilm, error, lmax, gm, r0_pot, dot, doystart, doyend, epoch = SHRead2Error (filename, lmaxin) Returns cilm : float, dimension (2, lmaxin+1, lmaxin+1) The spherical harmonic coefficients contained in filename. error : float, dimension (2, lmaxin+1, lmaxin+1)...
SHReadError (Python) Read spherical harmonic coefficients and associated errors from an ascii-formatted file. Usage cilm, error, lmax = SHReadError (filename, lmaxin, [skip]) Returns cilm : float, dimension (2, lmaxin+1, lmaxin+1) The...
SHReadErrorH (Python) Read spherical harmonic coefficients and associated errors from an ascii-formatted file with a header line. Usage cilm, error, lmax, header = SHReadErrorH (filename, lmaxin, nhead, [skip]) Returns cilm :...
SHReadH (Python) Read spherical harmonic coefficients from an ascii-formatted file with a header line. Usage cilm, lmax, header = SHReadH (filename, lmaxin, nhead, [skip]) Returns cilm : float, dimension (2, lmaxin+1,...
SHReadJPL() Read spherical harmonic coefficients from a JPL ascii-formatted file. Usage cilm, lmax, gm = SHReadJPL (filename, lmaxin, [formatstring]) Returns cilm : float, dimension (2, lmaxin+1, lmaxin+1) The spherical harmonic coefficients contained in filename. lmax : integer The maximum spherical harmonic degree of cilm. gm : float, dimension(2)...
SHReadJPLError() Read spherical harmonic coefficients from a JPL ascii-formatted file. Usage cilm, error, lmax, gm = SHReadJPLError (filename, lmaxin, [formatstring]) Returns cilm : float, dimension (2, lmaxin+1, lmaxin+1) The spherical harmonic coefficients contained in filename. error : float, dimension (2, lmaxin+1, lmaxin+1) The uncertainties associated with the spherical...
SHReturnTapers() Calculate the eigenfunctions of the spherical-cap concentration problem. Usage tapers, eigenvalues, taper_order = SHReturnTapers (theta0, lmax, [degrees]) Returns tapers : float, dimension (lmax+1, (lmax+1)**2) The spherical harmonic coefficients of the (lmax+1)**2 localization windows. Each column contains the coefficients of a single window that possesses non-zero coefficients for...
SHReturnTapersM() Calculate the eigenfunctions of the spherical-cap concentration problem for a single angular order. Usage tapers, eigenvalues = SHReturnTapersM (theta0, lmax, m, [degrees]) Returns tapers : float, dimension (lmax+1, lmax+1) The spherical harmonic coefficients of the lmax+1 localization windows, arranged in columns. The first and last rows of...
SHReturnTapersMap() Calculate the eigenfunctions and eigenvalues of the space-concentration problem for an arbitrary region. Usage tapers, eigenvalues = SHReturnTapersMap (dh_mask, lmax, [n, ntapers, sampling, degrees]) Returns tapers : float, dimension ((lmax+1)**2, ntapers) The spherical harmonic coefficients of the tapers, arranged in columns, from best to worst concentrated. The...
SHRotateCoef() Determine the spherical harmonic coefficients of a real function expressed in complex harmonics rotated by three Euler angles. Usage rcoef = SHRotateCoef (x, coef, dj, [lmax]) Returns rcoef : flaot, dimension (2, (lmax+1)*(lmax+2)/2) The spherical harmonic coefficients of the rotated function in indexed form. Parameters...
SHRotateRealCoef() Determine the spherical harmonic coefficients of a real function rotated by three Euler angles. Usage cilmrot = SHRotateRealCoef (cilm, x, dj, [lmax]) Returns cilmrot : float, dimension (2, lmax+1, lmax+1) The spherical harmonic coefficients of the rotated function, normalized for use with the geodesy 4-pi spherical harmonics....
SHRotateTapers() Rotate orthogonal spherical-cap Slepian functions centered at the North pole to a different location. Usage tapersrot = SHRotateTapers(tapers, taper_order, nrot, x, dj) Returns tapersrot : float, dimension ((lmax+1)**2, nrot) An array containing the spherical harmonic coefficients of the rotated spherical-cap functions, where lmax is the spherical harmonic...
SHrtoc() Convert real spherical harmonics to complex form. Usage ccilm = SHrtoc (rcilm, [lmax, convention, switchcs]) Returns ccilm : float, dimension (2, lmax+1, lmax+1) The output complex spherical harmonic coefficients. ccilm[0,:,:] and ccilm[1,:,:] correspond to the real and complex part of the coefficients, respectively. Only the positive angular...
SHSCouplingMatrix() This routine returns the spherical harmonic coupling matrix for a given set of Slepian basis functions. This matrix relates the power spectrum expectation of the function expressed in a subset of the best-localized Slepian functions to the expectation of the global power spectrum. Usage kij = SHSCouplingMatrix (galpha, nmax)...
SHSCouplingMatrixCap() This routine returns the spherical harmonic coupling matrix for a given set of spherical-cap Slepian basis functions. This matrix relates the power spectrum expectation of the function expressed in a subset of the best-localized Slepian functions to the expectation of the global power spectrum. Usage kij = SHSCouplingMatrixCap (galpha,...
SHSjkPG() Calculate the expectation of the product of two functions, each multiplied by a different data taper, for a given spherical harmonic degree and two different angular orders. Usage value = SHSjkPG (incspectra, l, m, mprime, hj_real, hk_real, mj, mk, lwin, hkcc) Returns value : complex The expectation...
SHSlepianVar() Calculate the theoretical variance of the power of a function expanded in spherical-cap Slepian functions for a given spherical harmonic degree. Usage variance = SHSlepianVar (l, galpha, galpha_order, sff, [kmax]) Returns variance : float The theoretical variance of the spectral estimate for degree l. Parameters...
SHVectorToCilm() Convert a 1-dimensional indexed vector of real spherical harmonic coefficients to a three-dimensional array. Usage cilm = SHVectorToCilm (vector, [lmax]) Returns cilm : float, dimension (2, lmax+1, lmax+1) The 3-D arrary of output real spherical harmonic coefficients. Parameters vector : float, dimension ( (lmaxin+1)**2...
SlepianCoeffs() Determine the expansion coefficients of a function for a given set of input Slepian functions. Usage falpha = SlepianCoeffs(galpha, flm, nmax) Returns falpha : float, dimension (nmax) A vector containing the Slepian coefficients of the input function flm. Parameters galpha : float, dimension ((lmax+1)**2,...
SlepianCoeffsToSH() Convert a function expressed in Slepian coefficients to spherical harmonic coefficients. Usage flm = SlepianCoeffsToSH(falpha, galpha, nmax) Returns flm : float, dimension (2, lmax+1, lmax+1) The spherical harmonic coefficients of the global function. Parameters falpha : float, dimension (nmax) A vector containing the Slepian...
spharm() Compute all the spherical harmonic functions up to a maximum degree. Usage ylm = spharm (lmax, theta, phi, [normalization, kind, csphase, packed, degrees]) Returns ylm : float or complex, dimension (2, lmax+1, lmax+1) or (2, (lmax+1)*(lmax+2)/2) An array of spherical harmonic functions, ylm[i, l, m], where l...
spharm_lm() Compute the spherical harmonic function for specific degrees and orders. Usage ylm = spharm_lm (l, m, theta, phi, [normalization, kind, csphase, degrees]) Returns ylm : float or complex, ndarray The spherical harmonic function ylm, where l and m are the spherical harmonic degree and order, respectively. ...
SphericalCapCoef() Calculate the spherical harmonic coefficients of a spherical cap. Usage coef = SphericalCapCoef (theta, lmax) Returns coef : float, dimension(lmax+1) The zonal spherical harmonic coefficients of a spherical cap centered over the north pole. Parameters theta : float The angular radius of the spherical...
Wigner3j() Compute the Wigner-3j symbols for all allowable values of J. Usage w3j, jmin, jmax = Wigner3j (j2, j3, m1, m2, m3) Returns w3j : float, dimension (j2+j3+1) An array of the Wigner-3j symbols evaluated for all allowable values of j. The minimum and maximum values of j...
YilmIndexVector() Compute the index of a 1D array of spherical harmonic coefficients corresponding to i, l, and m. Usage index = YilmIndexVector (i, l, m) Returns index : integer Index of a 1D array of spherical harmonic coefficients corresponding to i, l, and m. Parameters ...
read_bshc() Read real spherical harmonic coefficients from a binary bshc file. Usage coeffs, lmaxout = read_bshc(filename, [lmax]) Returns coeffs : ndarray, size(2, lmaxout+1, lmaxout+1) The spherical harmonic coefficients. lmaxout : int The maximum spherical harmonic degree read from the file. Parameters filename : str File...
read_dov() Read spherical harmonic coefficients from a text file formatted as [degree, order, value]. Usage coeffs, [errors], lmaxout, [header], [header2] = read_dov( filename, [error=True, header=True, header2=True, lmax, skip, encoding]) Returns coeffs : ndarray, size(2, lmaxout+1, lmaxout+1) The spherical harmonic coefficients. errors : ndarray, size(2, lmaxout+1, lmaxout+1) The errors...
read_icgem_gfc() Read real spherical harmonic gravity coefficients from an ICGEM formatted file. Usage cilm, gm, r0, [errors] = read_icgem_gfc(filename, [errors, lmax, epoch, encoding, quiet) Returns cilm : ndarray, size (2, lmax + 1, lmax + 1) Array of ‘4pi’ normalized spherical harmonic coefficients for the given epoch. gm...
read_igrf() Read IGRF real spherical harmonic coefficients, and return the magnetic potential coefficients for the specified year. Usage read_igrm(filename, [year]) Returns clm : ndarray, size (2, 14, 14) Array of Schmidt semi-normalized coefficients. Parameters filename : str The filename containing the IGRF formatted spherical harmonic...
select_preferred_backend() Select the preferred backend module used for the spherical harmonic transforms in pyshtools. Usage select_preferred_backend_module([backend, nthreads]) Parameters backend : str, optional, default = ‘shtools’ Name of the preferred backend, either ‘shtools’ or ‘ducc’. nthreads : int, optional, default = 1 Number of threads to use for the...
shwrite() Write shtools-formatted spherical harmonic coefficients to a text file. Usage shwrite(filename, coeffs, [errors, header, header2, lmax, encoding]) Parameters filename : str File name of the shtools-formatted spherical harmonic coefficients. If filename ends with ‘.gz’ the file will be automatically compressed with gzip. coeffs : ndarray, size(2, lmaxin+1,...
spectrum() Return the spectrum of the spherical harmonic coefficients as a function of spherical harmonic degree. Usage array = spectrum(clm, [normalization, degrees, lmax, convention, unit, base]) Returns array : ndarray, shape (len(degrees)) 1-D ndarray of the spectrum. Parameters clm : ndarray, shape (2, lmax +...
write_bshc() Write real spherical harmonic coefficients to a binary bshc file. ## Usage write_bshc(filename, coeffs, [lmax]) ## Parameters filename : str : File name of the binary 'bshc'-formatted spherical harmonic coefficients. If filename ends with '.gz' the file will be automatically compressed with gzip. coeffs : ndarray, size(2, lmaxin+1, lmaxin+1) :...
write_dov() Write spherical harmonic coefficients to a text file formatted as [degree, order, value]. ## Usage write_dov(filename, coeffs, [errors, header, header2, lmax, encoding]) ## Parameters filename : str : File name of the 'dov'-formatted spherical harmonic coefficients. If filename ends with '.gz' the file will be automatically compressed with gzip. coeffs...
write_icgem_gfc() Write real spherical harmonic gravity coefficients to an ICGEM formatted file. ## Usage write_icgem_gfc(filename, coeffs, [errors, header, lmax, modelname, gm, r0, product_type, earth_gm, error_kind, tide_system, normalization, format, encoding) ## Parameters filename : str : The filename to save the spherical harmonic ICGEM-formatted coefficients. If filename ends with '.gz' the file...
Edit me