Skip to main content

Vector electromagnetic field calculations in the focus of high NA microscope objectives.

Project description

Just Focus

CI PyPI - Version

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

Extras

Install additional dependencies for making plots:

pip install just-focus[plot]

Then you can use functions in the leb.just_focus.plots module to plot the inputs and results.

from leb.just_focus.plots import plot_inputs

plot_inputs(inputs, pupil)

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

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.

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.

This manuscript was the first to describe the calculation of vectorial focal fields using the fast Fourier transform.

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

just_focus-0.3.0.tar.gz (63.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

just_focus-0.3.0-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

File details

Details for the file just_focus-0.3.0.tar.gz.

File metadata

  • Download URL: just_focus-0.3.0.tar.gz
  • Upload date:
  • Size: 63.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for just_focus-0.3.0.tar.gz
Algorithm Hash digest
SHA256 fa3d70b214ffd622dfbe776934392ded3f20774cfc859cc7a47fd3d0641b090d
MD5 1eb44f9087165591d19695cdf7f777e5
BLAKE2b-256 670e33f9032f5717c8865dc79f3ca936c1318c96b0d3893a59bbfdb572e5dc5a

See more details on using hashes here.

Provenance

The following attestation bundles were made for just_focus-0.3.0.tar.gz:

Publisher: pypi.yml on LEB-EPFL/just-focus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file just_focus-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: just_focus-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 23.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for just_focus-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 361ca9e5755286a9da8f750103fb2c4e5068f49184779303eac9609b9fd78889
MD5 a59c0f0e3914ad47e49ca4e592b349a2
BLAKE2b-256 2c369c730408e3789b3ddb9673f308178cb446dd742af2af6b2246cc906adbcb

See more details on using hashes here.

Provenance

The following attestation bundles were made for just_focus-0.3.0-py3-none-any.whl:

Publisher: pypi.yml on LEB-EPFL/just-focus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page