Code Monkey home page Code Monkey logo

Comments (4)

vnmanoharan avatar vnmanoharan commented on August 25, 2024

What is the wavelength? And can you post the code used to calculate the scattering in both cases?

from holopy.

BnM-BnM avatar BnM-BnM commented on August 25, 2024

The wavelength I am using is 465 nm for a sphere with a radius 7.5 micrometres.
I used this code to simulate scattering pattern just I changed the z parameter in both cases:

import holopy as hp
from holopy.scattering import calc_holo, Sphere
from holopy.scattering import Mie
import matplotlib.pyplot as plt

sphere = Sphere(n=1.6, r=7.5, center=(100.0, 100.0, 1000.0))## (Refractive index, Radius in microns, Position in micron)

medium_index = 1.33
illum_wavelen = 0.465
illum_polarization = (1.0, 1.0)
detector = hp.detector_grid(shape=200, spacing=1.0)

Create the scattering theory object

mie = Mie()

holo = calc_holo(detector, sphere, medium_index, illum_wavelen,
illum_polarization, theory='auto')
hp.show(holo)

from holopy.

vnmanoharan avatar vnmanoharan commented on August 25, 2024

@BnM-BnM sorry for the late reply. Because you're calculating the hologram at a distance many times the wavelength, you can use the far-field approximations to the Mie solutions to calculate the hologram, which will avoid the numerical issues you're seeing, and save time and computational effort.

import holopy as hp
from holopy.scattering import calc_holo, Sphere
from holopy.scattering import Mie
import matplotlib.pyplot as plt

sphere = Sphere(n=1.6, r=7.5, center=(100.0, 100.0, 1500.0))## (Refractive index, Radius in microns, Position in micron)

medium_index = 1.33
illum_wavelen = 0.465
illum_polarization = (1.0, 1.0)
detector = hp.detector_grid(shape=200, spacing=1.0)

# use far-field solutions
far_field_mie = Mie(compute_escat_radial=False, full_radial_dependence=False)

# make sure to specify the far-field theory; don't use 'auto' here
holo = calc_holo(detector, sphere, medium_index, illum_wavelen,illum_polarization, theory=far_field_mie)

hp.show(holo)

from holopy.

vnmanoharan avatar vnmanoharan commented on August 25, 2024

Leaving issue open because documentation should be updated to reflect this advice.

from holopy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.