rcosmo (version 1.1.2)

coords.CMBWindow: Coordinate system from a CMBWindow

Description

This function returns the coordinate system used in a CMBWindow. The coordinate system is either "cartesian" or "spherical"

Usage

# S3 method for CMBWindow
coords(x, new.coords, ...)

Arguments

x

a CMBWindow, win.

new.coords

specifies the new coordinate system ("spherical" or "cartesian") if a change of coordinate system is desired

...

Unused arguments.

Value

If new.coords is unspecified, then the name of the coordinate system of win is returned. Otherwise a new CMBWindow is returned equivalent to win but having the desired change of coordinates

Details

If a new coordinate system is specified, using e.g. new.coords = "spherical", the coordinate system of the CMBWindow will be converted

Examples

Run this code
# NOT RUN {
## Create win with sperical coords, then change it to win1 with cartesian coords
win <- CMBWindow(theta = c(0,pi/2,pi/2), phi = c(0,0,pi/2))
coords(win)
win1 <- coords(win, new.coords = "cartesian")
coords(win1)

## Change back to spherical coordinates

coords(win1) <- "spherical"
coords(win1)

# }

Run the code above in your browser using DataCamp Workspace