Ethunxxx
Ethunxxx

Reputation: 1337

Spherical harmonic transform with irregular grids on sphere surface

Let's suppose I have a number of data points on the surface of a sphere. These data points lie randomly scattered on the sphere surface, i.e. they aren't distributed on a regular grid such as a Gaussian grid.

My question is: Is there a Python library available that allows me to compute the spherical harmonic transform of this data set? Otherwise, I first have to interpolate the data points onto a regular grid by myself before applying a standard spherical harmonic transform.

For non-uniform Fourier transforms I found several options, e.g. this one. However, for non-uniform spherical harmonic transforms (which are of course related to Fourier transforms) I found none so far.

Upvotes: 0

Views: 1398

Answers (2)

planetaryHam
planetaryHam

Reputation: 58

I see this is an old question, but I'll post this anyway.

One of the best libaries available for spherical harmonics in python or Fortran is shtools. Specifically, check out the function SHExpandLSQ, which uses a least-squares method to find the spherical harmonic expansion coefficients on an irregularly sampled grid.

Upvotes: 3

pyano
pyano

Reputation: 1978

Is it a way, that you first interpolate your data points to a regular grid ? If yes, numpy/scipy has methods for doing that. Have a look in the the manuals:

https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.interpolate.griddata.html

https://docs.scipy.org/doc/scipy-0.16.1/reference/generated/scipy.interpolate.RegularGridInterpolator.html

and a simple example explained here (method 2)

Upvotes: 0

Related Questions