Skip to content
Snippets Groups Projects
Select Git revision
  • da52801c29b0f240fa83b034769d107f16f92635
  • main default protected
2 results

create_hot_pixels.py

Blame
  • create_hot_pixels.py 589 B
    import numpy as np
    
    def createDefectPixels(xDim, yDim, n, max, min, value, bias):
        hp = np.ones((xDim, yDim))
        ref = np.full_like(hp, bias)
        for i in range(n):
            x = np.random.randint(0, xDim)
            y = np.random.randint(0, yDim)
            hp[x, y] = np.random.uniform(min, max)
            ref[x, y] = value
    
        return hp, ref
    
    if __name__ == "__main__":
        hotPixels, Calibration = createDefectPixels(200, 200, 37, 100, 0, 0xFFFF, 1310)
    
        np.savetxt('hotPixels_FGS1.txt', hotPixels.ravel(), fmt='%f')
        np.savetxt('Calibration_FGS1.txt', Calibration.ravel(), fmt='%i')