Learn R Programming

rcosmo (version 1.1.6)

window.CMBDat: Get a sub window from a CMBDat object

Description

This function returns a data.frame containing the data in x restricted to the CMBWindow new.window

Usage

# S3 method for CMBDat
window(x, new.window, intersect = TRUE, ...)

Value

A CMBDataFrame containing the data in x restricted to the CMBWindow new.window

Arguments

x

a CMBDat object.

new.window

A single CMBWindow object or a list of them.

intersect

A boolean that determines the behaviour when new.window is a list containing BOTH regular type and "minus" type windows together (see details).

...

Unused arguments.

Details

Windows that are tagged with set.minus (see CMBWindow) are treated differently from other windows.

If the argument is a list of CMBWindows, then interious of all windows whose winType does not include "minus" are united (let \(A\) be their union) and exteriors of all windows whose winType does include "minus" are intersected, (let \(B\) be their intersection). Then, provided that intersect = TRUE (the default), the returned data.frame will be the points of cmbdat$data in the the intersection of \(A\) and \(B\). Otherwise, if intersect = FALSE, the returned data.frame consists of the points of x$data in the union of \(A\) and \(B\).

Note that if \(A\) (resp. \(B\)) is empty then the returned data.frame will be the points of x in \(B\) (resp. \(A\)).

Examples

Run this code
filename <- system.file("extdata", "CMB_testmap.fits", package = "rcosmo")
cmbdat <- CMBDat(filename)
win <- CMBWindow(x = 0, y = 0, z = 1, r = pi/2)
cmbdat.win <- window(cmbdat, new.window = win)
class(cmbdat.win)

Run the code above in your browser using DataLab