def g1(x, kimax=None, kjmax=None, cross=True): i, j = np.meshgrid(ifreq, jfreq, indexing="ij") x = np.asarray(x) #add dimensions for broadcasting x = x[..., None, None] #expected signal a = NUM_PARTICLES * formf**2 * AREA_RATIO #expected variance (signal + noise) if APPLY_DUST: if cross: v = a + noise_level( (window * dust1 + window * dust2) / 2, BACKGROUND ) #expected abs FFT squared of gaussian noise with std of BACKGROUND**0.5 else: v = a + noise_level( window * dust1, BACKGROUND ) #expected abs FFT squared of gaussian noise with std of BACKGROUND**0.5 else: v = a + noise_level( window, BACKGROUND ) #expected abs FFT squared of gaussian noise with std of BACKGROUND**0.5 #expected scalling factor a = a / v a = rfft2_crop(a, kimax, kjmax) i = rfft2_crop(i, kimax, kjmax) j = rfft2_crop(j, kimax, kjmax) return a * np.exp(-D * (i**2 + j**2) * x)
def fvar(i, j): #expected signal a = NUM_PARTICLES * formf[i, j]**2 * AREA_RATIO if CROSS: v = a + noise_level( (window * video_simulator.dust1 + window * video_simulator.dust2) / 2, BACKGROUND ) #expected abs FFT squared of gaussian noise with std of BACKGROUND**0.5 else: v = a + noise_level( window * video_simulator.dust1, BACKGROUND ) #expected abs FFT squared of gaussian noise with std of BACKGROUND**0.5 #v = a + noise_level(window,BACKGROUND)#expected abs FFT squared of gaussian noise with std of BACKGROUND**0.5 return v / (ADC_SCALE_FACTOR**2)
def g1(x, i, j): #expected signal a = NUM_PARTICLES * formf[i, j]**2 * AREA_RATIO #expected variance (signal + noise) if CROSS: v = a + noise_level( (window * video_simulator.dust1 + window * video_simulator.dust2) / 2, BACKGROUND ) #expected abs FFT squared of gaussian noise with std of BACKGROUND**0.5 else: v = a + noise_level( window * video_simulator.dust1, BACKGROUND ) #expected abs FFT squared of gaussian noise with std of BACKGROUND**0.5 #v = a + noise_level(window,BACKGROUND) #expected abs FFT squared of gaussian noise with std of BACKGROUND**0.5 #expected scalling factor a = a / v return a * np.exp(-D * (i**2 + j**2) * x)
def fvar(kimax=None, kjmax=None, cross=True): #expected signal a = NUM_PARTICLES * formf**2 * AREA_RATIO if APPLY_DUST: if cross: v = a + noise_level( (window * dust1 + window * dust2) / 2, BACKGROUND ) #expected abs FFT squared of gaussian noise with std of BACKGROUND**0.5 else: v = a + noise_level( window * dust1, BACKGROUND ) #expected abs FFT squared of gaussian noise with std of BACKGROUND**0.5 else: v = a + noise_level( window, BACKGROUND ) #expected abs FFT squared of gaussian noise with std of BACKGROUND**0.5 v = v / (ADC_SCALE_FACTOR**2) return rfft2_crop(v, kimax, kjmax)
def fdelta(i, j): a = NUM_PARTICLES * formf[i, j]**2 * AREA_RATIO n = noise_level( window, BACKGROUND ) #expected abs FFT squared of gaussian noise with std of BACKGROUND**0.5 return n / (a + n)