coords.CMBWindow: Coordinate system from a 'CMBWindow'

Description Usage Arguments Details Value Examples

View source: R/CMBWindowGenerics.R

Description

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

Usage

1
2
## S3 method for class '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.

Details

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

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## 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)

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