https://github.com/jonathanschilling/pypspline3
1D to 3D splines with (optional) periodic boundary conditions
https://github.com/jonathanschilling/pypspline3
boundary-conditions interpolation spline stellarator tokamak toroidal-coordinate
Last synced: 2 months ago
JSON representation
1D to 3D splines with (optional) periodic boundary conditions
- Host: GitHub
- URL: https://github.com/jonathanschilling/pypspline3
- Owner: jonathanschilling
- License: gpl-2.0
- Created: 2022-09-20T15:04:50.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-09-22T11:43:10.000Z (over 2 years ago)
- Last Synced: 2025-01-21T12:34:23.325Z (4 months ago)
- Topics: boundary-conditions, interpolation, spline, stellarator, tokamak, toroidal-coordinate
- Language: Fortran
- Homepage:
- Size: 296 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PyPSPLINE
PyPSPLINE is a Python interface to the Fortran spline library [PSPLINE](https://w3.pppl.gov/ntcc/PSPLINE/).
The routines of the `compact` F77 interface are wrapped in Python classes.
Internal documentation of the underlying Fortran routines can be found in the [PSPLINE Help](https://w3.pppl.gov/~pshare/help/pspline.htm)
at [F77_standard_software](https://w3.pppl.gov/~pshare/help/body_pspline_hlp.html#outfile24.html) --> [Compact_Splines](https://w3.pppl.gov/~pshare/help/body_pspline_hlp.html#outfile30.html) .## Usage
The use of this package is demonstrated in a few scripts in the [`demo`](demo/) folder:
* [`demo/demo_1d_periodic_interp.py`](demo/demo_1d_periodic_interp.py)
* [`demo/demo_pspline_1d.py`](demo/demo_pspline_1d.py)
* [`demo/demo_pspline_2d.py`](demo/demo_pspline_2d.py)
* [`demo/demo_pspline_3d.py`](demo/demo_pspline_3d.py)## Prerequisites
* Python 3 (tested with 3.10.7): http://python.org
* NumPy: http://numpy.org/A Fortran 90 and a C compiler.
I assume the platform to be UNIX. If you manage to build PSPLINE/pypspline on Windows, let me know.
## Building PyPSPLINE
A minimal subset of PSPLINE required for 1D, 2D and 3D spline interpolation with periodic boundary conditions
is included in this repository.The setup relies on `numpy.disttools` as suggested in the [`f2py` documentation](https://numpy.org/doc/stable/f2py/buildtools/distutils.html).
This will likely shift to `meson` once [SciPy](https://github.com/scipy/scipy/issues/13615) and NumPy have migrated as well.For now, the build and installation process goes as follows:
```bash
pip install --user .
```The `f2py` signature file [`src/fpspline.pyf`](src/fpspline.pyf) was auto-generated using the included [`run_f2py.sh`](run_f2py.sh) script
and then hand-adjusted to line up with the assumptions made in [the original](https://github.com/jonathanschilling/pypspline/blob/ab3a6858cb77345be1403be16061a27efdcd91a2/pypspline/fpspline/fpspline.pyf).For Arch Linux users, a `PKGBUILD` is available at [`aur/PKGBUILD`](aur/PKGBUILD).
## History
This package was originally created by Alexander Pletzer
and published on SourceForce as [`pypspline`](https://sourceforge.net/projects/pypspline/).The old [PyPSPLINE CVS repository](https://sourceforge.net/projects/pypspline/) was migrated to this Git repository.
One needs the `cvs` and `cvs2svn` packages to do this on Arch Linux.```bash
rsync -ai a.cvs.sourceforge.net::cvsroot/pypspline/ cvs2git-pypspline
cd cvs2git-pypspline
cvs2git --blobfile=blob.dat --dumpfile=dump.dat \
--username=pletzer --default-eol=native \
--encoding=utf8 --encoding=latin1 --fallback-encoding=ascii \
.
cd ..
mkdir pypspline
cd pypspline
git init
cat ../cvs2git-pypspline/blob.dat ../cvs2git-pypspline/dump.dat | git fast-import
git remote add origin [email protected]:jonathanschilling/pypspline.git
git checkout
git push origin --mirror
mv pypspline{,_old}
mv pypspline_old/* .
rmdir pypspline_old
rm -r CVSROOT
git add .
git commit -m "one folder less"
git branch --set-upstream-to=origin/master master
git pull
git push
```