Vector electromagnetic field calculations in the focus of high NA microscope objectives.
Project description
Just Focus
Just Focus is a Python package for computing vectorial electromagnetic fields in the focus of high numerical aperture microscope objectives.
Quickstart
Compute the field in the focal plane (z = 0.0) of a NA 1.4 oil immersion microscope objective assuming a linearly polarized, paraxial Gaussian beam with a waist size equal to the radius of the objective's back aperture. Use a hyperbolic tangent function to smooth the boundary of the stop and zero pad the mesh so that the final square mesh has 64 * 2^4 = 1024 samples in each direction.
import numpy as np
from leb.just_focus import InputField, Polarization, Pupil, Stop
mesh_size = 64
pupil = Pupil(
na=1.4,
refractive_index=1.518,
wavelength_um=0.561,
mesh_size=mesh_size,
stop=Stop.TANH,
)
inputs = InputField.gaussian_pupil(
beam_center=(0.0, 0.0),
waist=1.0,
mesh_size=mesh_size,
polarization=Polarization.LINEAR_Y,
)
results = pupil.propgate(0.0, inputs, padding_factor=4)
Installation
pip install just-focus
Development
Set up the development environment
Development requires uv.
After cloning this repo, run the following command from the project's root directory:
uv sync --all-extras
This will create a virtual environment with the required dependencies in a folder named .venv.
Tests
Just run pytest from the project's root directory:
pytest
Other Packages to Compute Vectorial Focal Fields
- InFocus (MATLAB) https://github.com/QF06/InFocus
- Debye Diffraction Code (MATLAB and Python) https://github.com/jdmanton/debye_diffraction_code
Resources
- I. Herrera and P. A. Quinto-Su, "Simple computer program to calculate arbitrary tightly focused (propagating and evanescent) vector light fields," arXiv:2211.06725 (2022). https://doi.org/10.48550/arXiv.2211.06725.
This manuscript describes the specific numerical implementation of the vectorial field propagation algorithm used here.
- K. M. Douglass, "Coordinate Systems for Modeling Microscope Objectives," (2024). https://kylemdouglass.com/posts/coordinate-systems-for-modeling-microscope-objectives/
This blog post explains how to set up the various coordinate systems and numerical meshes for evaluating the results of the Richards-Wolf model for high NA objectives.
- M. Leutenegger, R. Rao, R. A. Leitgeb, and T. Lasser. Fast focus field calculations. Opt. Express 14, 11277-11291 (2006). https://doi.org/10.1364/OE.14.011277
This manuscript was the first to describe the calculation of vectorial focal fields using the fast Fourier transform.
- L. Novotny and B. Hecht, "Principles of Nano-Optics," Cambridge University Press, pp. 56 - 66 (2006). https://doi.org/10.1017/CBO9780511813535
Chapter 3 contains the derivation of the field at the focus of an aplanatic lens.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file just_focus-0.2.1.tar.gz.
File metadata
- Download URL: just_focus-0.2.1.tar.gz
- Upload date:
- Size: 62.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6017141360a3578905e1dba8dc9cab7e5010e6620594594978ae36728098b145
|
|
| MD5 |
0ecc8073dd6aa7031e97615024a96215
|
|
| BLAKE2b-256 |
bc0d7963acdcbbf4206ccd3a9b4f47da0b3d06a41665972d8b94efe41dbb41a8
|
Provenance
The following attestation bundles were made for just_focus-0.2.1.tar.gz:
Publisher:
pypi.yml on LEB-EPFL/just-focus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
just_focus-0.2.1.tar.gz -
Subject digest:
6017141360a3578905e1dba8dc9cab7e5010e6620594594978ae36728098b145 - Sigstore transparency entry: 351454984
- Sigstore integration time:
-
Permalink:
LEB-EPFL/just-focus@676022fba8d5b69c7b7a2fede746b23e31d844a3 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/LEB-EPFL
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@676022fba8d5b69c7b7a2fede746b23e31d844a3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file just_focus-0.2.1-py3-none-any.whl.
File metadata
- Download URL: just_focus-0.2.1-py3-none-any.whl
- Upload date:
- Size: 22.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe704db1c7f34175ab59666e7f84190d49e32ba24564bccd3397236db9787f9f
|
|
| MD5 |
e4cc4132a4f63522a800f4b2c8a7d2f0
|
|
| BLAKE2b-256 |
bf33a88eb7fd250521d65951ace9e528f42c425bd09e38f07b8ef1ce79f50da8
|
Provenance
The following attestation bundles were made for just_focus-0.2.1-py3-none-any.whl:
Publisher:
pypi.yml on LEB-EPFL/just-focus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
just_focus-0.2.1-py3-none-any.whl -
Subject digest:
fe704db1c7f34175ab59666e7f84190d49e32ba24564bccd3397236db9787f9f - Sigstore transparency entry: 351454995
- Sigstore integration time:
-
Permalink:
LEB-EPFL/just-focus@676022fba8d5b69c7b7a2fede746b23e31d844a3 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/LEB-EPFL
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@676022fba8d5b69c7b7a2fede746b23e31d844a3 -
Trigger Event:
release
-
Statement type: