diff --git a/SConstruct b/SCons/SConstruct similarity index 100% rename from SConstruct rename to SCons/SConstruct diff --git a/src/pyramex/SConstruct b/SCons/SConstructCython similarity index 100% rename from src/pyramex/SConstruct rename to SCons/SConstructCython diff --git a/src/pyramex/SConstructBACKUP b/SCons/SConstructCythonBACKUP similarity index 100% rename from src/pyramex/SConstructBACKUP rename to SCons/SConstructCythonBACKUP diff --git a/pyramid.ico b/icon.ico similarity index 100% rename from pyramid.ico rename to icon.ico diff --git a/src/pyramid/__init__.py b/pyramid/__init__.py similarity index 100% rename from src/pyramid/__init__.py rename to pyramid/__init__.py diff --git a/src/pyramid/analytic.py b/pyramid/analytic.py similarity index 100% rename from src/pyramid/analytic.py rename to pyramid/analytic.py diff --git a/src/pyramex/c1.pyx b/pyramid/cython/c1.pyx similarity index 100% rename from src/pyramex/c1.pyx rename to pyramid/cython/c1.pyx diff --git a/src/pyramex/c2.pyx b/pyramid/cython/c2.pyx similarity index 100% rename from src/pyramex/c2.pyx rename to pyramid/cython/c2.pyx diff --git a/src/pyramex/c3.pyx b/pyramid/cython/c3.pyx similarity index 100% rename from src/pyramex/c3.pyx rename to pyramid/cython/c3.pyx diff --git a/src/pyramex/hello.pyx b/pyramid/cython/hello.pyx similarity index 100% rename from src/pyramex/hello.pyx rename to pyramid/cython/hello.pyx diff --git a/src/pyramex/initpyximport.py b/pyramid/cython/initpyximport.py similarity index 100% rename from src/pyramex/initpyximport.py rename to pyramid/cython/initpyximport.py diff --git a/src/pyramex/setup.py b/pyramid/cython/setup.py similarity index 100% rename from src/pyramex/setup.py rename to pyramid/cython/setup.py diff --git a/src/pyramid/dataloader.py b/pyramid/dataloader.py similarity index 100% rename from src/pyramid/dataloader.py rename to pyramid/dataloader.py diff --git a/src/pyramid/holoimage.py b/pyramid/holoimage.py similarity index 100% rename from src/pyramid/holoimage.py rename to pyramid/holoimage.py diff --git a/src/pyramid/magcreator.py b/pyramid/magcreator.py similarity index 100% rename from src/pyramid/magcreator.py rename to pyramid/magcreator.py diff --git a/src/pyramid/phasemap.py b/pyramid/phasemap.py similarity index 100% rename from src/pyramid/phasemap.py rename to pyramid/phasemap.py diff --git a/pyramid/test/__init__.py b/pyramid/test/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/test/run_tests.py b/pyramid/test/run_tests.py similarity index 100% rename from test/run_tests.py rename to pyramid/test/run_tests.py diff --git a/test/test_analytic.py b/pyramid/test/test_analytic.py similarity index 100% rename from test/test_analytic.py rename to pyramid/test/test_analytic.py diff --git a/test/test_compliance.py b/pyramid/test/test_compliance.py similarity index 100% rename from test/test_compliance.py rename to pyramid/test/test_compliance.py diff --git a/test/test_dataloader.py b/pyramid/test/test_dataloader.py similarity index 100% rename from test/test_dataloader.py rename to pyramid/test/test_dataloader.py diff --git a/test/test_dataloader/test_data.txt b/pyramid/test/test_dataloader/test_data.txt similarity index 100% rename from test/test_dataloader/test_data.txt rename to pyramid/test/test_dataloader/test_data.txt diff --git a/test/test_holoimage.py b/pyramid/test/test_holoimage.py similarity index 100% rename from test/test_holoimage.py rename to pyramid/test/test_holoimage.py diff --git a/test/test_magcreator.py b/pyramid/test/test_magcreator.py similarity index 100% rename from test/test_magcreator.py rename to pyramid/test/test_magcreator.py diff --git a/test/test_phasemap.py b/pyramid/test/test_phasemap.py similarity index 100% rename from test/test_phasemap.py rename to pyramid/test/test_phasemap.py diff --git a/scripts/cython_example.py b/scripts/cython_example.py deleted file mode 100644 index 6da48b0b1bb8cc47f67a39d8c66e47da8183bcce..0000000000000000000000000000000000000000 --- a/scripts/cython_example.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -""" -Created on Fri May 03 09:20:51 2013 - -@author: Jan -""" - -import cython -import numpy as np - - -n= 100 -A = np.array(range(n**2)).reshape((n,n)) - - -def naive_convolve(f, g): - # f is an image and is indexed by (v, w) - # g is a filter kernel and is indexed by (s, t), - # it needs odd dimensions - # h is the output image and is indexed by (x, y), - # it is not cropped - if g.shape[0] % 2 != 1 or g.shape[1] % 2 != 1: - raise ValueError("Only odd dimensions on filter supported") - # smid and tmid are number of pixels between the center pixel - # and the edge, ie for a 5x5 filter they will be 2. - # - # The output size is calculated by adding smid, tmid to each - # side of the dimensions of the input image. - vmax = f.shape[0] - wmax = f.shape[1] - smax = g.shape[0] - tmax = g.shape[1] - smid = smax // 2 - tmid = tmax // 2 - xmax = vmax + 2*smid - ymax = wmax + 2*tmid - # Allocate result image. - h = np.zeros([xmax, ymax], dtype=f.dtype) - # Do convolution - for x in range(xmax): - for y in range(ymax): - # Calculate pixel value for h at (x,y). Sum one component - # for each pixel (s, t) of the filter g. - s_from = max(smid - x, -smid) - s_to = min((xmax - x) - smid, smid + 1) - t_from = max(tmid - y, -tmid) - t_to = min((ymax - y) - tmid, tmid + 1) - value = 0 - for s in range(s_from, s_to): - for t in range(t_from, t_to): - v = x - smid + s - w = y - tmid + t - value += g[smid - s, tmid - t] * f[v, w] - h[x, y] = value - return h \ No newline at end of file