Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
ducc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Simon Perkins
ducc
Commits
fd7a243c
Commit
fd7a243c
authored
May 07, 2020
by
Martin Reinecke
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mav_reorg' into 'master'
Mav reorg See merge request mtr/cxxbase!9
parents
76a024d9
69f3729c
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
212 additions
and
152 deletions
+212
-152
pyHealpix/pyHealpix.cc
pyHealpix/pyHealpix.cc
+5
-3
pypocketfft/pypocketfft.cc
pypocketfft/pypocketfft.cc
+1
-2
pysharp/pysharp.cc
pysharp/pysharp.cc
+1
-1
src/mr_util/bindings/pybind_utils.h
src/mr_util/bindings/pybind_utils.h
+3
-0
src/mr_util/infra/mav.h
src/mr_util/infra/mav.h
+191
-139
src/mr_util/math/es_kernel.h
src/mr_util/math/es_kernel.h
+8
-6
src/mr_util/math/fft.h
src/mr_util/math/fft.h
+2
-0
src/mr_util/sharp/sharp.h
src/mr_util/sharp/sharp.h
+1
-1
No files found.
pyHealpix/pyHealpix.cc
View file @
fd7a243c
...
...
@@ -46,6 +46,8 @@ namespace py = pybind11;
namespace
{
using
shape_t
=
fmav_info
::
shape_t
;
template
<
size_t
nd1
,
size_t
nd2
>
shape_t
repl_dim
(
const
shape_t
&
s
,
const
array
<
size_t
,
nd1
>
&
si
,
const
array
<
size_t
,
nd2
>
&
so
)
{
...
...
@@ -74,7 +76,7 @@ template<typename T1, typename T2, size_t nd1, size_t nd2, typename Func>
func
(
iin
,
iout
);
iin
.
inc
();
iout
.
inc
();
}
return
aout
;
return
move
(
aout
)
;
}
class
Pyhpbase
...
...
@@ -196,7 +198,7 @@ class Pyhpbase
oref
(
i
,
0
)
=
pixset
.
ivbegin
(
i
);
oref
(
i
,
1
)
=
pixset
.
ivend
(
i
);
}
return
res
;
return
move
(
res
)
;
}
};
...
...
@@ -238,7 +240,7 @@ py::array local_v_angle (const py::array &v1, const py::array &v2)
vec3
(
ii2
(
i
,
0
),
ii2
(
i
,
1
),
ii2
(
i
,
2
)));
ii1
.
inc
();
ii2
.
inc
();
iout
.
inc
();
}
return
angle
;
return
move
(
angle
)
;
}
const
char
*
pyHealpix_DS
=
R"""(
...
...
pypocketfft/pypocketfft.cc
View file @
fd7a243c
...
...
@@ -21,8 +21,7 @@
namespace
{
using
mr
::
shape_t
;
using
mr
::
stride_t
;
using
shape_t
=
mr
::
fmav_info
::
shape_t
;
using
mr
::
fmav
;
using
mr
::
to_fmav
;
using
mr
::
get_optional_Pyarr
;
...
...
pysharp/pysharp.cc
View file @
fd7a243c
...
...
@@ -263,7 +263,7 @@ py::array py_upsample_to_cc(const py::array &in, size_t nrings_out, bool has_np,
auto
out2
=
to_mav
<
double
,
2
>
(
out
,
true
);
MR_assert
(
out2
.
writable
(),
"x1"
);
upsample_to_cc
(
in2
,
has_np
,
has_sp
,
out2
);
return
out
;
return
move
(
out
)
;
}
}
// unnamed namespace
...
...
src/mr_util/bindings/pybind_utils.h
View file @
fd7a243c
...
...
@@ -10,6 +10,9 @@ namespace mr {
namespace
detail_pybind
{
using
shape_t
=
fmav_info
::
shape_t
;
using
stride_t
=
fmav_info
::
stride_t
;
namespace
py
=
pybind11
;
template
<
typename
T
>
bool
isPyarr
(
const
py
::
object
&
obj
)
...
...
src/mr_util/infra/mav.h
View file @
fd7a243c
This diff is collapsed.
Click to expand it.
src/mr_util/math/es_kernel.h
View file @
fd7a243c
...
...
@@ -42,14 +42,13 @@ class ES_Kernel
{
private:
double
beta
;
float
fbeta
;
int
p
;
vector
<
double
>
x
,
wgt
,
psi
;
size_t
supp
;
public:
ES_Kernel
(
size_t
supp_
,
double
ofactor
,
size_t
nthreads
)
:
beta
(
get_beta
(
supp_
,
ofactor
)
*
supp_
),
fbeta
(
float
(
beta
)),
:
beta
(
get_beta
(
supp_
,
ofactor
)
*
supp_
),
p
(
int
(
1.5
*
supp_
+
2
)),
supp
(
supp_
)
{
GL_Integrator
integ
(
2
*
p
,
nthreads
);
...
...
@@ -62,10 +61,13 @@ class ES_Kernel
ES_Kernel
(
size_t
supp_
,
size_t
nthreads
)
:
ES_Kernel
(
supp_
,
2.
,
nthreads
){}
double
operator
()(
double
v
)
const
{
return
(
v
*
v
>
1.
)
?
0.
:
exp
(
beta
*
(
std
::
sqrt
(
1.
-
v
*
v
)
-
1.
));
}
float
operator
()(
float
v
)
const
{
return
(
v
*
v
>
1.
f
)
?
0.
f
:
exp
(
fbeta
*
(
std
::
sqrt
(
1.
f
-
v
*
v
)
-
1.
f
));
}
template
<
typename
T
>
T
operator
()(
T
v
)
const
{
using
std
::
sqrt
;
auto
tmp
=
(
1
-
v
)
*
(
1
+
v
);
auto
tmp2
=
tmp
>=
0
;
return
tmp2
*
exp
(
T
(
beta
)
*
(
sqrt
(
tmp
*
tmp2
)
-
1
));
}
/* Compute correction factors for the ES gridding kernel
This implementation follows eqs. (3.8) to (3.10) of Barnett et al. 2018 */
double
corfac
(
double
v
)
const
...
...
src/mr_util/math/fft.h
View file @
fd7a243c
...
...
@@ -66,6 +66,8 @@ namespace mr {
namespace
detail_fft
{
using
shape_t
=
fmav_info
::
shape_t
;
constexpr
bool
FORWARD
=
true
,
BACKWARD
=
false
;
...
...
src/mr_util/sharp/sharp.h
View file @
fd7a243c
...
...
@@ -67,7 +67,7 @@ class sharp_geom_info
class
sharp_alm_info
{
public:
~
sharp_alm_info
()
{}
virtual
~
sharp_alm_info
()
{}
virtual
size_t
lmax
()
const
=
0
;
virtual
size_t
mmax
()
const
=
0
;
virtual
size_t
nm
()
const
=
0
;
...
...
Write
Preview
Markdown
is supported
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