line_shift

NoiseGenerator.line_shift(data_map, ave_pixels, axis, shift_positive=True)

Adds latching-like effects to data_map.

Note, if excited data is available, latching_noise() is better to use instead.

This is done by shifting each line in data_map by a random number of pixels along the direction of the line.

Specifically, each line is shifted by x-1 pixels, where x is drawn from a geometric distribution with mean ave_pixels + 1.

Parameters:
  • data_map (ndarray[float]) – The data to shift. Must be at least 2d.

  • ave_pixels (float) – The average number of pixels by which to shift each line. Specifically, each line is shifted by x-1 pixels, where x is drawn from a geometric distribution with mean ave_pixels + 1.

  • axis (int) – Which axis to shift lines along. Each line running parallel to axis will be shifted by some amount in the direction parallel to axis.

  • shift_positive (bool) – Whether to shift in the positive or negative direction. If True, each line will be shifted towards positive infinity.

Returns:

data_map with each line randomly shifted by some amount.

Return type:

ndarray[float]