Commit f80d8dfe authored by Maude Le Jeune's avatar Maude Le Jeune
Browse files

first seg of demo pipe

parent 547a9264
......@@ -6,8 +6,8 @@ import os.path as op
import logging
import sys
S = """
first->second->fourth
third->fourth
getimg->fftimg->filter->ifftimg;
mkgauss->filter;
"""
#T.connect('second', ['third', 'fourth'], 'fourth')
#T.compute_hash()
......
""" Make a Gaussian Fourier filter
The Gaussian shape is set by the fwhm parameter (full width half height).
The amplitude is set to unity by default.
"""
lst_par = ["fwhm" , "nx", "ny", "a"]
lst_tag = ["fwhm"]
## Image dimension
nx = 256
ny = 256
## Gaussian full width half height
fwhm = 50
## make a gaussian pattern
im = zeros((nx,ny))
center_x = nx/2
center_y = ny/2
a = 1
fact = - log(2) / (0.25 * fwhm * fwhm)
for i in range(nx):
for j in range(ny):
dist = ((i-center_x)**2) + ((j-center_y)**2)
im[i,j] = a*exp(dist*fact)
## plot it
imshow(im)
savefig(get_data_fn("gaussian_pattern.png"))
## compute its fft
im_fft = fft2(im)
## save it to disk
save_products(get_data_fn("fft.dat"), globals(), ["im_fft"])
seg_output = [fwhm]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment