{"id":22563984,"url":"https://github.com/markmbaum/orthopoly","last_synced_at":"2025-04-10T11:38:10.692Z","repository":{"id":55620471,"uuid":"243561456","full_name":"markmbaum/orthopoly","owner":"markmbaum","description":"Python functions for orthogonal polynomials and (real, 2D, orthonormal) spherical harmonics","archived":false,"fork":false,"pushed_at":"2023-08-20T14:26:00.000Z","size":3083,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T10:21:19.741Z","etag":null,"topics":["chebyshev","polynomials","spherical-harmonics"],"latest_commit_sha":null,"homepage":"https://markmbaum.github.io/orthopoly/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markmbaum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-27T16:22:49.000Z","updated_at":"2024-04-06T04:18:16.000Z","dependencies_parsed_at":"2022-08-15T04:40:31.342Z","dependency_job_id":null,"html_url":"https://github.com/markmbaum/orthopoly","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markmbaum%2Forthopoly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markmbaum%2Forthopoly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markmbaum%2Forthopoly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markmbaum%2Forthopoly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markmbaum","download_url":"https://codeload.github.com/markmbaum/orthopoly/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248209150,"owners_count":21065292,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chebyshev","polynomials","spherical-harmonics"],"created_at":"2024-12-07T23:13:42.207Z","updated_at":"2025-04-10T11:38:10.670Z","avatar_url":"https://github.com/markmbaum.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# orthopoly\n\n[![docs](https://img.shields.io/badge/docs-stable-blue)](https://markmbaum.github.io/orthopoly/) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.8093092.svg)](https://doi.org/10.5281/zenodo.8093092) ![Downloads](https://static.pepy.tech/badge/orthopoly)\n\nThis is a package for using sets of orthogonal functions/polynomials. It includes Chebyshev, Legendre, and Gegenbauer polynomials. It also has real, two-dimensional spherical harmonics. It was a side project and you can use it almost however you like. **Documentation** is available [**here**](https://markmbaum.github.io/orthopoly).\n\n### Installing/Using\n\nTo install the package, you can\n\n\t\u003e pip install orthopoly\n\nor you can download/clone the repository, put the top directory in your `sys.path`, then import it.\n\n### chebyshev\n\nThe `chebyshev` module is pretty well developed. It includes many functions for evaluating the Chebyshev polynomials and their derivatives. The module also includes higher level functions for setting up the elements needed to solve boundary value problems (using the pseudospectral method), interpolate using a Chebyshev grid, and perform the spatial discretization of a PDE solver. Generally, these methods are very well suited to smooth problems.\n\nTwo example notebooks are available:\n* [boundary value problem notebook](https://nbviewer.jupyter.org/github/markmbaum/orthopoly/blob/master/notebooks/chebyshev_BVP.ipynb)\n* [interpolation notebook](https://nbviewer.jupyter.org/github/markmbaum/orthopoly/blob/master/notebooks/chebyshev_interpolation.ipynb)\n\nFor performing a discrete Chebyshev transform (generating a Chebyshev expansion from a set of points in 1D), the `cheby_coef_setup` function can be used. It allows one of the boundary conditions to be the value of the expansion's first derivative and returns a matrix allowing expansion coefficents to be computed by solving a linear system. When there are no derivatives, the transform can be computed (on the appropriate `cheby_grid`) with a discrete cosine transform (DCT). The `cheby_dct` function does this and `cheby_dct_setup` sets up the grid as well.\n\nInformation about the Chebyshev polynomials is widely available, but a few particularly helpful references are below. The Boyd book is especially good.\n\n* Boyd, John P. *Chebyshev and Fourier spectral methods*. Courier Corporation, 2001.\n* Fornberg, Bengt. *A practical guide to pseudospectral methods. Vol. 1*. Cambridge university press, 1998.\n* Canuto, Claudio, et al. *Spectral methods*. Springer-Verlag, Berlin, 2006.\n\n### gegenbauer\n\nGegenbauer polynomials are generalizations of Chebyshev and Legendre polynomials. However, Chebyshev polynomials of the first kind are implemented by other methods in the `chebyshev` module, and cannot be computed by the functions in this module.\n\n### legendre\n\nThis module implements the Associated Legendre Polynomials and their first two derivatives in support of the `spherical_harmonic` module. If `m=0`, they reduce to the unassociated Legendre polynomials.\n\n### spherical_harmonic\n\nThe `spherical_harmonic` module provides functions for evaluating the real, two-dimensional (surface), orthonormal, spherical harmonics.  From the associated Legendre polynomials, the spherical harmonics, their gradients, and their Laplacians can be evaluated. The module also contains some functions for creating grids on the sphere (regular, icosahedral, and Fibonacci) and for creating random spherical harmonic expansions with specific power density relationships (noise). The module does not have functions for performing spherical harmonic analysis (transforming from values on the sphere to expansion coefficients).\n\nFor some applications, fitting a spherical harmonic expansion to data in spherical coordinates is useful. A least squares fit can be computed with the pseudoinverse of a matrix full of spherical harmonic function evaluations (see `sph_har_matrix` and related functions). However, this should only be done when the number of points is much greater than the number of terms in the fitted expansion.\n\nThe books cited above have some good discussion of spherical harmonics. Other useful sources include:\n\n* Press, William H., et al. *Numerical recipes 3rd edition: The art of scientific computing*. Cambridge university press, 2007.\n* Dahlen, F., and Jeroen Tromp. *Theoretical global seismology*. Princeton university press, 1998.\n* Bosch, W. \"On the computation of derivatives of Legendre functions.\" Physics and Chemistry of the Earth, Part A: Solid Earth and Geodesy 25.9-11 (2000): 655-659.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkmbaum%2Forthopoly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkmbaum%2Forthopoly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkmbaum%2Forthopoly/lists"}