/ritzLavelyPy

Ritzwoller-Lavely Polynomials

Primary LanguagePythonMIT LicenseMIT

ritzLavelyPy

A package to handle Ritzwoller-Lavely polynomials (Ritzwoller & Lavely, 1991) used to represent helioseismic split frequencies using a-coefficients.

Documentation can be found here. (link)

Installing the package

  • Clone the repository ritzLavelyPy into local working directory.
cd /local/working/dir/
git clone https://github.com/samarth-kashyap/ritzLavelyPy.git
  • Enter the cloned directory
cd /local/working/dir/ritzLavelyPy
  • Install the python package
pip install -e .
  • Start using ritzLavelyPy.

Using the package

from ritzLavelyPy import ritzLavelyPoly
ell, jmax = 100, 5 #defining ell and max-degree
RLP = ritzLavelyPoly(ell, jmax)

# generating Ritzwoller-Lavely polynomials
Pjl = RLP.get_Pjl() # the Ritzwoller-Lavely polynomials

# Decomposition of the given array (function of m)
# into Ritzwoller-Lavely polynomials
alm = np.load('alm.npy')
ritz_coeffs = RLP.get_coeffs(alm)

# Polynomial expansion using coefficients
alm_from_coeffs = RLP.polyval(ritz_coeffs)