coords.CMBWindow: Coordinate system from a 'CMBWindow'

View source: R/CMBWindowGenerics.R

coords.CMBWindowR Documentation

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 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

## 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)


frycast/rcosmo documentation built on Oct. 11, 2022, 5:21 p.m.