Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NIFTy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ift
NIFTy
Commits
c63f8f58
Commit
c63f8f58
authored
10 years ago
by
ultimanet
Browse files
Options
Downloads
Patches
Plain Diff
implemented fft factory
parent
b590b3e7
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!3
Nifty 2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
__init__.py
+1
-0
1 addition, 0 deletions
__init__.py
rg/nifty_rg.py
+17
-7
17 additions, 7 deletions
rg/nifty_rg.py
with
18 additions
and
7 deletions
__init__.py
+
1
−
0
View file @
c63f8f58
...
@@ -36,6 +36,7 @@ except(ImportError):
...
@@ -36,6 +36,7 @@ except(ImportError):
try
:
try
:
from
lm
import
*
from
lm
import
*
except
(
ImportError
):
except
(
ImportError
):
print
'
asdf
'
pass
pass
from
demos
import
*
from
demos
import
*
...
...
This diff is collapsed.
Click to expand it.
rg/nifty_rg.py
+
17
−
7
View file @
c63f8f58
...
@@ -44,11 +44,15 @@ from nifty.nifty_core import about, \
...
@@ -44,11 +44,15 @@ from nifty.nifty_core import about, \
field
field
import
nifty.smoothing
as
gs
import
nifty.smoothing
as
gs
import
powerspectrum
as
gp
import
powerspectrum
as
gp
'''
try:
try:
import gfft as gf
import gfft as gf
except(ImportError):
except(ImportError):
about.infos.cprint(
'
INFO:
"
plain
"
gfft version 0.1.0
'
)
about.infos.cprint(
'
INFO:
"
plain
"
gfft version 0.1.0
'
)
import gfft_rg as gf
import gfft_rg as gf
'''
import
fft_rg
##-----------------------------------------------------------------------------
##-----------------------------------------------------------------------------
...
@@ -198,6 +202,8 @@ class rg_space(space):
...
@@ -198,6 +202,8 @@ class rg_space(space):
self
.
vol
=
np
.
real
(
dist
)[::
-
1
]
self
.
vol
=
np
.
real
(
dist
)[::
-
1
]
self
.
fourier
=
bool
(
fourier
)
self
.
fourier
=
bool
(
fourier
)
self
.
my_fft_object
=
fft_rg
.
fft_factory
()
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
...
@@ -808,22 +814,26 @@ class rg_space(space):
...
@@ -808,22 +814,26 @@ class rg_space(space):
naxes
=
(
np
.
size
(
self
.
para
)
-
1
)
//
2
naxes
=
(
np
.
size
(
self
.
para
)
-
1
)
//
2
## select machine
## select machine
if
(
np
.
all
(
np
.
absolute
(
self
.
para
[:
naxes
]
*
self
.
vol
*
codomain
.
vol
-
1
)
<
self
.
epsilon
)):
if
(
np
.
all
(
np
.
absolute
(
self
.
para
[:
naxes
]
*
self
.
vol
*
codomain
.
vol
-
1
)
<
self
.
epsilon
)):
## Use the codomain information only for the rescaling. The direction
## of transformation is infered from the fourier attribute of the
## supplied space
if
(
codomain
.
fourier
):
if
(
codomain
.
fourier
):
ftmachine
=
"
fft
"
#
ftmachine = "fft"
## correct for 'fft'
## correct for 'fft'
x
=
self
.
calc_weight
(
x
,
power
=
1
)
x
=
self
.
calc_weight
(
x
,
power
=
1
)
else
:
else
:
ftmachine
=
"
ifft
"
#
ftmachine = "ifft"
## correct for 'ifft'
## correct for 'ifft'
x
=
self
.
calc_weight
(
x
,
power
=
1
)
x
=
self
.
calc_weight
(
x
,
power
=
1
)
x
*=
self
.
dim
(
split
=
False
)
x
*=
self
.
dim
(
split
=
False
)
else
:
else
:
ftmachine
=
"
none
"
## TODO: Is this error correct?
raise
ValueError
(
about
.
_errors
.
cstring
(
"
ERROR: unsupported transformation.
"
))
#ftmachine = "none"
## transform
## transform
if
(
self
.
datatype
==
np
.
float64
):
Tx
=
self
.
my_fft_object
(
x
,
self
,
codomain
)
Tx
=
gf
.
gfft
(
x
.
astype
(
np
.
complex128
),
in_ax
=
[],
out_ax
=
[],
ftmachine
=
ftmachine
,
in_zero_center
=
self
.
para
[
-
naxes
:].
astype
(
np
.
bool
).
tolist
(),
out_zero_center
=
codomain
.
para
[
-
naxes
:].
astype
(
np
.
bool
).
tolist
(),
enforce_hermitian_symmetry
=
bool
(
codomain
.
para
[
naxes
]
==
1
),
W
=-
1
,
alpha
=-
1
,
verbose
=
False
)
else
:
Tx
=
gf
.
gfft
(
x
,
in_ax
=
[],
out_ax
=
[],
ftmachine
=
ftmachine
,
in_zero_center
=
self
.
para
[
-
naxes
:].
astype
(
np
.
bool
).
tolist
(),
out_zero_center
=
codomain
.
para
[
-
naxes
:].
astype
(
np
.
bool
).
tolist
(),
enforce_hermitian_symmetry
=
bool
(
codomain
.
para
[
naxes
]
==
1
),
W
=-
1
,
alpha
=-
1
,
verbose
=
False
)
## check complexity
## check complexity
if
(
not
codomain
.
para
[
naxes
]):
## purely real
if
(
not
codomain
.
para
[
naxes
]):
## purely real
## check imaginary part
## check imaginary part
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment