R: Exact angular area calculator

skyarea {celestial} | R Documentation

## Exact angular area calculator

### Description

This function takes a survey geometry defined by RA (long) and Dec (latitude) limits and calculates the exact angular area covered.

### Usage

    skyarea(long = c(129, 141), lat = c(-2, 3), inunit = "deg", outunit = "deg2", sep=":")

### Arguments

`long` | Upper and lower longitude (RA) limits of interest in units of inunit. If of length 1 then the number specified is assumed to be the upper limit and the lower limit is set to 0.
`lat` | Upper and lower latitude (Dec) limits of interest in units of inunit. If of length 1 then the number specified is assumed to be the upper limit and the lower limit is set to 0.
`inunit` | The units of angular coordinate provided. Allowed options are deg for degress, amin for arc minutes, asec for arc seconds, rad for radians and sex for sexigesimal (i.e. HMS for RA and DMS for Deg).
`outunit` | The units of angular area desired. Allowed options are deg2 for square degrees, amin2 for square arc minutes, asec2 for square arc seconds and rad2 or sr for steradians.
`sep` | When inunit='sex', sep defines the type of separator used for the HMS and DMS strings (i.e. H:M:S and D:M:S would be sep=':', which is the default). See `hms2deg` and `dms2deg` for more details.

### Value

Two value vector. First value is the sky area covered in units of outunit (named area), second value is the fraction of the celestial sphere covered by the specified geometry (named areafrac).

### Author(s)

Aaron Robotham

### See Also

`cosvol`, `hms2deg`, `dms2deg`

### Examples

    #The GAMA survey areas:
    G02area=skyarea(c(30.2,38.8),c(-10.25,-3.72))
    G09area=skyarea(c(129,141),c(-2,3))
    G12area=skyarea(c(174,186),c(-3,2))
    G15area=skyarea(c(211.5,223.5),c(-2,3))
    G23area=skyarea(c(338.1,351.9),c(-35,-30))

    #Total GAMA survey area:
    TotalGAMAarea=G02area+G09area+G12area+G15area+G23area
    paste('The GAMA survey area is',round(TotalGAMAarea['area'],2),'sq. deg.')

    #Future TACs note: this is less than 1% of the sky ;-)
    paste('The GAMA survey area is',round(TotalGAMAarea['areafrac']*100,2),'% of the sky')

[Package celestial version 1.4.1 Index]