neutral_atom_image_analysis package

Submodules

neutral_atom_image_analysis.api module

API for neutral_atom_image_analysis package.

neutral_atom_image_analysis.image_analysis module

Neutral atom image analysis wrapper

class neutral_atom_image_analysis.image_analysis.ImageAnalysis

Bases: ABC

abstractmethod calibrate()
abstractmethod reconstruct(image)
class neutral_atom_image_analysis.image_analysis.ImageAnalysisProjection(psf_supersample=1, print_info=False)

Bases: ImageAnalysis

calibrate(images, average_closed_shutter_image=None, proj_shape: tuple[int, int] = None, min_cal_samples=None, site_detection_threshold=0.2, extend_locations_to_fov=False, psf_distance_mult=2, camera_noise_reduction_method='image', angle_guesses: tuple[int, int] = (90, 0), optimize_locations_individually=False, remove_sites_under_fit_height_percentile=None, histogram_path=None)

Function to calibrate the image analysis

Parameters:
  • images (list) – The images to be used for calibration. Should be iterable with each element being either a DataFrame or convertible to a numpy array

  • average_closed_shutter_image (numpy.array[float], optional) – Average image without atoms or with closed shutter. Used to reduce camera noise if camera_noise_reduction_method = “image”, defaults to None

  • proj_shape (tuple[int,int], optional) – Size of projection kernel. Will be set automatically based on atom spacing if not provided, defaults to None

  • min_cal_samples (int, optional) – Number of samples to calibrate detection threshold. If min_cal_samples > len(images), spatially close sites are grouped together for threshold calibration. Groups all sites together if None. Set to 0 if grouping is never desired, defaults to None

  • site_detection_threshold (int, optional) – Fraction of maximum projection peak height to assume traps, defaults to 0.2

  • extend_locations_to_fov (bool, optional) – If set to True, extend atom location grid in all directions within image coordinates, defaults to False

  • psf_distance_mult (float, optional) – To consider a pixel for PSF calibration, the second-nearest atom must be at least psf_distance_mult times as distant as the nearest. Bigger values reduce noise at PSf edge but reduce maximum meaningful PSF size, defaults to 2

  • camera_noise_reduction_method (string, optional) – Method of reducing camera noise, “border” to use median pixel value of images at the edges, “rowcol” to use median value of images per row and column, “image” to use provided average_closed_shutter_image. If “image” and not average_closed_shutter_image provided, “rowcol” is used, defaults to “image”

  • angle_guesses (tuple[int,int], optional) – Approximate angle of the two grid axes with respect to image axis, defaults to (90,0)

  • optimize_locations_individually (bool, optional) – Whether to move each trap location individually to maximize alignment with local brightness peak. Otherwise only alignment with grid, default to False

  • remove_sites_under_fit_height_percentile (float, optional) – Remove trap locations from the grid where the detected brightness peak is very low. All sites are removed where the peak height is below the percentile point function of remove_sites_under_fit_height_percentile and the fitted peak-height-parameters across all sites. Does not remove any sites if None, defaults to None

  • histogram_path (string, optional) – Path used to save threshold histograms during calibration. Histograms not saved if None, defaults to None

Raises:

AttributeError – Combination of attributes is not meaningful

Returns:

List of detection threshold per site, [Empty-peak emission values, Occupied-peak emission values], Fidelity per atom site, Fidelity0 (Fraction of empty sites detected as such) per atom site, Fidelity1 (Fraction of occupied sites detected as such) per atom site, Filling ratio

Return type:

list[float], [list[float], list[float]], list[float], list[float], list[float], float

calibrate_from_known(images, atom_locations: list[tuple[float, float]], psf=None, average_closed_shutter_image=None, proj_shape: tuple[int, int] = None, min_cal_samples=None, psf_distance_mult=2, camera_noise_reduction_method='image')

Function to calibrate the image analysis from known list of atom locations

Parameters:
  • images (list) – The images to be used for calibration. Should be iterable with each element being either a DataFrame or convertible to a numpy array

  • psf (numpy.array[float], optional) – The point-spread function if it is already known. Will be calibrated if None, defaults to None

  • average_closed_shutter_image (numpy.array[float], optional) – Average image without atoms or with closed shutter. Used to reduce camera noise if camera_noise_reduction_method = “image”, defaults to None

  • proj_shape (tuple[int,int], optional) – Size of projection kernel. Will be set automatically based on atom spacing if not provided, defaults to None

  • min_cal_samples (int, optional) – Number of samples to calibrate detection threshold. If min_cal_samples > len(images), spatially close sites are grouped together for threshold calibration. Groups all sites together if None. Set to 0 if grouping is never desired, defaults to None

  • psf_distance_mult (float, optional) – To consider a pixel for PSF calibration, the second-nearest atom must be at least psf_distance_mult times as distant as the nearest. Bigger values reduce noise at PSf edge but reduce maximum meaningful PSF size, defaults to 2

  • camera_noise_reduction_method (string, optional) – Method of reducing camera noise, “border” to use median pixel value of images at the edges, “rowcol” to use median value of images per row and column, “image” to use provided average_closed_shutter_image. If “image” and not average_closed_shutter_image provided, “rowcol” is used, defaults to “image”

Raises:

AttributeError – Combination of attributes is not meaningful

Returns:

List of detection threshold per site, [Empty-peak emission values, Occupied-peak emission values], Fidelity per atom site, Fidelity0 (Fraction of empty sites detected as such) per atom site, Fidelity1 (Fraction of occupied sites detected as such) per atom site, Filling ratio

Return type:

list[float], [list[float], list[float]], list[float], list[float], list[float], float

reconstruct(image)

neutral_atom_image_analysis.neutral_atom_image_analysis_cpp module

neutral_atom_image_analysis.version module

Module contents