|
2 | 2 | from . import conversion |
3 | 3 | from . import transformation |
4 | 4 | from . import dimension |
| 5 | +from . import fft |
5 | 6 |
|
6 | 7 | def get_method(name): |
7 | 8 | """Return a callable function for the utility method corresponding to the |
8 | | - given name.\n\ |
| 9 | + given name. For the FFT methods, the return value is a two-element tuple |
| 10 | + containing the function and a dictionary of keyword arguments.\n\ |
9 | 11 |
|
10 | 12 | Conversion methods: |
11 | 13 |
|
@@ -50,6 +52,18 @@ def get_method(name): |
50 | 52 | | upscale | upscale the field | |
51 | 53 | +-------------------+--------------------------------------------------------+ |
52 | 54 |
|
| 55 | + FFT methods (wrappers to different implementations): |
| 56 | +
|
| 57 | + +-------------------+--------------------------------------------------------+ |
| 58 | + | Name | Description | |
| 59 | + +===================+========================================================+ |
| 60 | + | numpy_fft | numpy.fft | |
| 61 | + +-------------------+--------------------------------------------------------+ |
| 62 | + | scipy_fft | scipy.fftpack | |
| 63 | + +-------------------+--------------------------------------------------------+ |
| 64 | + | pyfftw_fft | pyfftw.interfaces.numpy_fft | |
| 65 | + +-------------------+--------------------------------------------------------+ |
| 66 | +
|
53 | 67 | """ |
54 | 68 |
|
55 | 69 | if name is None: |
@@ -82,6 +96,10 @@ def donothing(R, metadata, *args, **kwargs): |
82 | 96 | methods_objects["clip"] = dimension.clip_domain |
83 | 97 | methods_objects["square"] = dimension.square_domain |
84 | 98 | methods_objects["upscale"] = dimension.aggregate_fields_space |
| 99 | + # FFT methods |
| 100 | + methods_objects["numpy_fft"] = fft.get_method("numpy") |
| 101 | + methods_objects["scipy_fft"] = fft.get_method("scipy") |
| 102 | + methods_objects["pyfftw_fft"] = fft.get_method("pyfftw") |
85 | 103 |
|
86 | 104 | try: |
87 | 105 | return methods_objects[name] |
|
0 commit comments