Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

synthetic_interferogram.py

Andrew Player edited this page Aug 17, 2022 · 1 revision

module src.synthetic_interferogram

Created By: Andrew Player
File Name: synthetic_interferogram.py
Date Created: 05-01-2022
Description: Functions for synthetic interferogram generation


function make_synthetic_interferogram

make_synthetic_interferogram(size: int, *gaussians: Gaussian2D) → ndarray

Returns an array that simulates an unwrapped interferogram

Parameters:

  • size : int
    The dimensional size of the desired interferogram.
  • *gaussians : Gaussian2D
    An arbitrary number of guassians to be placed in the interferogram.

Returns:

  • interferogram : np.ndarray(shape=(size, size))
    The simulated unwrapped interferogram array.

function add_noise

add_noise(interferogram: ndarray, size: int) → ndarray

function generate_perlin

generate_perlin(size: int) → ndarray

Generate an array with perlin noise.

Parameters:

  • size : int
    The number of rows/cols.

Returns:

  • perlin_array : np.ndarray
    The array containing the generated perlin noise.

function wrap_interferogram

wrap_interferogram(
    interferogram: ndarray,
    seed: int = 0,
    noise: float = 0
) → ndarray

Wrap the inputed array to values between -pi and pi.

Parameters:

  • interferogram : np.ndarray
    The unwrapped interferogram which should be wrapped.
  • seed : int, Optional
    A seed for the random functions. For the same seed, with all other values the same as well, the interferogram generation will have the same results. If left at 0, the results will be different every time.
  • noise : float, Optional
    The maximum noise value to be added to the wrapped interferogram using a uniform distribution.

Returns:

  • wrapped_interferogram : np.ndarray(shape=interferogram.shape)
    The simulated wrapped interferogram array.

function make_random_dataset

make_random_dataset(
    size: int,
    seed: int = 0,
    min_g2d: int = 1,
    max_g2d: int = 1,
    crop_size: int = 0,
    max_noise: float = 0.0,
    min_amp: float = -300.0,
    max_amp: float = 300.0,
    min_x_mean: float = 64,
    max_x_mean: float = 448,
    min_y_mean: float = 64,
    max_y_mean: float = 448,
    min_x_stddev: float = 16,
    max_x_stddev: float = 64,
    min_y_stddev: float = 16,
    max_y_stddev: float = 64
) → Tuple[ndarray, ndarray]

Generate a simulated wrapped interferogram along with an event-mask

Parameters:

  • size : int
    The desired dimensional size of the interferogram pairs. This should match the input shape of the model.
  • seed : int, Optional
    A seed for the random functions. For the same seed, with all other values the same as well, the interferogram generation will have the same results. If left at 0, the results will be different every time.
  • min_g2d : int, Optional
    The minimum amount of gaussian peaks/events that the images should have.
  • max_g2d : int, Optional
    The maximum amount of gaussian peaks/events that the images should have.
  • crop_size : int, Optional.
    If the output shape of the model is different than the input shape, this should be set to be equal to the output shape. The unwrapped interferogram will be cropped to this.
  • max_noise : float, Optional
    The amount of gaussian additive noise to add to the wrapped interferogram.
  • min_amp : float, Optional
    The minimum value that the peak of the guassians can have.
  • max_amp : float, Optional
    The maximum value that the peak of the guassians can have.
  • min_x_mean : float, Optional
    The minimum x position of the peaks of gaussians.
  • max_x_mean : float, Optional
    The maximum x position of the peaks of a gaussians.
  • min_y_mean : float, Optional
    The minimum y position of the peaks of a gaussians.
  • max_y_mean : float, Optional
    The maximum y position of the peaks of a gaussians.
  • min_x_stddev : float, Optional
    The minimum standard deviation of gaussians in the x direction. This is how thin they can be in the x direction.
  • max_x_stddev : float, Optional
    The maximum standard deviation of guassians in the x direction. This is how wide they can be in the x direction.
  • min_y_stddev : float, Optional
    The minimum standard deviation of gaussians in the y direction. This is how thin they can be in the y direction.
  • max_y_stddev : float, Optional
    The maximum standard deviation of guassians in the y direction. This is how wide they can be in the y direction

Returns:

  • interferogram : np.ndarray(shape=(size, size))
    The array of the generated simulated wrapped interferogram.
  • masked_interferogram : np.ndarray(shape=(size, size) or (crop_size, crop_size))
    An array representing a mask over the gaussian which simulates masking an event.

This file was automatically generated via andrewplayer3's fork of lazydocs.