Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
90ae2fa0
Commit
90ae2fa0
authored
Jun 05, 2020
by
Martin Reinecke
Browse files
switch
parent
46f2d697
Pipeline
#76162
failed with stages
in 3 minutes and 52 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ChangeLog.md
View file @
90ae2fa0
Changes since NIFTy 6
=====================
*None.*
Change in external dependencies
-------------------------------
Instead of the optional external packages
`pypocketfft`
and
`pyHealpix`
, NIFTy
now uses the DUCC package (
<https://gitlab.mpcdf.mpg.de/mtr/ducc)>
,
which is their successor.
Changes since NIFTy 5
...
...
Dockerfile
View file @
90ae2fa0
...
...
@@ -12,7 +12,7 @@ RUN apt-get update && apt-get install -y \
# Optional NIFTy dependencies
python3-mpi4py python3-matplotlib \
# more optional NIFTy dependencies
&& pip3 install git+https://gitlab.mpcdf.mpg.de/
ift/pyHealpix.git
\
&& pip3 install git+https://gitlab.mpcdf.mpg.de/
mtr/ducc.git@ducc_0_1
\
&& pip3 install git+https://gitlab.mpcdf.mpg.de/ift/nifty_gridder.git \
&& pip3 install jupyter \
&& rm -rf /var/lib/apt/lists/*
...
...
README.md
View file @
90ae2fa0
...
...
@@ -49,13 +49,12 @@ Installation
-
[
SciPy
](
https://www.scipy.org/
)
Optional dependencies:
-
[
pyHealpix
](
https://gitlab.mpcdf.mpg.de/
ift/pyHealpix
)
(
for
harmonic
transforms
involving domains on the sphere)
-
[
DUCC
](
https://gitlab.mpcdf.mpg.de/
mtr/ducc
)
for
faster FFTs, spherical
harmonic
transforms
, and non-uniform Fourier transforms
-
[
nifty_gridder
](
https://gitlab.mpcdf.mpg.de/ift/nifty_gridder
)
(
for
radio
interferometry responses)
-
[
mpi4py
](
https://mpi4py.scipy.org
)
(
for
MPI-parallel execution)
-
[
matplotlib
](
https://matplotlib.org/
)
(
for
field plotting)
-
[
pypocketfft
](
https://gitlab.mpcdf.mpg.de/mtr/pypocketfft
)
(
for
faster FFTs)
### Sources
...
...
@@ -78,9 +77,14 @@ Plotting support is added via:
sudo apt-get install python3-matplotlib
Support for spherical harmonic transforms is add
ed via:
The DUCC 0.1 package is install
ed via:
pip3 install --user git+https://gitlab.mpcdf.mpg.de/ift/pyHealpix.git
pip3 install --user git+https://gitlab.mpcdf.mpg.de/mtr/ducc.git@ducc_0_1
If this library is present, NIFTy will detect it automatically and prefer
`ducc_0_1.fft`
over SciPy's FFT. The underlying code is actually the same, but
DUCC's FFT is compiled with optimizations for the host CPU and can provide
significantly faster transforms.
Support for the radio interferometry gridder is added via:
...
...
@@ -90,15 +94,6 @@ MPI support is added via:
sudo apt-get install python3-mpi4py
Pypocketfft is added via:
pip3 install --user git+https://gitlab.mpcdf.mpg.de/mtr/pypocketfft
If this library is present, NIFTy will detect it automatically and prefer
it over SciPy's FFT. The underlying code is actually the same, but
pypocketfft is compiled with optimizations for the host CPU and can provide
significantly faster transforms.
### Running the tests
To run the tests, additional packages are required:
...
...
docs/source/installation.rst
View file @
90ae2fa0
...
...
@@ -14,9 +14,14 @@ Plotting support is added via::
sudo apt-get install python3-matplotlib
Support for spherical harmonic transforms is add
ed via::
The DUCC 0.1 package is install
ed via::
pip3 install --user git+https://gitlab.mpcdf.mpg.de/ift/pyHealpix.git
pip3 install --user git+https://gitlab.mpcdf.mpg.de/mtr/ducc.git@ducc_0_1
If this library is present, NIFTy will detect it automatically and prefer
`ducc_0_1.fft` over SciPy's FFT. The underlying code is actually the same, but
DUCC's FFT is compiled with optimizations for the host CPU and can provide
significantly faster transforms.
Support for the radio interferometry gridder is added via::
...
...
@@ -26,14 +31,6 @@ MPI support is added via::
sudo apt-get install python3-mpi4py
Pypocketfft is added via:
pip3 install --user git+https://gitlab.mpcdf.mpg.de/mtr/pypocketfft
If this library is present, NIFTy will detect it automatically and prefer
it over SciPy's FFT. The underlying code is actually the same, but
pypocketfft is compiled with optimizations for the host CPU and can provide
significantly faster transforms.
NIFTy documentation is provided by Sphinx. To build the documentation::
sudo apt-get install python3-sphinx-rtd-theme dvipng
...
...
src/domains/gl_space.py
View file @
90ae2fa0
...
...
@@ -73,7 +73,7 @@ class GLSpace(StructuredDomain):
# blown up by a factor of self.nlon
@
property
def
dvol
(
self
):
from
pyHealpix
import
GL_weights
from
ducc_0_1.misc
import
GL_weights
if
self
.
_dvol
is
None
:
self
.
_dvol
=
GL_weights
(
self
.
nlat
,
self
.
nlon
)
return
np
.
repeat
(
self
.
_dvol
,
self
.
nlon
)
...
...
src/domains/lm_space.py
View file @
90ae2fa0
...
...
@@ -117,11 +117,11 @@ class LMSpace(StructuredDomain):
e.g. only dependant on theta in radians"""
from
.gl_space
import
GLSpace
from
..operators.harmonic_operators
import
HarmonicTransformOperator
import
pyHealpix
from
ducc_0_1.misc
import
GL_thetas
# define azimuthally symmetric spaces for kernel transform
gl
=
GLSpace
(
self
.
lmax
+
1
,
1
)
lm0
=
gl
.
get_default_codomain
()
theta
=
pyHealpix
.
GL_thetas
(
gl
.
nlat
)
theta
=
GL_thetas
(
gl
.
nlat
)
# evaluate the kernel function at the required thetas
kernel_sphere
=
Field
.
from_raw
(
gl
,
func
(
theta
))
# normalize the kernel such that the integral over the sphere is 4pi
...
...
src/fft.py
View file @
90ae2fa0
...
...
@@ -29,21 +29,20 @@ def set_nthreads(nthr):
try
:
import
pypocket
fft
import
ducc_0_1.fft
as
my_
fft
def
fftn
(
a
,
axes
=
None
):
return
pypocket
fft
.
c2c
(
a
,
axes
=
axes
,
nthreads
=
max
(
_nthreads
,
0
))
return
my_
fft
.
c2c
(
a
,
axes
=
axes
,
nthreads
=
max
(
_nthreads
,
0
))
def
ifftn
(
a
,
axes
=
None
):
return
pypocket
fft
.
c2c
(
a
,
axes
=
axes
,
inorm
=
2
,
forward
=
False
,
nthreads
=
max
(
_nthreads
,
0
))
return
my_
fft
.
c2c
(
a
,
axes
=
axes
,
inorm
=
2
,
forward
=
False
,
nthreads
=
max
(
_nthreads
,
0
))
def
hartley
(
a
,
axes
=
None
):
return
pypocketfft
.
genuine_hartley
(
a
,
axes
=
axes
,
nthreads
=
max
(
_nthreads
,
0
))
return
my_fft
.
genuine_hartley
(
a
,
axes
=
axes
,
nthreads
=
max
(
_nthreads
,
0
))
except
ImportError
:
import
scipy.fft
...
...
src/operators/harmonic_operators.py
View file @
90ae2fa0
...
...
@@ -202,15 +202,15 @@ class SHTOperator(LinearOperator):
hspc
.
check_codomain
(
target
)
target
.
check_codomain
(
hspc
)
from
pyHealpix
import
sharpjob_d
from
ducc_0_1.sht
import
sharpjob_d
self
.
lmax
=
hspc
.
lmax
self
.
mmax
=
hspc
.
mmax
self
.
sjob
=
sharpjob_d
()
self
.
sjob
.
set_triangular_alm_info
(
self
.
lmax
,
self
.
mmax
)
if
isinstance
(
target
,
GLSpace
):
self
.
sjob
.
set_
G
auss_geometry
(
target
.
nlat
,
target
.
nlon
)
self
.
sjob
.
set_
g
auss_geometry
(
target
.
nlat
,
target
.
nlon
)
else
:
self
.
sjob
.
set_
H
ealpix_geometry
(
target
.
nside
)
self
.
sjob
.
set_
h
ealpix_geometry
(
target
.
nside
)
def
__reduce__
(
self
):
return
(
_unpickleSHTOperator
,
...
...
src/plot.py
View file @
90ae2fa0
...
...
@@ -423,7 +423,7 @@ def _plot2D(f, ax, **kwargs):
_limit_xy
(
**
kwargs
)
return
elif
isinstance
(
dom
,
(
HPSpace
,
GLSpace
)):
import
py
Healpix
from
ducc_0_1.healpix
import
Healpix
_Base
xsize
=
800
res
,
mask
,
theta
,
phi
=
_mollweide_helper
(
xsize
)
if
have_rgb
:
...
...
@@ -434,14 +434,15 @@ def _plot2D(f, ax, **kwargs):
ptg
=
np
.
empty
((
phi
.
size
,
2
),
dtype
=
np
.
float64
)
ptg
[:,
0
]
=
theta
ptg
[:,
1
]
=
phi
base
=
pyHealpix
.
Healpix_Base
(
int
(
np
.
sqrt
(
dom
.
size
//
12
)),
"RING"
)
base
=
Healpix_Base
(
int
(
np
.
sqrt
(
dom
.
size
//
12
)),
"RING"
)
if
have_rgb
:
res
[
mask
]
=
rgb
[
base
.
ang2pix
(
ptg
)]
else
:
res
[
mask
]
=
f
.
val
[
base
.
ang2pix
(
ptg
)]
else
:
from
ducc_0_1.misc
import
GL_thetas
ra
=
np
.
linspace
(
0
,
2
*
np
.
pi
,
dom
.
nlon
+
1
)
dec
=
pyHealpix
.
GL_thetas
(
dom
.
nlat
)
dec
=
GL_thetas
(
dom
.
nlat
)
ilat
=
_find_closest
(
dec
,
theta
)
ilon
=
_find_closest
(
ra
,
phi
)
ilon
=
np
.
where
(
ilon
==
dom
.
nlon
,
0
,
ilon
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment