Package uk.ac.starlink.ttools.cone
Class SkyBox
- java.lang.Object
-
- uk.ac.starlink.ttools.cone.SkyBox
-
public class SkyBox extends java.lang.Object
Defines a region of the celestial sphere which is rectangular in Right Ascension and Declination coordinates.This class just aggregates a two-element double[] array (x1,x2) for each of right ascension and declination. The meaning in each case is as follows:
- x1<x2: included range (x1 <= value <= x2)
- x1>x2: excluded range (value <= x1 or value >= x2)
Values should be in the range 0<=ra<2*PI and -PI/2<dec<+PI (or equivalent in degrees if degrees are being used).
The static
getConeBox(double, double, double)
method is provided to generate a SkyBox suitable for cone search queries.- Since:
- 9 Jan 2008
- Author:
- Mark Taylor
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static double
calculateDeltaRa(double dec, double sr)
Works out the minimum change in Right Ascension which will encompass all points within a given search radius at a given central declination.static SkyBox
getConeBox(double ra, double dec, double sr)
Returns a minimal SkyBox which encloses a given cone using radians.double[]
getDecRange()
Returns declination range.double[]
getRaRange()
Returns right ascension range.SkyBox
toDegrees()
Converts the units of this SkyBox from radians to degrees.SkyBox
toRadians()
Converts the units of this SkyBox from degrees to radians.
-
-
-
Method Detail
-
getRaRange
public double[] getRaRange()
Returns right ascension range. See class documentation for range semantics.- Returns:
- (ra1,ra2) array or null
-
getDecRange
public double[] getDecRange()
Returns declination range. See class documentation for range semantics.- Returns:
- (dec1,dec2) array or null
-
toDegrees
public SkyBox toDegrees()
Converts the units of this SkyBox from radians to degrees.- Returns:
- new sky box with converted range values
-
toRadians
public SkyBox toRadians()
Converts the units of this SkyBox from degrees to radians.- Returns:
- new sky box with converted range values
-
getConeBox
public static SkyBox getConeBox(double ra, double dec, double sr)
Returns a minimal SkyBox which encloses a given cone using radians. The declination range of the result will be of included type, but the right ascension range may be either included or excluded.- Parameters:
ra
- cone centre right ascension in radiansdec
- cone centre declination in radianssr
- cone radius in radians- Returns:
- sky box enclosing cone, with angles in radians
-
calculateDeltaRa
public static double calculateDeltaRa(double dec, double sr)
Works out the minimum change in Right Ascension which will encompass all points within a given search radius at a given central declination.- Parameters:
dec
- declination of the centre of the search region in radianssr
- radius of the search region in radians- Returns:
- minimum change in radians of RA from the central value which will contain the entire search region
-
-