public class ASTConstellation
extends java.lang.Object
All data and methods are declared shared because it doesn't make sense to have multiple constellation databases in an application. Unless otherwise noted, RA is given in hours, Decl is given in degrees, and both coordinates are w.r.t. Epoch 2000.0.
Copyright (c) 2018
Constructor and Description |
---|
ASTConstellation() |
Modifier and Type | Method and Description |
---|---|
static boolean |
areConstellationsLoaded()
Gets whether the constellations database has been loaded.
|
static void |
displayAllConstellations()
Displays a list of all the constellations.
|
static void |
displayConstellation(int idx)
Displays data for a constellation.
|
static int |
findConstellationByAbbrvName(java.lang.String targ)
Searches the constellations database and returns the index into the database for
the requested constellation by its abbreviated name.
|
static int |
findConstellationByName(java.lang.String targ)
Searches the constellations database and returns the index into the database for
the requested constellation by its name.
|
static int |
findConstellationFromCoord(double RAIn,
double DeclIn,
double EpochIn)
Find the constellation that a particular RA/Decl falls within.
|
static java.util.List<java.lang.Integer> |
findConstellationsByMeaning(java.lang.String targ)
Searches the constellations database and returns an index into the database for all
constellations that contain the target substring in their 'meaning' field.
|
static java.lang.String |
getConstAbbrevName(int idx)
Gets a constellation's international 3-character abbreviated name
|
static double |
getConstBrightestStarDecl(int idx)
Gets the declination (Epoch J2000.0) for the constellation's brightest star
|
static java.lang.String |
getConstBrightestStarName(int idx)
Gets the name of the brightest star in the constellation
|
static double |
getConstBrightestStarRA(int idx)
Gets the right ascension (Epoch J2000.0) for the constellation's brightest star
|
static double |
getConstCenterDecl(int idx)
Gets the declination (Epoch J2000.0) for the constellation's center
|
static double |
getConstCenterRA(int idx)
Gets the right ascension (Epoch J2000.0) for the constellation's center
|
static java.lang.String |
getConstMeaning(int idx)
Gets a constellation's 'meaning' (e.g., Andromeda means 'The Chained Maiden')
|
static java.lang.String |
getConstName(int idx)
Gets a constellation's name
|
static int |
getNumConstellations()
Gets the number of constellations in the database
|
static void |
initConstellations(ASTPrt prtInstance)
Does a one-time initialization by reading in the constellation data file.
|
public static int getNumConstellations()
public static java.lang.String getConstName(int idx)
idx
- which constellation is being referencedpublic static java.lang.String getConstAbbrevName(int idx)
idx
- which constellation is being referencedpublic static java.lang.String getConstMeaning(int idx)
idx
- which constellation is being referencedpublic static double getConstCenterRA(int idx)
idx
- which constellation is being referencedpublic static double getConstCenterDecl(int idx)
idx
- which constellation is being referencedpublic static java.lang.String getConstBrightestStarName(int idx)
idx
- which constellation is being referencedpublic static double getConstBrightestStarRA(int idx)
idx
- which constellation is being referencedpublic static double getConstBrightestStarDecl(int idx)
idx
- which constellation is being referencedpublic static boolean areConstellationsLoaded()
public static void displayAllConstellations()
public static void displayConstellation(int idx)
idx
- index into constDB for the constellation to display. 0-based
indexing is assumed!public static int findConstellationByAbbrvName(java.lang.String targ)
The search performed is not case sensitive, but an exact match, ignoring white space, is required.
targ
- Abbreviated name of the constellation to findpublic static java.util.List<java.lang.Integer> findConstellationsByMeaning(java.lang.String targ)
The search performed is not case sensitive.
targ
- target substring to search forpublic static int findConstellationByName(java.lang.String targ)
The search performed is not case sensitive, but an exact match, ignoring white space, is required.
targ
- Constellation name to findpublic static int findConstellationFromCoord(double RAIn, double DeclIn, double EpochIn)
The code for this method was converted from the C and Fortran code found in the VizieR archives, http://cdsarc.u-strasbg.fr/viz-bin/Cat?VI/42. The code is translated somewhat literally, taking into account that array indexing in Java is 0 based whereas Fortran is not.
RAIn
- right ascension in decimal hours (actually, hour angle)DeclIn
- declination in decimal degreesEpochIn
- epoch in which the RAIn/DeclIn are givenpublic static void initConstellations(ASTPrt prtInstance) throws java.io.IOException
prtInstance
- instance for performing output to the application's scrollable text output areajava.io.IOException
- Error in trying to read the constellations data file.