public class SimpleStar extends Object implements Cloneable, Serializable, Star
Star.NAME: The name of the star. Can be any string, but consider
using catalog definitions like HD 12545.Star.ID: The unique star identifier. A parsable integer, zero
denoting undefined. Defaults to DEFID.Star.RA: The right ascension of the star. A parsable double, in
degrees.Star.DEC: The declination of the star. A parsable double, in degrees.
Star.PROPRA: The proper motion in right ascension of the star, in mas
per year. For convenience already multiplied with the cosine of the stars
declination. Defaults to DEFPROPRA.Star.PROPDEC: The proper motion in declination of the star, in mas
per year. Defaults to DEFPROPDECStar.EPOCH: The epoch of the star position. Defaults to
Star.DEFEPOCH.Star.EQUINOX: The equinox of the star position. Defaults to
Star.DEFEQUINOX.Star.MAG: The brightness of the star, in magnitudes. Should use
Johnson V.Star.COLOR: The color index of the star, in magnitudes. Should use
Johnson B-V. Defaults to DEFCOLORgetID(): Returns the integer-id of the stargetRa(): Returns the double of the right ascension.#getDec: Returns the double of the declination.getPropRa(): Returns the double of the proper motion in ra.#getPropDec: Returns the double of the proper motion in dec.getMag(): Returns the float of the brightnessgetColor(): Returns the float of the color index.getEpoch(): Returns the float of the epoch of the star position.
getEquinox(): Returns the float of the equinox of the star
position| Modifier and Type | Class and Description |
|---|---|
static class |
SimpleStar.Distance
For sorting star lists to distance of center.
|
static class |
SimpleStar.StarComparator
Gets a star definition comparator linked to the named property of the
star.
|
| Modifier and Type | Field and Description |
|---|---|
private Map<String,Object> |
addon
A mapping of additinal properties of the stars to their values.
|
private Float |
color
The color of the star.
|
private Double |
de
The declination of the star.
|
static float |
DEFCOLOR
The default color of the star (0.0).
|
private static int |
DEFDECPRECISSION |
static int |
DEFID
The default star id (0=undefined).
|
static double |
DEFPROPDEC
The default proper motion in dec (0.0).
|
static double |
DEFPROPRA
The default proper motion in ra (0.0).
|
private static int |
DEFRAPRECISSION |
private Float |
epoch
Epoch.
|
private Float |
equinox
Equinox of ra de.
|
static String |
HTM
Star names from HTM.
|
private Integer |
id
Integer id of the star.
|
private Float |
mag
The magnitude of the star.
|
private String |
name
Name of the star.
|
private Double |
pmde
Proper motion in de, in milli arc-sec per year.
|
private Double |
pmra
Proper motion in ra, in milli arc-sec per year, divided by cosine dec.
|
private Double |
ra
The right ascension of the star.
|
private static long |
serialVersionUID |
static float |
SKYMAG
Unknown mag, use sky brightness.
|
static SimpleStar |
SOL |
private static String |
SOLNAME |
static String |
UNKNOWN
Unknown star names.
|
| Constructor and Description |
|---|
SimpleStar()
Constructs a new empty star description.
|
SimpleStar(Star copy)
Constructs a new star description from the source object.
|
SimpleStar(String name)
Constructs a new empty star description.
|
SimpleStar(String name,
String ras,
String decs,
String mags)
Constructs a new star description with the minimal information.
|
SimpleStar(String name,
String id,
String ras,
String decs,
String mags,
String color)
Constructs a new star description.
|
SimpleStar(String name,
String id,
String ras,
String decs,
String pra,
String pdec,
String mags,
String color)
Constructs a new star description.
|
SimpleStar(String name,
String id,
String ras,
String decs,
String pra,
String pdec,
String ep,
String eq,
String mags,
String color)
Constructs a new full star description.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other)
Two stars are equal if they have the same name, or if their separation is
zero.
|
static Map<Integer,Star> |
exportIdMap(List<Star> l)
Exports a list of stas as a mapping of star names to stars.
|
static Map<String,Star> |
exportNameMap(List<Star> l)
Exports a list of stas as a mapping of star names to stars.
|
static SimpleStar |
fillMissing(Star main,
Star fill)
Adds all data that is missing from the first star entry, but present in
the second into the first and returns it.
|
Object |
get(String key)
Returns the queried value in its string representation of addintional
info.
|
float |
getColor()
Returns the color of the star as a float.
|
double |
getDe()
Returns the declination of the star as a double in degrees.
|
float |
getEpoch()
Returns the epoch of the position coordinate system as a float.
|
float |
getEquinox()
Returns the equinox of the position coordinate system as a float.
|
static String |
getHtmName(double ra,
double de) |
static String |
getHtmName(Star marginal) |
int |
getID()
Returns the star id as an int.
|
float |
getMag()
Returns the magnitude of the star as a float.
|
static SimpleStar.StarComparator |
getMagComparator()
Convenience method.
|
String |
getName()
Returns the target name.
|
double |
getPropDe()
Returns the proper motion in declination of the star as a double.
|
String |
getProperty(String key)
Returns the queried value in its string representation of addintional
info.
|
double |
getPropRa()
Returns the proper motion in ra of the star as a double.
|
double |
getRa()
Returns the right ascension of the star as a double in degrees.
|
double |
getSeparation(double ra2,
double de2)
Returns the distance in degrees of this star description to the argument
one.
|
static double |
getSeparation(double ra1,
double ra2,
double de1,
double de2)
Returns the distance of two stars, in degrees.
|
double |
getSeparation(Star other)
Returns the distance in degrees of this star description to the argument
one.
|
static double |
getSeparation(Star s1,
double ra2,
double de2)
Returns the distance of two stars, in degrees.
|
static double |
getSeparation(Star s1,
Star s2)
Returns the distance of two stars, in degrees.
|
boolean |
isFullyValid()
Checks if ra, de, mag, color, pmra, and pmde are defined.
|
boolean |
isMarginallyValid()
Checks if at least the right ascension and the declination is valid.
|
static boolean |
isSexagesimal(String dm)
We try to infer if a specified string is in sexagesimal format, which we
define by twice occurance of ':'.
|
boolean |
isValid()
Checks if ra, de, and mag of the star is defined.
|
boolean |
isVeryValid()
Checks if ra, de, mag, and color is defined.
|
boolean |
matches(Star s2,
double maxdist,
float magoff)
Tries to match two stars.
|
static boolean |
matches(Star s1,
Star s2,
double maxdist,
float magoff)
Tries to match two stars.
|
static double |
parseSexagesimal(String dm)
We convert a string given as dd:mm:ss.sss into a normal double.
|
String |
raDeString() |
String |
raDeString(int raprec,
int deprec) |
static String |
raDeString(Star onto) |
static String |
raDeString(Star s,
int raprec,
int deprec) |
Object |
set(String key,
Object to)
Sets the object.
|
Object |
setColor(float bv)
Sets the color of the star.
|
Object |
setDe(double dec)
Sets the declination of the star.
|
Object |
setEpoch(float ep)
Sets the epoch of the position coordinate system.
|
Object |
setEquinox(float eq)
Sets the equinox of the position coordinate system.
|
Object |
setID(int id)
Sets the star id.
|
Object |
setMag(float v)
Sets the brightness of the star.
|
Object |
setName(String name)
Sets the target name.
|
Object |
setPropDe(double pdec)
Sets the proper motion in dec of the star.
|
Object |
setProperty(String key,
String val)
Scans the key for recognized keywords.
|
Object |
setPropRa(double pra)
Sets the proper motion in ra of the star.
|
Object |
setRa(double ra)
Sets the right ascension of the star.
|
String |
sexagesimal() |
String |
sexagesimal(int raprec,
int deprec) |
static String |
sexagesimal(Star s) |
static String |
sexagesimal(Star s,
int raprec,
int deprec) |
String |
toBasicString()
Returns sexagesimal RA in hours and DE, appends mag if valid.
|
static String |
toBasicString(Star s)
Returns sexagesimal RA in hours and DE, appends mag if valid.
|
String |
toDegreeString()
Returns decimal RA in degrees and DE.
|
static String |
toDegreeString(Star s)
Returns decimal RA in degrees and DE.
|
String |
toString()
Converts the star description name, ra, dec, mag and color into a string.
|
private static final int DEFDECPRECISSION
private static final int DEFRAPRECISSION
private static final long serialVersionUID
public static final String UNKNOWN
public static final String HTM
public static final float SKYMAG
public static final double DEFPROPRA
public static final double DEFPROPDEC
public static final float DEFCOLOR
public static final int DEFID
private static final String SOLNAME
private String name
private Integer id
private Double ra
private Double de
private Float mag
private Float color
private Float epoch
private Float equinox
private Double pmra
private Double pmde
private Map<String,Object> addon
public static SimpleStar SOL
public SimpleStar()
public SimpleStar(String name)
public SimpleStar(Star copy)
public SimpleStar(String name, String ras, String decs, String mags)
name - Name of the star.ras - Right ascension of the star.decs - Declination of the star.mags - Brightness of the star.public SimpleStar(String name, String id, String ras, String decs, String mags, String color)
name - Name of the star.id - ID of the star.ras - Right ascension of the star.decs - Declination of the star.mags - Brightness of the star.color - Color index of the star.public SimpleStar(String name, String id, String ras, String decs, String pra, String pdec, String mags, String color)
name - Name of the star.id - ID of the star.ras - Right ascension of the star.decs - Declination of the star.mags - Brightness of the star.color - Color index of the star.public SimpleStar(String name, String id, String ras, String decs, String pra, String pdec, String ep, String eq, String mags, String color)
name - Name of the star.id - ID of the star.ras - Right ascension of the star.decs - Declination of the star.pra - Proper motion in ra of the star.pdec - Proper motion in dec of the star.ep - Epoch of the coordinate system.eq - Equinox of the coordinate system.mags - Brightness of the star.color - Color index of the star.public Object get(String key)
public String getProperty(String key)
public Object setProperty(String key, String val)
public Object set(String key, Object to)
public Object setID(int id)
public int getID()
Starpublic static String getHtmName(double ra, double de)
public Object setRa(double ra)
ra - Right ascension in degreespublic double getRa()
Starpublic Object setDe(double dec)
dec - Declination of star in degrees.public double getDe()
Starpublic Object setPropRa(double pra)
public double getPropRa()
Starpublic Object setPropDe(double pdec)
public double getPropDe()
Starpublic Object setEpoch(float ep)
public float getEpoch()
Starpublic Object setEquinox(float eq)
public float getEquinox()
StargetEquinox in interface Starpublic Object setMag(float v)
public float getMag()
Starpublic Object setColor(float bv)
public float getColor()
Starpublic double getSeparation(Star other)
public double getSeparation(double ra2,
double de2)
public static final double getSeparation(Star s1, Star s2)
public static final double getSeparation(Star s1, double ra2, double de2)
public static final double getSeparation(double ra1,
double ra2,
double de1,
double de2)
public boolean equals(Object other)
public boolean matches(Star s2, double maxdist, float magoff)
public static boolean matches(Star s1, Star s2, double maxdist, float magoff)
public String toString()
public String sexagesimal()
public String sexagesimal(int raprec, int deprec)
public String raDeString()
public String raDeString(int raprec, int deprec)
public String toBasicString()
public static String toBasicString(Star s)
public String toDegreeString()
public static String toDegreeString(Star s)
public static boolean isSexagesimal(String dm)
public static double parseSexagesimal(String dm)
public boolean isMarginallyValid()
StarisMarginallyValid in interface Starpublic boolean isValid()
Starpublic boolean isVeryValid()
StarisVeryValid in interface Starpublic boolean isFullyValid()
StarisFullyValid in interface Starpublic static SimpleStar fillMissing(Star main, Star fill)
public static Map<String,Star> exportNameMap(List<Star> l)
public static Map<Integer,Star> exportIdMap(List<Star> l)
public static SimpleStar.StarComparator getMagComparator()