Thank you for providing this great code! I am encountering an issue with the "Fitting Models to Data" part. When I implement my experiment image in the code and ask it to find the size and refractive index, it only returns the midpoint of the range I defined for these parameters. I know that the size of the particle is 10 micrometres (diameter).
Could you please help me identify what might be causing this issue and how I can correct it?
Thank you in advance for your assistance.
here is the code I am using:
import holopy as hp
import numpy as np
from holopy.core.process import normalize
from holopy.scattering import Sphere, calc_holo
from holopy.scattering.theory import Mie
from holopy.inference import prior, EmceeStrategy, ExactModel
import multiprocessing
import matplotlib.pyplot as plt
import corner
import time
import logging
Hello,
Thank you for providing this great code! I am encountering an issue with the "Fitting Models to Data" part. When I implement my experiment image in the code and ask it to find the size and refractive index, it only returns the midpoint of the range I defined for these parameters. I know that the size of the particle is 10 micrometres (diameter).
Could you please help me identify what might be causing this issue and how I can correct it?
Thank you in advance for your assistance. here is the code I am using:
import holopy as hp import numpy as np from holopy.core.process import normalize from holopy.scattering import Sphere, calc_holo from holopy.scattering.theory import Mie from holopy.inference import prior, EmceeStrategy, ExactModel import multiprocessing import matplotlib.pyplot as plt import corner import time import logging
Configure logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(message)s')
def process_image(imagepath, pix_size, med_n, wl, pol, noise_sd, result_filename): logging.info("Loading and normalizing image...") data_holo = normalize(hp.load_image(imagepath, pix_size, med_n, wl, pol, channel=0)) logging.info("Image loaded and normalized.") hp.show(data_holo)
def main(): start_time = time.time() logging.info("Setting up parameters...") pix_size = 7 # Image pixel spacing noise_sd = 0.5 # Image noise level med_n = 1.33 # Medium Refractive index wl = 0.460 # Wavelength pol = (1, 0) # Polarization
if name == 'main': multiprocessing.freeze_support() main()