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
ift
NIFTy
Commits
fe8c2918
Commit
fe8c2918
authored
May 17, 2017
by
Theo Steininger
Browse files
Small corrections.
parent
2f17dc3e
Pipeline
#12556
passed with stage
in 7 minutes and 43 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty/plotting/plots/heatmaps/glmollweide.py
View file @
fe8c2918
...
...
@@ -22,6 +22,7 @@ class GLMollweide(Heatmap):
data
=
self
.
_mollview
(
data
,
nlat
,
nlon
)
super
(
GLMollweide
,
self
).
__init__
(
data
,
color_map
,
webgl
,
smoothing
)
@
staticmethod
def
_find_closest
(
A
,
target
):
# A must be sorted
idx
=
A
.
searchsorted
(
target
)
...
...
@@ -33,15 +34,14 @@ class GLMollweide(Heatmap):
def
_mollview
(
self
,
x
,
nlat
,
nlon
,
xsize
=
800
):
f
=
pylab
.
figure
(
None
,
figsize
=
(
8.5
,
5.4
))
extent
=
(
0.02
,
0.05
,
0.96
,
0.9
)
x
=
np
.
reshape
(
x
,
(
nlon
,
nlat
))
ra
=
np
.
linspace
(
-
np
.
pi
,
np
.
pi
,
xsize
)
dec
=
np
.
linspace
(
-
np
.
pi
/
2
,
np
.
pi
/
2
,
xsize
/
2
)
X
,
Y
=
np
.
meshgrid
(
ra
,
dec
)
gllat
=
pyHealpix
.
GL_thetas
(
nlat
)
-
0.5
*
np
.
pi
gllon
=
np
.
arange
(
nlon
+
1
)
*
(
2
*
np
.
pi
/
nlon
)
ilat
=
_find_closest
(
gllat
,
dec
-
0.5
*
np
.
pi
)
ilon
=
_find_closest
(
gllon
,
np
.
pi
+
ra
)
ilat
=
self
.
_find_closest
(
gllat
,
dec
-
0.5
*
np
.
pi
)
ilon
=
self
.
_find_closest
(
gllon
,
np
.
pi
+
ra
)
for
i
in
range
(
ilon
.
size
):
if
(
ilon
[
i
]
==
nlon
):
ilon
[
i
]
=
0
...
...
nifty/plotting/plots/heatmaps/hpmollweide.py
View file @
fe8c2918
...
...
@@ -24,7 +24,6 @@ class HPMollweide(Heatmap):
def
_mollview
(
self
,
x
,
xsize
=
800
):
f
=
pylab
.
figure
(
None
,
figsize
=
(
8.5
,
5.4
))
extent
=
(
0.02
,
0.05
,
0.96
,
0.9
)
nside
=
int
(
np
.
sqrt
(
x
.
size
//
12
))
base
=
pyHealpix
.
Healpix_Base
(
nside
,
"RING"
)
ra
=
np
.
linspace
(
-
np
.
pi
,
np
.
pi
,
xsize
)
...
...
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