telegraph_noise
- NoiseGenerator.telegraph_noise(data_map, magnitude, stdev, ave_low_pixels, ave_high_pixels, axis)
Adds telegraph noise to
data_map.Specifically, adds a constant value to a line of several continuous pixels, Then adds a different constant value to the next several pixels, etc. The number of pixels before each jump is drawn from a geometric distribution with mean given by
ave_low_pixelsorave_high_pixels, and the constant value added is drawn from a normal distribution with mean +/-magnitude/2and standard deviationstdev/sqrt(2), with the sign alternating after each jump.- Parameters:
data_map (ndarray[float]) – The data to add noise to.
magnitude (float | ndarray[float]) – The average magnitude and standard deviation of the telegraph noise. Each jump will add or subtract a constant drawn from a normal distribution with mean
magnitude/2and standard deviationstdev/sqrt(2). This means that the total jump distance will have mean and standard deviation given bymagnitudeandstdev. If arrays are passed, they should have the same shape asdata_map.stdev (float | ndarray[float]) – The average magnitude and standard deviation of the telegraph noise. Each jump will add or subtract a constant drawn from a normal distribution with mean
magnitude/2and standard deviationstdev/sqrt(2). This means that the total jump distance will have mean and standard deviation given bymagnitudeandstdev. If arrays are passed, they should have the same shape asdata_map.ave_low_pixels (float) – The average number of pixels before a jump from low to high (
ave_low_pixels) or from high to low (ave_high_pixels). Must be greater than or equal to 1.ave_high_pixels (float) – The average number of pixels before a jump from low to high (
ave_low_pixels) or from high to low (ave_high_pixels). Must be greater than or equal to 1.axis (int) – Which axis the telegraph noise should be applied along.
- Returns:
data_mapwith telegraph noise added to it.- Return type:
ndarray[float]