Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Simon Perkins
ducc
Commits
24cef791
Commit
24cef791
authored
Jun 03, 2020
by
Martin Reinecke
Browse files
more renaming
parent
3439205f
Changes
8
Hide whitespace changes
Inline
Side-by-side
pyHealpix/pyHealpix.cc
View file @
24cef791
...
...
@@ -348,7 +348,7 @@ The employed algorithm is highly accurate, even for angles close to 0 or pi.
void
add_pyHealpix
(
py
::
module
&
msup
)
{
using
namespace
pybind11
::
literals
;
auto
m
=
msup
.
def_submodule
(
"
pyH
ealpix"
);
auto
m
=
msup
.
def_submodule
(
"
h
ealpix"
);
m
.
doc
()
=
pyHealpix_DS
;
py
::
class_
<
Pyhpbase
>
(
m
,
"Healpix_Base"
,
py
::
module_local
())
...
...
pyHealpix/pyHealpix_perftest.py
View file @
24cef791
import
time
import
math
import
numpy
as
np
import
ducc_0_1.
pyH
ealpix
as
ph
import
ducc_0_1.
h
ealpix
as
ph
def
report
(
name
,
vlen
,
ntry
,
nside
,
isnest
,
perf
):
print
(
name
,
": "
,
perf
*
1e-6
,
"MOps/s"
,
sep
=
""
)
...
...
pyHealpix/pyHealpix_test.py
View file @
24cef791
import
ducc_0_1.
pyH
ealpix
as
ph
import
ducc_0_1.
h
ealpix
as
ph
import
numpy
as
np
import
math
...
...
pyHealpix/test/test_pyHealpix.py
View file @
24cef791
import
ducc_0_1.
pyH
ealpix
as
ph
import
ducc_0_1.
h
ealpix
as
ph
import
numpy
as
np
import
math
import
pytest
...
...
pysharp/demo.py
View file @
24cef791
...
...
@@ -4,7 +4,7 @@
# and Fejer quadrature rules are very similar (see the documentation in
# sharp_geomhelpers.h). An exact analogon to DH can be added easily, I expect.
import
pysharp
import
ducc_0_1.sht
as
sht
import
numpy
as
np
from
time
import
time
...
...
@@ -21,7 +21,7 @@ mmax = lmax
nlon
=
4096
# create an object which will do the SHT work
job
=
pysharp
.
sharpjob_d
()
job
=
sht
.
sharpjob_d
()
# create a set of spherical harmonic coefficients to transform
# Libsharp works exclusively on real-valued maps. The corresponding harmonic
...
...
pysharp/pysharp.cc
View file @
24cef791
...
...
@@ -271,7 +271,7 @@ py::array py_upsample_to_cc(const py::array &in, size_t nrings_out, bool has_np,
void
add_pysharp
(
py
::
module
&
msup
)
{
using
namespace
pybind11
::
literals
;
auto
m
=
msup
.
def_submodule
(
"
pysharp
"
);
auto
m
=
msup
.
def_submodule
(
"
sht
"
);
m
.
doc
()
=
pysharp_DS
;
py
::
class_
<
py_sharpjob
<
double
>>
(
m
,
"sharpjob_d"
,
py
::
module_local
())
...
...
pysharp/test/test_pysharp.py
View file @
24cef791
import
ducc_0_1.
pysharp
as
pysharp
import
ducc_0_1.
sht
as
sht
import
numpy
as
np
import
math
import
pytest
...
...
@@ -11,7 +11,7 @@ pmp = pytest.mark.parametrize
(
511
,
0
,
512
,
1
)])
def
test_GL
(
params
):
lmax
,
mmax
,
nlat
,
nlon
=
params
job
=
pysharp
.
sharpjob_d
()
job
=
sht
.
sharpjob_d
()
nalm
=
((
mmax
+
1
)
*
(
mmax
+
2
))
//
2
+
(
mmax
+
1
)
*
(
lmax
-
mmax
)
nalm_r
=
nalm
*
2
-
lmax
-
1
rng
=
np
.
random
.
default_rng
(
np
.
random
.
SeedSequence
(
42
))
...
...
@@ -30,7 +30,7 @@ def test_GL(params):
(
511
,
0
,
1024
,
1
)])
def
test_fejer1
(
params
):
lmax
,
mmax
,
nlat
,
nlon
=
params
job
=
pysharp
.
sharpjob_d
()
job
=
sht
.
sharpjob_d
()
nalm
=
((
mmax
+
1
)
*
(
mmax
+
2
))
//
2
+
(
mmax
+
1
)
*
(
lmax
-
mmax
)
nalm_r
=
nalm
*
2
-
lmax
-
1
rng
=
np
.
random
.
default_rng
(
np
.
random
.
SeedSequence
(
42
))
...
...
@@ -49,7 +49,7 @@ def test_fejer1(params):
(
511
,
0
,
1024
,
1
)])
def
test_dh
(
params
):
lmax
,
mmax
,
nlat
,
nlon
=
params
job
=
pysharp
.
sharpjob_d
()
job
=
sht
.
sharpjob_d
()
nalm
=
((
mmax
+
1
)
*
(
mmax
+
2
))
//
2
+
(
mmax
+
1
)
*
(
lmax
-
mmax
)
nalm_r
=
nalm
*
2
-
lmax
-
1
rng
=
np
.
random
.
default_rng
(
np
.
random
.
SeedSequence
(
42
))
...
...
pysharp/upsample_demo.py
View file @
24cef791
import
pysharp
import
ducc_0_1.sht
as
sht
import
numpy
as
np
from
time
import
time
...
...
@@ -17,7 +17,7 @@ alm = np.random.uniform(-1., 1., nalm) + 1j*np.random.uniform(-1., 1., nalm)
# make a_lm with m==0 real-valued
alm
[
0
:
lmax
+
1
].
imag
=
0.
job
=
pysharp
.
sharpjob_d
()
job
=
sht
.
sharpjob_d
()
# describe the a_lm array to the job
job
.
set_triangular_alm_info
(
lmax
,
mmax
)
...
...
@@ -33,7 +33,7 @@ map = job.alm2map(alm)
print
(
"time for map synthesis: {}s"
.
format
(
time
()
-
t0
))
nlat2
=
2
*
lmax
+
3
t0
=
time
()
map2
=
pysharp
.
upsample_to_cc
(
map
.
reshape
((
nlat
,
nlon
)),
nlat2
,
False
,
False
)
map2
=
sht
.
upsample_to_cc
(
map
.
reshape
((
nlat
,
nlon
)),
nlat2
,
False
,
False
)
print
(
"time for upsampling: {}s"
.
format
(
time
()
-
t0
))
job
.
set_cc_geometry
(
nlat2
,
nlon
)
t0
=
time
()
...
...
@@ -55,7 +55,7 @@ map = job.alm2map(alm)
print
(
"time for map synthesis: {}s"
.
format
(
time
()
-
t0
))
nlat2
=
2
*
lmax
+
3
t0
=
time
()
map2
=
pysharp
.
upsample_to_cc
(
map
.
reshape
((
nlat
,
nlon
)),
nlat2
,
True
,
True
)
map2
=
sht
.
upsample_to_cc
(
map
.
reshape
((
nlat
,
nlon
)),
nlat2
,
True
,
True
)
print
(
"time for upsampling: {}s"
.
format
(
time
()
-
t0
))
job
.
set_cc_geometry
(
nlat2
,
nlon
)
t0
=
time
()
...
...
@@ -78,7 +78,7 @@ map = job.alm2map(alm)
print
(
"time for map synthesis: {}s"
.
format
(
time
()
-
t0
))
nlat2
=
2
*
lmax
+
3
t0
=
time
()
map2
=
pysharp
.
upsample_to_cc
(
map
.
reshape
((
nlat
,
nlon
)),
nlat2
,
False
,
True
)
map2
=
sht
.
upsample_to_cc
(
map
.
reshape
((
nlat
,
nlon
)),
nlat2
,
False
,
True
)
print
(
"time for upsampling: {}s"
.
format
(
time
()
-
t0
))
job
.
set_cc_geometry
(
nlat2
,
nlon
)
t0
=
time
()
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment