Copyright (c) 2012-2024 Kornel JAHN ([email protected])
This repository contains code related to my PhD thesis entitled "The vector Slepian theory of high numerical aperture focusing" (2017), available online at BME MDA, the Budapest University of Technology and Economics Digital Archives.
The repository defines a Python package slepianfocusing
, installable using
e.g. pip
, and also includes some runnable usage examples in the examples
directory.
- Python 3.11 or later; if not available, install it
- on Windows:
- from the official Python download site,
- via the command-line package manager
winget
aswinget install -e --id Python.Python.311
- from the Microsoft Store\
- on Linux: using the package manager of the Linux distribution
- on Windows:
-
Clone this repository locally
-
Create and activate a virtual environment (venv):
python -m venv env
NOTE: in the above command, it is assumed that the Python interpreter can simply be called as
python
. This command might not be present on the actual OS or might not call the right Python version. In this case, replace it by e.g.python3.11.exe
(on Windows) orpython3
orpython3.11
(on Linux). -
Activate the venv:
-
on Windows:
- Windows Command Prompt (a.k.a.
cmd.exe
):env\Scripts\activate.bat
- Windows PowerShell:
env\Scripts\Activate.ps1
- Windows Command Prompt (a.k.a.
-
on Linux (assuming a POSIX-compatible shell):
. env/bin/activate
NOTE: if activation in PowerShell fails with the message that "[...] cannot be loaded because running scripts is disabled on this system", execute the following command in PowerShell:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
After activating the venv, the Python interpreter can simple be called using the
python
command!
-
(Recommended) Upgrade
pip
:python -m pip install --upgrade pip
-
Local ("editable") installation of
slepianfocusing
into the venv that follows source code changes, with all development dependencies included:pip install -e .[devel]
Assuming the slepianfocusing
package has been installed with its development
dependencies, activate the venv and run
pytest tests
After activating the vnev, examples inside the examples
directory can be run
simply as, for instance,
python examples/TODO.py