plotAitoffGalacticBackground | R Documentation |
Usually used to have a background and to overlay with plotAitoffGalacticOverlay
or plotAitoffGalacticOverlayBig
plots
plotAitoffGalacticBackground(
skyMapD,
valueName,
titleName,
legendName,
hpxLevel = 8
)
skyMapD |
dataframe with dataframe |
valueName |
Name of the |
titleName |
Title of the plot |
legendName |
- legend text |
hpxLevel |
Healpix level (unused,possibly used for the legend) |
ggplot with Aitoff background
## Not run:
# fetch data via SQL chunk in at Healpix level 8'
```{sql bkg_query, connection=conn, output.var="skyMapData.background", echo = TRUE, cache = TRUE}
select
coord[2]*180 / pi() alpha ,(pi()/2.0 - coord[1]) * 180.0/pi() delta
,cnt_all
from (
select converHealPixtoPositionLevel((hpx9::bit(64)>>( 2 * (9 - 8)))::bigint::int, 8::int) coord
,sum(cnt_g_gold) cnt_all
from dr3_ops_cs34_mv.skymap_base_g_bp_rp_hpx9_2 group by 1
) g;
```
# Then convert it to a
skyMapFixed.background = skyMapData.background %>%
mutate(alpha = ifelse(alpha>= 0, alpha, 360 + alpha))
skyMapGalactic.background
= data.frame(
skyMapFixed.background,
togalactic(skyMapFixed.background$alpha, skyMapFixed.background$delta)) %>%
mutate(aitoffGl = aitoffFn(gl,gb)$x, aitoffGb = aitoffFn(gl,gb)$y)
# then save it to combine with overlay plots.
bkg = plotAitoffGalacticBackground(skyMapGalactic.background,"cnt_all", "", "Counts", hpxLevel = 8)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.