|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjsky.coords.WorldCoords
public class WorldCoords
Class representing world coordinates (right-ascension, declination, stored as J2000 internally).
Field Summary | |
---|---|
protected DMS |
dec
The DEC coordinate |
protected HMS |
ra
The RA coordinate |
Constructor Summary | |
---|---|
WorldCoords()
Default constructor: initialize null coordinates. |
|
WorldCoords(double ra,
double dec)
Initialize from ra and dec (in degrees J2000). |
|
WorldCoords(java.lang.Double ra,
java.lang.Double dec)
Initialize from ra and dec (in degrees J2000). |
|
WorldCoords(double ra,
double dec,
double equinox)
Initialize from ra and dec (in degrees). |
|
WorldCoords(java.lang.Double ra,
java.lang.Double dec,
double equinox)
Initialize from ra and dec (in degrees). |
|
WorldCoords(double rh,
int rm,
double rs,
double dd,
int dm,
double ds)
Initialize from RA hours, minutes, seconds and and DEC degress, minutes, seconds in J2000. |
|
WorldCoords(double rh,
int rm,
double rs,
double dd,
int dm,
double ds,
double equinox)
Initialize from RA hours, minutes, seconds and and DEC degress, minutes, seconds. |
|
WorldCoords(HMS ra,
DMS dec)
Initialize from ra (hours) and dec (degrees) in J2000. |
|
WorldCoords(HMS ra,
DMS dec,
double equinox)
Initialize from ra (hours) and dec (degrees). |
|
WorldCoords(java.awt.geom.Point2D.Double p)
Initialize from an ra, dec point (in degrees J2000). |
|
WorldCoords(java.awt.geom.Point2D.Double p,
double equinox)
Initialize from an ra, dec point in the given equinox. |
|
WorldCoords(java.lang.String ra,
java.lang.String dec)
Parse RA and DEC in string format (assume J2000). |
|
WorldCoords(java.lang.String ra,
java.lang.String dec,
boolean hflag)
Parse RA and DEC in string format (assume J2000). |
|
WorldCoords(java.lang.String ra,
java.lang.String dec,
double equinox)
Parse RA and DEC in string format. |
|
WorldCoords(java.lang.String ra,
java.lang.String dec,
double equinox,
boolean hflag)
Parse RA and DEC in string format. |
Method Summary | |
---|---|
WorldCoordinates[] |
box(double radius)
Given a radius in arcmin, return an array {pos1, pos2} with the 2 endpoints that form a box with center at "this" position. |
double[] |
center(WorldCoordinates pos1,
WorldCoordinates pos2)
Given the endpoints of a box (pos1, pos2), return an array containing the center ra, dec in degrees, as well as the width, height, and radius of the box in arcmin. |
static double[] |
dispos(double dra0,
double decd0,
double dra,
double decd)
Computes distance and position angle solving a spherical triangle (no approximations). |
double[] |
dispos(WorldCoordinates pos)
return the distance between this position and the given one in arcmin and also set the position angle |
double |
dist(Coordinates pos)
Return the distance between this position and the given one in arcmin. |
static double |
dist(double ra0,
double dec0,
double ra1,
double dec1)
static member to get the distance between 2 points in arcmin |
double |
dist(WorldCoords pos)
Return the distance between this position and the given one in arcmin. |
java.lang.String[] |
format()
Format RA and DEC in h:m:s [+-]d:m:s format in J2000 and return them as a 2 element String array. |
java.lang.String[] |
format(double equinox)
Format RA and DEC in h:m:s [+-]d:m:s format in the given equinox and return them as a 2 element String array. |
java.lang.String |
getCoordinateSystemName()
Returns the name of the coordinate system as a string. |
DMS |
getDec()
return the DEC value |
double |
getDecDeg()
return the DEC value in deg |
HMS |
getRA()
return the RA value |
double[] |
getRaDec(double equinox)
Return RA and DEC in degrees as an array of 2 doubles {ra, dec} in the given equinox. |
double |
getRaDeg()
return the RA value in deg |
double |
getX()
return the X (ra) coordinate in deg |
double |
getY()
return the Y *dec) coordinate in deg |
static void |
main(java.lang.String[] args)
Test cases |
java.lang.String |
toString()
Return the coordinates as a string in h:m:s [+-]d:m:s format |
static double |
wcsdist(double x1,
double y1,
double x2,
double y2)
Compute the distance in degrees between the two given coordinates. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected HMS ra
protected DMS dec
Constructor Detail |
---|
public WorldCoords()
public WorldCoords(HMS ra, DMS dec, double equinox)
ra
- The RA value in hoursdec
- The DEC value in degreesequinox
- The equinox of the input coordinates.public WorldCoords(HMS ra, DMS dec)
ra
- The RA value in hoursdec
- The DEC value in degreespublic WorldCoords(double ra, double dec, double equinox)
ra
- The RA value in degreesdec
- The DEC value in degreesequinox
- The equinox of the input coordinates.public WorldCoords(java.lang.Double ra, java.lang.Double dec, double equinox)
ra
- The RA value in degreesdec
- The DEC value in degreesequinox
- The equinox of the input coordinates.public WorldCoords(double ra, double dec)
ra
- The RA value in degreesdec
- The DEC value in degreespublic WorldCoords(java.awt.geom.Point2D.Double p, double equinox)
p
- The RA,Dec point in degreespublic WorldCoords(java.awt.geom.Point2D.Double p)
p
- The RA,Dec point in degreespublic WorldCoords(java.lang.Double ra, java.lang.Double dec)
ra
- The RA value in degreesdec
- The DEC value in degreespublic WorldCoords(double rh, int rm, double rs, double dd, int dm, double ds, double equinox)
rh
- RA hoursrm
- RA minutesrs
- RA secondsdd
- DEC degreesdm
- DEC minutesds
- DEC secondsequinox
- The equinox of the input coordinates.public WorldCoords(double rh, int rm, double rs, double dd, int dm, double ds)
rh
- RA hoursrm
- RA minutesrs
- RA secondsdd
- DEC degreesdm
- DEC minutesds
- DEC secondspublic WorldCoords(java.lang.String ra, java.lang.String dec, double equinox)
ra
- The RA value in the form "hh mm ss.s", "hh:mm:ss.s",
or just "hh.hhh".dec
- The DEC value in the form "[+/-]dd mm ss.s", "[+/-]dd:mm:ss.s"
or just "[+/-]dd.ddd".equinox
- The equinox of the input coordinates.public WorldCoords(java.lang.String ra, java.lang.String dec, double equinox, boolean hflag)
ra
- The RA value in the form "hh mm ss.s", "hh:mm:ss.s",
or just "hh.hhh".dec
- The DEC value in the form "[+/-]dd mm ss.s", "[+/-]dd:mm:ss.s"
or just "[+/-]dd.ddd".equinox
- The equinox of the input coordinates.hflag
- if true, always assume ra is in hours, otherwise, assume deg if
ra is a decimal value.public WorldCoords(java.lang.String ra, java.lang.String dec)
ra
- The RA value in the form "hh mm ss.s", "hh:mm:ss.s",
or just "hh.hhh".dec
- The DEC value in the form "[+/-]dd mm ss.s", "[+/-]dd:mm:ss.s"
or just "[+/-]dd.ddd".public WorldCoords(java.lang.String ra, java.lang.String dec, boolean hflag)
ra
- The RA value in the form "hh mm ss.s", "hh:mm:ss.s",
or just "hh.hhh".dec
- The DEC value in the form "[+/-]dd mm ss.s", "[+/-]dd:mm:ss.s"
or just "[+/-]dd.ddd".hflag
- if true, always assume ra is in hours, otherwise, assume deg if
ra is a decimal value.Method Detail |
---|
public HMS getRA()
getRA
in interface WorldCoordinates
public DMS getDec()
getDec
in interface WorldCoordinates
public double getRaDeg()
getRaDeg
in interface WorldCoordinates
public double getDecDeg()
getDecDeg
in interface WorldCoordinates
public double getX()
getX
in interface Coordinates
public double getY()
getY
in interface Coordinates
public java.lang.String toString()
toString
in interface Coordinates
toString
in interface WorldCoordinates
toString
in class java.lang.Object
public java.lang.String[] format(double equinox)
format
in interface WorldCoordinates
public java.lang.String[] format()
format
in interface WorldCoordinates
public double[] getRaDec(double equinox)
getRaDec
in interface WorldCoordinates
public static double[] dispos(double dra0, double decd0, double dra, double decd)
dra0
- center RAdecd0
- center DECdra
- point RAdecd
- point DEC
public double[] dispos(WorldCoordinates pos)
dispos
in interface WorldCoordinates
pos
- The other point.
public static double wcsdist(double x1, double y1, double x2, double y2)
public double dist(WorldCoords pos)
pos
- The other point.
public double dist(Coordinates pos)
dist
in interface Coordinates
pos
- The other point.
public static double dist(double ra0, double dec0, double ra1, double dec1)
ra0
- The first RA valuedec0
- The first DEC valuera1
- The second RA valuedec1
- The second DEC value
public WorldCoordinates[] box(double radius)
box
in interface WorldCoordinates
radius
- The radius in arcmin.
public double[] center(WorldCoordinates pos1, WorldCoordinates pos2)
center
in interface WorldCoordinates
pos1
- The first endpoint of the box.pos2
- The second endpoint of the box.
public java.lang.String getCoordinateSystemName()
getCoordinateSystemName
in interface Coordinates
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |