Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
astro
astrotools
Commits
d331ea22
Commit
d331ea22
authored
Jan 09, 2020
by
teresa.bister
Committed by
Teresa Bister
Jan 09, 2020
Browse files
[skymap] enable cb labels and [simulations] arrivals map now has true source id in cb
parent
5244de5e
Pipeline
#225888
passed with stages
in 6 minutes and 22 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
astrotools/simulations.py
View file @
d331ea22
...
...
@@ -813,7 +813,8 @@ class SourceBound(BaseSimulation):
cmap
.
set_under
(
'gray'
)
if
len
(
src_idx
)
>
0
:
skymap
.
eventmap
(
self
.
crs
[
'vecs'
][:,
idx
],
c
=
labels_p
,
cmap
=
cmap
,
cblabel
=
'Source ID'
,
cticks
=
np
.
arange
(
-
1
,
len
(
src_idx
),
1
),
vmin
=-
0.5
,
vmax
=
len
(
src_idx
)
-
0.5
)
cticks
=
np
.
arange
(
0
,
len
(
src_idx
)
+
1
,
1
),
clabels
=
np
.
sort
(
src_idx
),
vmin
=-
0.5
,
vmax
=
len
(
src_idx
)
-
0.5
)
else
:
skymap
.
eventmap
(
self
.
crs
[
'vecs'
][:,
idx
],
c
=
'gray'
)
lon_src
,
lat_src
=
coord
.
vec2ang
(
self
.
universe
.
sources
[:,
idx
])
...
...
astrotools/skymap.py
View file @
d331ea22
...
...
@@ -47,6 +47,7 @@ def scatter(v, c=None, cblabel='log$_{10}$(Energy / eV)', opath=None, **kwargs):
vmax
=
kwargs
.
pop
(
'vmax'
,
smart_round
(
np
.
max
(
c
[
finite
]),
upper_border
=
True
))
step
=
smart_round
((
vmax
-
vmin
)
/
5.
,
order
=
1
)
cticks
=
kwargs
.
pop
(
'cticks'
,
np
.
arange
(
vmin
,
vmax
,
step
))
clabels
=
kwargs
.
pop
(
'clabels'
,
cticks
)
# read keyword arguments for the grid
dark_grid
=
kwargs
.
pop
(
'dark_grid'
,
True
)
...
...
@@ -75,6 +76,7 @@ def scatter(v, c=None, cblabel='log$_{10}$(Energy / eV)', opath=None, **kwargs):
cbar
.
set_label
(
cblabel
,
fontsize
=
fontsize
)
events
.
set_clim
(
vmin
,
vmax
)
cbar
.
ax
.
tick_params
(
labelsize
=
fontsize
-
4
)
cbar
.
set_ticklabels
(
clabels
)
cbar
.
draw_all
()
# Setup the grid
...
...
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