public class ASTCatalog extends java.lang.Object implements java.lang.Comparable<ASTCatalog>
The catalog data files **MUST** be in the format specifically designed for this book. The format can be gleaned by opening any of the star catalog data files and examining them. The format is straightforward. The data files provided with this book were created from publicly available sources, particularly those data files maintained in the NASA HEASARC archives, which are at the URL http://heasarc.gsfc.nasa.gov/docs/archive.html as of the time this book was written. Because the catalogs can be so large, static methods and data are defined in this class so that the class can easily enforce having only one catalog loaded at a time. The calling routine must create a class instance so that things get initialized properly.
Copyright (c) 2018
Modifier and Type | Class and Description |
---|---|
static class |
ASTCatalog.CatalogSortField
Define the ways a star catalog can be sorted and a method for converting the
'enum' type to a printable string.
|
Modifier and Type | Field and Description |
---|---|
static java.util.Comparator<jll.celcalc.ASTUtils.ASTCatalog.SpaceObj> |
constAndObjNameComparator
Comparator for sorting catalog objects by the Constellation
they are in, and then by the object's name
|
static java.util.Comparator<jll.celcalc.ASTUtils.ASTCatalog.SpaceObj> |
constComparator
Comparator for sorting catalog objects by the constellation they are in.
|
static java.util.Comparator<jll.celcalc.ASTUtils.ASTCatalog.SpaceObj> |
spaceObjAltNameComparator
Comparator for sorting catalog objects by an object's alternate name
|
static java.util.Comparator<jll.celcalc.ASTUtils.ASTCatalog.SpaceObj> |
spaceObjDeclComparator
Comparator for sorting catalog objects by Decl
|
static java.util.Comparator<jll.celcalc.ASTUtils.ASTCatalog.SpaceObj> |
spaceObjmVComparator
Comparator for sorting catalog objects by visual magnitude
|
static java.util.Comparator<jll.celcalc.ASTUtils.ASTCatalog.SpaceObj> |
spaceObjNameComparator
Comparator for sorting catalog objects by an object's name
|
static java.util.Comparator<jll.celcalc.ASTUtils.ASTCatalog.SpaceObj> |
spaceObjRAComparator
Comparator for sorting catalog objects by RA
|
Constructor and Description |
---|
ASTCatalog() |
Modifier and Type | Method and Description |
---|---|
static void |
clearCatalogAndSpaceObjects()
Clears all the currently loaded catalog data including all space objects in the catalog
|
int |
compareTo(ASTCatalog obj)
Defines the 'natural' ordering for a catalog.
|
static void |
displayAllCatalogObjects()
Displays all space objects in the currently loaded catalog
by however the catalog is currently sorted.
|
static void |
displayAllCatalogObjects(double mVFilter)
Displays all space objects in the currently loaded catalog
by however the catalog is currently sorted.
|
static void |
displayAllObjsByConstellation(int idx,
boolean sortOrder)
Displays all space objects in the currently loaded catalog
by constellation.
|
static void |
displayAllObjsByConstellation(int idx,
boolean sortOrder,
double mVFilter)
Displays all space objects in the currently loaded catalog
by constellation.
|
static void |
displayAllObjsByRange(int nStart,
int nEnd)
Displays all space objects in the currently loaded catalog by
range, however the catalog is currently sorted.
|
static void |
displayAllObjsByRange(int nStart,
int nEnd,
double mVFilter)
Displays all space objects in the currently loaded catalog by
range, however the catalog is currently sorted.
|
static void |
displayCatalogInfo()
Displays the catalog header information
|
static void |
displayFullObjInfo(int i)
Displays all information in the catalog about the i-th space
object entry in the currently loaded and sorted catalog
|
static int |
findObjByAltName(java.lang.String searchStr)
Finds an object in the current catalog given its alternate name.
|
static int |
findObjByName(java.lang.String searchStr)
Finds an object in the current catalog given its name.
|
static java.util.List<java.lang.Integer> |
findObjsByComments(java.lang.String targ)
Searches the currently loaded star catalog and returns an index into
the database for all objects that contain the target substring
in their 'comments' field.
|
static java.lang.String |
getCatAuthor()
Gets the author(s) who created the catalog
|
static java.lang.String |
getCatDate()
Gets the most recent date that the catalog was updated.
|
static java.lang.String |
getCatDescription()
Gets an amplifying description of this catalog
|
static double |
getCatEpoch()
Gets the Epoch to which catalog objects are referenced
|
static boolean |
getCatEpochKnown()
Gets whether the catalog Epoch is known
|
static java.lang.String |
getCatFileToOpen()
Puts up a browser window and gets a star catalog filename.
|
static double |
getCatmVLimit()
Gets the visual magnitude limit used to filter the catalog.
|
static boolean |
getCatmVProvided()
Gets whether the catalog provides visual magnitude for the objects
in the catalog.
|
static int |
getCatNumConst()
Gets the number of constellations that the catalog covers
|
static int |
getCatNumObjs()
Gets how many space objects are in the catalog.
|
static java.lang.String |
getCatObjAltName(int idx)
Gets an object's alternate name
|
static java.lang.String |
getCatObjComment(int idx)
Gets a comment about the object
|
static int |
getCatObjConstIdx(int idx)
Gets an index into the constellations database for the constellation
in which this object lies within.
|
static double |
getCatObjDecl(int idx)
Gets an object's Decl w.r.t.
|
static double |
getCatObjmV(int idx)
Gets an object's visual magnitude
|
static boolean |
getCatObjmVKnown(int idx)
Gets whether the object's visual magnitude is known
|
static java.lang.String |
getCatObjName(int idx)
Gets an object's name
|
static double |
getCatObjRA(int idx)
Gets an object's RA w.r.t.
|
static java.lang.String |
getCatSource()
Gets the source from which this catalog came
|
static java.lang.String |
getCatType()
Gets the catalog type.
|
static javax.swing.filechooser.FileNameExtensionFilter |
getFileExtFilter()
Gets a filter for filtering star catalog files by extension.
|
static void |
initStarCatalogs(ASTPrt prtInstance)
Does a one-time initialization required for loading or using Star Catalogs
|
static boolean |
isCatalogLoaded()
Checks to see if a star catalog has been loaded
|
static boolean |
loadFormattedStarCatalog(java.lang.String filename)
Loads a catalog from disk.
|
static void |
sortStarCatalog(ASTCatalog.CatalogSortField sortField,
boolean sortOrder)
Sorts the catalog of space objects.
|
public static java.util.Comparator<jll.celcalc.ASTUtils.ASTCatalog.SpaceObj> constAndObjNameComparator
public static java.util.Comparator<jll.celcalc.ASTUtils.ASTCatalog.SpaceObj> constComparator
public static java.util.Comparator<jll.celcalc.ASTUtils.ASTCatalog.SpaceObj> spaceObjAltNameComparator
public static java.util.Comparator<jll.celcalc.ASTUtils.ASTCatalog.SpaceObj> spaceObjDeclComparator
public static java.util.Comparator<jll.celcalc.ASTUtils.ASTCatalog.SpaceObj> spaceObjmVComparator
public static java.util.Comparator<jll.celcalc.ASTUtils.ASTCatalog.SpaceObj> spaceObjNameComparator
public static java.util.Comparator<jll.celcalc.ASTUtils.ASTCatalog.SpaceObj> spaceObjRAComparator
public static javax.swing.filechooser.FileNameExtensionFilter getFileExtFilter()
public static java.lang.String getCatAuthor()
public static java.lang.String getCatDate()
public static java.lang.String getCatDescription()
public static double getCatEpoch()
public static boolean getCatEpochKnown()
public static double getCatmVLimit()
public static boolean getCatmVProvided()
public static java.lang.String getCatType()
public static int getCatNumConst()
public static int getCatNumObjs()
public static java.lang.String getCatSource()
public static java.lang.String getCatObjAltName(int idx)
idx
- which object (0-based indexing) from the space objects database is desiredpublic static java.lang.String getCatObjComment(int idx)
idx
- which object (0-based indexing) from the space objects database is desiredpublic static int getCatObjConstIdx(int idx)
idx
- which object (0-based indexing) from the space objects database is desiredpublic static double getCatObjDecl(int idx)
idx
- which object (0-based indexing) in the space objects databasepublic static double getCatObjmV(int idx)
idx
- which object (0-based indexing) in the space objects databasepublic static boolean getCatObjmVKnown(int idx)
idx
- which object (0-based indexing) in the space objects databasepublic static java.lang.String getCatObjName(int idx)
idx
- which object (0-based indexing) from the space objects database is desiredpublic static double getCatObjRA(int idx)
idx
- which object (0-based indexing) in the space objects databasepublic static void clearCatalogAndSpaceObjects()
public static void displayAllCatalogObjects()
public static void displayAllCatalogObjects(double mVFilter)
mVFilter
- filter for displaying only those objects
that are at least as bright as mVFilterpublic static void displayAllObjsByConstellation(int idx, boolean sortOrder)
idx
- index into constellations database for the
constellation of interestsortOrder
- Sort in ascending order if ASCENDING_ORDER, else
sort in descending orderpublic static void displayAllObjsByConstellation(int idx, boolean sortOrder, double mVFilter)
idx
- index into constellations database for the
constellation of interestsortOrder
- Sort in ascending order if ASCENDING_ORDER, else
sort in descending ordermVFilter
- filter for displaying only those objects
that are at least as bright as mVFilterpublic static void displayAllObjsByRange(int nStart, int nEnd)
nStart
- the range start (assuming 0-based numbering so that 0 is the 1st item)nEnd
- the end of the range (assuming 0-based numbering)public static void displayAllObjsByRange(int nStart, int nEnd, double mVFilter)
nStart
- the range start (assuming 0-based numbering so that 0 is the 1st item)nEnd
- the end of the range (assuming 0-based numbering)mVFilter
- filter for displaying only those objects that are at least as bright as mVFilterpublic static void displayCatalogInfo()
public static void displayFullObjInfo(int i)
i
- Which object to display (assumes 0-based indexing).public static int findObjByAltName(java.lang.String searchStr)
searchStr
- The name to search for. An exact match, ignoring whitespace and case, is required.public static java.util.List<java.lang.Integer> findObjsByComments(java.lang.String targ)
targ
- target substring to search forpublic static int findObjByName(java.lang.String searchStr)
searchStr
- The name to search for. An exact match, ignoring whitespace and case, is required.public static java.lang.String getCatFileToOpen()
public static boolean isCatalogLoaded()
public static void initStarCatalogs(ASTPrt prtInstance)
prtInstance
- instance for performing output to the application's scrollable text output areapublic static boolean loadFormattedStarCatalog(java.lang.String filename)
filename
- The full filename (including path) to load.public static void sortStarCatalog(ASTCatalog.CatalogSortField sortField, boolean sortOrder)
sortField
- What field to sort on.sortOrder
- Sort in ascending order if ASCENDING_ORDER,
else sort in descending orderpublic int compareTo(ASTCatalog obj)
This method doesn't do anything because it doesn't make sense to sort the catalog, only the objects within the catalog. This method should really never be called by any of the code, but it is required because we are implementing a Comparator interface.
compareTo
in interface java.lang.Comparable<ASTCatalog>