Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Simon Perkins
ducc
Commits
31dfac48
Commit
31dfac48
authored
Feb 16, 2020
by
Martin Reinecke
Browse files
cleanup
parent
7995614c
Changes
5
Hide whitespace changes
Inline
Side-by-side
libsharp2/sharp_geomhelpers.cc
View file @
31dfac48
...
...
@@ -29,6 +29,7 @@
#include <vector>
#include "libsharp2/sharp_geomhelpers.h"
#include "mr_util/gl_integrator.h"
#include "mr_util/constants.h"
#include "mr_util/fft1d.h"
#include "mr_util/error_handling.h"
#include "mr_util/math_utils.h"
...
...
@@ -140,7 +141,6 @@ void sharp_standard_geom_info::get_ring(bool weighted, size_t iring, const any &
unique_ptr
<
sharp_geom_info
>
sharp_make_subset_healpix_geom_info
(
size_t
nside
,
ptrdiff_t
stride
,
size_t
nrings
,
const
size_t
*
rings
,
const
double
*
weight
)
{
const
double
pi
=
3.141592653589793238462643383279502884197
;
size_t
npix
=
nside
*
nside
*
12
;
size_t
ncap
=
2
*
nside
*
(
nside
-
1
);
...
...
@@ -198,8 +198,6 @@ unique_ptr<sharp_geom_info> sharp_make_weighted_healpix_geom_info (size_t nside,
unique_ptr
<
sharp_geom_info
>
sharp_make_gauss_geom_info
(
size_t
nrings
,
size_t
nphi
,
double
phi0
,
ptrdiff_t
stride_lon
,
ptrdiff_t
stride_lat
)
{
const
double
pi
=
3.141592653589793238462643383279502884197
;
vector
<
size_t
>
nph
(
nrings
,
nphi
);
vector
<
double
>
phi0_
(
nrings
,
phi0
);
vector
<
ptrdiff_t
>
ofs
(
nrings
);
...
...
@@ -221,8 +219,6 @@ unique_ptr<sharp_geom_info> sharp_make_gauss_geom_info (size_t nrings, size_t np
unique_ptr
<
sharp_geom_info
>
sharp_make_fejer1_geom_info
(
size_t
nrings
,
size_t
ppring
,
double
phi0
,
ptrdiff_t
stride_lon
,
ptrdiff_t
stride_lat
)
{
const
double
pi
=
3.141592653589793238462643383279502884197
;
vector
<
double
>
theta
(
nrings
),
weight
(
nrings
),
phi0_
(
nrings
,
phi0
);
vector
<
size_t
>
nph
(
nrings
,
ppring
);
vector
<
ptrdiff_t
>
ofs
(
nrings
);
...
...
@@ -255,8 +251,6 @@ unique_ptr<sharp_geom_info> sharp_make_fejer1_geom_info (size_t nrings, size_t p
unique_ptr
<
sharp_geom_info
>
sharp_make_cc_geom_info
(
size_t
nrings
,
size_t
ppring
,
double
phi0
,
ptrdiff_t
stride_lon
,
ptrdiff_t
stride_lat
)
{
const
double
pi
=
3.141592653589793238462643383279502884197
;
vector
<
double
>
theta
(
nrings
),
weight
(
nrings
,
0.
),
phi0_
(
nrings
,
phi0
);
vector
<
size_t
>
nph
(
nrings
,
ppring
);
vector
<
ptrdiff_t
>
ofs
(
nrings
);
...
...
@@ -305,8 +299,6 @@ static vector<double> get_dh_weights(size_t nrings)
unique_ptr
<
sharp_geom_info
>
sharp_make_fejer2_geom_info
(
size_t
nrings
,
size_t
ppring
,
double
phi0
,
ptrdiff_t
stride_lon
,
ptrdiff_t
stride_lat
)
{
const
double
pi
=
3.141592653589793238462643383279502884197
;
vector
<
double
>
theta
(
nrings
),
weight
(
get_dh_weights
(
nrings
+
1
)),
phi0_
(
nrings
,
phi0
);
vector
<
size_t
>
nph
(
nrings
,
ppring
);
vector
<
ptrdiff_t
>
ofs
(
nrings
);
...
...
@@ -329,8 +321,6 @@ unique_ptr<sharp_geom_info> sharp_make_fejer2_geom_info (size_t nrings, size_t p
unique_ptr
<
sharp_geom_info
>
sharp_make_dh_geom_info
(
size_t
nrings
,
size_t
ppring
,
double
phi0
,
ptrdiff_t
stride_lon
,
ptrdiff_t
stride_lat
)
{
const
double
pi
=
3.141592653589793238462643383279502884197
;
vector
<
double
>
theta
(
nrings
),
weight
(
get_dh_weights
(
nrings
)),
phi0_
(
nrings
,
phi0
);
vector
<
size_t
>
nph
(
nrings
,
ppring
);
vector
<
ptrdiff_t
>
ofs
(
nrings
);
...
...
@@ -348,8 +338,6 @@ unique_ptr<sharp_geom_info> sharp_make_dh_geom_info (size_t nrings, size_t pprin
unique_ptr
<
sharp_geom_info
>
sharp_make_mw_geom_info
(
size_t
nrings
,
size_t
ppring
,
double
phi0
,
ptrdiff_t
stride_lon
,
ptrdiff_t
stride_lat
)
{
const
double
pi
=
3.141592653589793238462643383279502884197
;
vector
<
double
>
theta
(
nrings
),
phi0_
(
nrings
,
phi0
);
vector
<
size_t
>
nph
(
nrings
,
ppring
);
vector
<
ptrdiff_t
>
ofs
(
nrings
);
...
...
libsharp2/sharp_geomhelpers.h
View file @
31dfac48
...
...
@@ -133,9 +133,7 @@ std::unique_ptr<sharp_geom_info> sharp_make_fejer1_geom_info (size_t nrings, siz
\ingroup geominfogroup */
static
inline
std
::
unique_ptr
<
sharp_geom_info
>
sharp_make_ecp_geom_info
(
size_t
nrings
,
size_t
nphi
,
double
phi0
,
ptrdiff_t
stride_lon
,
ptrdiff_t
stride_lat
)
{
return
sharp_make_fejer1_geom_info
(
nrings
,
nphi
,
phi0
,
stride_lon
,
stride_lat
);
}
{
return
sharp_make_fejer1_geom_info
(
nrings
,
nphi
,
phi0
,
stride_lon
,
stride_lat
);
}
/*! Creates a geometry information describing an ECP map with \a nrings
iso-latitude rings and \a nphi pixels per ring. The azimuth of the first
...
...
libsharp2/sharp_ylmgen.cc
View file @
31dfac48
...
...
@@ -30,8 +30,10 @@
#include <algorithm>
#include "libsharp2/sharp_internal.h"
#include "mr_util/error_handling.h"
#include "mr_util/constants.h"
using
namespace
std
;
using
namespace
mr
;
#pragma GCC visibility push(hidden)
...
...
@@ -44,8 +46,6 @@ static inline void normalize (double &val, int &scale, double xfmax)
sharp_Ylmgen
::
sharp_Ylmgen
(
size_t
l_max
,
size_t
m_max
,
size_t
spin
)
{
constexpr
double
inv_sqrt4pi
=
0.2820947917738781434740397257803862929220
;
lmax
=
l_max
;
mmax
=
m_max
;
MR_assert
(
l_max
>=
spin
,
"incorrect l_max: must be >= spin"
);
...
...
@@ -61,7 +61,6 @@ sharp_Ylmgen::sharp_Ylmgen (size_t l_max, size_t m_max, size_t spin)
cf
[
size_t
(
sc
)]
=
cf
[
size_t
(
sc
-
1
)]
*
sharp_fbig
;
powlimit
.
resize
(
m_max
+
spin
+
1
);
powlimit
[
0
]
=
0.
;
constexpr
double
ln2
=
0.6931471805599453094172321214581766
;
constexpr
double
expo
=-
400
*
ln2
;
for
(
size_t
i
=
1
;
i
<=
m_max
+
spin
;
++
i
)
powlimit
[
i
]
=
exp
(
expo
/
i
);
...
...
@@ -195,7 +194,6 @@ void sharp_Ylmgen::prepare (size_t m_)
vector
<
double
>
sharp_Ylmgen
::
get_norm
(
size_t
lmax
,
size_t
spin
)
{
const
double
pi
=
3.141592653589793238462643383279502884197
;
/* sign convention for H=1 (LensPix paper) */
#if 1
double
spinsign
=
(
spin
>
0
)
?
-
1.0
:
1.0
;
...
...
@@ -215,7 +213,6 @@ vector<double> sharp_Ylmgen::get_norm (size_t lmax, size_t spin)
vector
<
double
>
sharp_Ylmgen
::
get_d1norm
(
size_t
lmax
)
{
const
double
pi
=
3.141592653589793238462643383279502884197
;
vector
<
double
>
res
(
lmax
+
1
);
for
(
size_t
l
=
0
;
l
<=
lmax
;
++
l
)
...
...
mr_util/gl_integrator.h
View file @
31dfac48
...
...
@@ -16,13 +16,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* Copyright (C) 2019 Max-Planck-Society
/* Copyright (C) 2019
-2020
Max-Planck-Society
Author: Martin Reinecke */
#ifndef MRUTIL_GL_INTEGRATOR_H
#define MRUTIL_GL_INTEGRATOR_H
#include <cmath>
#include "mr_util/constants.h"
#include "mr_util/error_handling.h"
#include "mr_util/threading.h"
...
...
@@ -46,7 +47,6 @@ class GL_Integrator
:
n_
(
n
)
{
MR_assert
(
n
>=
1
,
"number of points must be at least 1"
);
constexpr
double
pi
=
3.141592653589793238462643383279502884197
;
constexpr
double
eps
=
3e-14
;
size_t
m
=
(
n
+
1
)
>>
1
;
x
.
resize
(
m
);
...
...
test/sharp2_testsuite.cc
View file @
31dfac48
...
...
@@ -35,6 +35,7 @@
#include "mr_util/math_utils.h"
#include "mr_util/string_utils.h"
#include "mr_util/gl_integrator.h"
#include "mr_util/constants.h"
using
namespace
std
;
using
namespace
mr
;
...
...
@@ -264,7 +265,6 @@ static void get_infos (const string &gname, int lmax, int &mmax, int &gpar1,
if
(
nlon
<
1
)
nlon
=
2
*
mmax
+
1
;
size_t
npix_o
=
nlat
*
nlon
;
gpar1
=
nlat
;
gpar2
=
nlon
;
const
double
pi
=
3.141592653589793238462643383279502884197
;
vector
<
size_t
>
nph
(
nlat
);
vector
<
double
>
phi0_
(
nlat
);
...
...
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