displayPixels: Display the pixels and grandchildren

Description Usage Arguments Examples

View source: R/DisplayHEALPix.R

Description

Display the pixels spix at resolution j by colouring in the grandchildren of spix at resolution plot.j

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
displayPixels(
  boundary.j,
  j,
  plot.j = 5,
  spix,
  boundary.col = "gray",
  boundary.lwd = 1,
  incl.labels = 1:(12 * 4^boundary.j),
  col = "blue",
  size = 3
)

Arguments

boundary.j

The resolution to display boundaries at. If this is missing then boundaries will not be plotted.

j

The resolution that spix are specified at.

plot.j

The resolution to plot grandchildren at

spix

Integer vector. The pixel indices to display. These must be in nested order.

boundary.col

The boundary colour.

boundary.lwd

The boundary line width.

incl.labels

Integer vector of pixel indices to label at resolution j.

col

The colour to make the grandchildren.

size

The size to make the grandchildren.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Example 1

## Plot base pixels 1,2,3 by colouring their grandchildren at resolution
## 5 (by default). No pixel boundaries.
displayPixels(j=0, spix=c(1,2,3))

## Plot base pixels 1,2,3 display and their boundaries (boundary.j=0)
displayPixels(0,0, spix=c(1,2,3))

## Plot base pixels 1,2,3 by colouring their grandchildren at resolution 2
displayPixels(0,0, plot.j = 2, spix=c(1,2,3))

## Example 2

demoNeighbours <- function(p,j) {
  neighbours(p, j)
  displayPixels(boundary.j = j, j = j, plot.j = 5,
                spix = neighbours(p, j),
                boundary.col = "gray",
                boundary.lwd = 1,
                incl.labels = neighbours(p, j),
                col = "blue",
                size = 3)
  rcosmo::displayPixelBoundaries(nside = 1, col = "blue", lwd = 3)
}

demoNeighbours(1,2)

rcosmo documentation built on Dec. 11, 2021, 9:29 a.m.