CMBWindow: CMBWindow class.

Description Usage Arguments Details Examples

View source: R/CMBWindow.R

Description

The function CMBWindow creates objects of class CMBWindow. It is either a polygon or a disc type.

Usage

1
CMBWindow(..., r, set.minus = FALSE, assume.convex = FALSE)

Arguments

...

these arguments are compulsory and must be labelled either x, y, z (cartesian) or theta, phi (spherical, colatitude and longitude respectively). Alternatively, a single data.frame may be passed in with columns labelled x, y, z or theta, phi.

r

if a disc type window is required then this specifies the radius of the disc

set.minus

when TRUE the window will be the unit sphere minus the window specified

assume.convex

when TRUE the window is assumed to be convex resulting in a faster computation time when the window is used with functions such as subWindow. This argument is irrelevant when the window is not a polygon

Details

If r is unspecified then the rows of ... correspond to counter-clockwise ordered vertices defining a spherical polygon lying entirely within one open hemisphere on the unit sphere. Counter-clockwise is understood from the perspective outside the sphere, facing the hemisphere that contains the polygon, looking toward the origin. Note that there must be at least 3 rows (vertices) to define a polygon (we exclude bygones). On the other hand, if r is specified then ... must specify just one row, and this row is taken to be the center of a disc of radius r

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
win <- CMBWindow(theta = c(pi/2,pi/2,pi/3, pi/3), phi = c(0,pi/3,pi/3,0))
plot(win)


## Create a disc type window
win1<- CMBWindow(x=0,y=3/5,z=4/5,r=0.8, set.minus =TRUE)
plot(win1)


## Apply a disc type window to CMBDataFrame
cmbdf <- CMBDataFrame(nside = 64, coords = "cartesian", ordering = "nested")
window(cmbdf) <- CMBWindow(x=0,y=3/5,z=4/5,r=0.8, set.minus =TRUE)
plot(cmbdf)

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