From a4d90aa304559c1b203e367ba42bf95399742ded Mon Sep 17 00:00:00 2001 From: Jan Caron <caron@fz-juelich.de> Date: Tue, 7 May 2013 17:11:21 +0200 Subject: [PATCH] After restructuring the project layout tree --- SConstruct => SCons/SConstruct | 0 .../SConstruct => SCons/SConstructCython | 0 .../SConstructCythonBACKUP | 0 pyramid.ico => icon.ico | Bin {src/pyramid => pyramid}/__init__.py | 0 {src/pyramid => pyramid}/analytic.py | 0 {src/pyramex => pyramid/cython}/c1.pyx | 0 {src/pyramex => pyramid/cython}/c2.pyx | 0 {src/pyramex => pyramid/cython}/c3.pyx | 0 {src/pyramex => pyramid/cython}/hello.pyx | 0 .../cython}/initpyximport.py | 0 {src/pyramex => pyramid/cython}/setup.py | 0 {src/pyramid => pyramid}/dataloader.py | 0 {src/pyramid => pyramid}/holoimage.py | 0 {src/pyramid => pyramid}/magcreator.py | 0 {src/pyramid => pyramid}/phasemap.py | 0 pyramid/test/__init__.py | 0 {test => pyramid/test}/run_tests.py | 0 {test => pyramid/test}/test_analytic.py | 0 {test => pyramid/test}/test_compliance.py | 0 {test => pyramid/test}/test_dataloader.py | 0 .../test}/test_dataloader/test_data.txt | 0 {test => pyramid/test}/test_holoimage.py | 0 {test => pyramid/test}/test_magcreator.py | 0 {test => pyramid/test}/test_phasemap.py | 0 scripts/cython_example.py | 55 ------------------ 26 files changed, 55 deletions(-) rename SConstruct => SCons/SConstruct (100%) rename src/pyramex/SConstruct => SCons/SConstructCython (100%) rename src/pyramex/SConstructBACKUP => SCons/SConstructCythonBACKUP (100%) rename pyramid.ico => icon.ico (100%) rename {src/pyramid => pyramid}/__init__.py (100%) rename {src/pyramid => pyramid}/analytic.py (100%) rename {src/pyramex => pyramid/cython}/c1.pyx (100%) rename {src/pyramex => pyramid/cython}/c2.pyx (100%) rename {src/pyramex => pyramid/cython}/c3.pyx (100%) rename {src/pyramex => pyramid/cython}/hello.pyx (100%) rename {src/pyramex => pyramid/cython}/initpyximport.py (100%) rename {src/pyramex => pyramid/cython}/setup.py (100%) rename {src/pyramid => pyramid}/dataloader.py (100%) rename {src/pyramid => pyramid}/holoimage.py (100%) rename {src/pyramid => pyramid}/magcreator.py (100%) rename {src/pyramid => pyramid}/phasemap.py (100%) create mode 100644 pyramid/test/__init__.py rename {test => pyramid/test}/run_tests.py (100%) rename {test => pyramid/test}/test_analytic.py (100%) rename {test => pyramid/test}/test_compliance.py (100%) rename {test => pyramid/test}/test_dataloader.py (100%) rename {test => pyramid/test}/test_dataloader/test_data.txt (100%) rename {test => pyramid/test}/test_holoimage.py (100%) rename {test => pyramid/test}/test_magcreator.py (100%) rename {test => pyramid/test}/test_phasemap.py (100%) delete mode 100644 scripts/cython_example.py 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 0000000..e69de29 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 6da48b0..0000000 --- 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 -- GitLab