astro
Class StarCatalog

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by astro.StarCatalog
All Implemented Interfaces:
Cloneable, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying

public class StarCatalog
extends PropertyBundles
implements Initializable

The object representing a resource-based catalog, like VizieR catalogs or database catalogs.


Nested Class Summary
static class StarCatalog.Distance
          For sorting star lists to distance of center.
static class StarCatalog.Test
          A test class.
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
static Map<String,String> ASCCVIZIER
          The properties of the all-sky compiled catalog-VizieR catalog.
static Map<String,String> BSCSERIAL
          The properties of the bright star-serialized catalog.
static Map<String,String> BSCVIZIER
          The properties of the bright star-VizieR catalog.
private static String DEFCATALOGNAME
          The default catalog name.
static double DEFDEOFFSET
          The maximum offset in de in degrees.
static float DEFMAGOFFSET
          The maximum offset in magnitude.
private static String DEFMETHODNAME
          The default retrieval method.
static double DEFPOSITIONERROR
          The default positional error in degrees.
static double DEFRAOFFSET
          The maximum offset in ra*cos(de) in degrees.
static float DEFRESOLVEMAG
          The maximum magnitude for simbad resolving.
private static long DEFRETREIVEBASE
          The default retreive time for the catalog resource.
private static long DEFRETREIVEFIELD
          The default retreive time for the catalog resource.
static Map<String,String> GSC2VIZIER
          The properties of the Guide Star 2-VizieR catalog.
static Map<String,String> GSCVIZIER
          The properties of the Guide Star 1-VizieR catalog.
static Map<String,String> HIPPSERIAL
          The properties of the Hipparchos-VizieR catalog.
static Map<String,String> HIPPVIZIER
          The properties of the Hipparchos-VizieR catalog.
static String KEY_CATALOGNAME
          The user-friendly name of the catalog.
static String KEY_DEOFFSET
          The key to the maximum de-error of the catalog.
static String KEY_MAGOFFSET
          The key to the maximum mag-error of the catalog.
static String KEY_METHODNAME
          The method name in the Resolver class.
static String KEY_POSITIONERROR
          The key to the position error circle radius.
static String KEY_RAOFFSET
          The key to the maximum ra-error of the catalog.
static String KEY_RESOLVEMAG
          The key to the maximum mag allowing for simbad-name resolving.
static String KEY_RETRIEVEBASE
          The key to the times for retreiving the catalogs.
static String KEY_RETRIEVEFIELD
          The key to the times for retreiving the catalogs.
protected static Map<String,Map<String,String>> KNOWNCATALOGS
          A mapping of catalog names to catalog properties.
static Map<String,String> PPMXLVIZIER
           
static Map<String,String> PPMXVIZIER
           
private  Method retrieve
          The method in the Resolver class to invoke.
private  List<StarDescription> stars
          The list of stars as StarDescriptions.
static Map<String,String> TYCHO2VIZIER
          The properties of the Tycho-2 VizieR catalog.
static Map<String,String> UCAC2LOCAL
          The properties of the UCAC2-database catalog.
static Map<String,String> UCAC2VIZIER
          The properties of the UCAC2-VizieR catalog.
static Map<String,String> UCAC3SUPP
          The properties of the UCAC2-VizieR catalog.
static Map<String,String> UCAC3VIZIER
          The properties of the UCAC2-VizieR catalog.
static Map<String,String> UCACSUPPVIZIER
          The properties of the UCAC Supplement-VizieR catalog.
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Constructor Summary
StarCatalog(Map<String,String> prop)
          Constructs a new star catalog.
 
Method Summary
 int commonNames()
          This is an exhaustive search on the simbad service.
static int findClosestEntry(StarDescription guide, List<StarDescription> fov)
          Scans the list of stars for the star that is closest to the supplied center.
static StarCatalog fromName(String catname)
          Creates a catalog from a given name, if this name is known.
 String getCatalogName()
          Returns the name of the catalog.
static Map<String,String> getCatalogProperties(String name)
          Retrieves properties for a star catalog given the name.
 StarDescription getClosestEntry(StarDescription center)
          Finds the star that is closest to the given center in this catalog.
 String getMethodName()
          Returns the method name to use in the Resolver class.
 double getPositionError()
          Returns the maximum positional error expected for this catalog as an error circle radius around a position.
 long getRetrieveTime(double radius)
          Returns the estimated time for resolving the catalog.
 List<StarDescription> getStarList()
          Returns the star list assigned to this catalog.
 void init()
          Inits the star catalog by finding the appropriate method in the Resolver class.
static List<StarDescription> merge(List<StarDescription> main, List<StarDescription> add)
          Matches a list-array of StarDescription to yield a single list with no double entries.
static List<StarDescription> merge(List<StarDescription> main, List<StarDescription> add, double error)
          Matches a list -array of StarDescription to yield a single list with no double entries.
static List<StarDescription> merge(List<StarDescription> main, List<StarDescription> add, double error, float magoff)
          Matches a list of StarDescription to yield a single list with no double entries.
 void merge(StarCatalog other)
          Merges this catalog with another catalog.
 List<StarDescription> retrieveCatalog(StarDescription around, double radius)
          Retrieves the catalog by calling the appropriate static method in the Resolver class.
 void setStarList(List<StarDescription> retrieved)
          Sets the list of stars in this catalog.
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
Methods inherited from class util.PropertyResources
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 

Field Detail

UCAC2LOCAL

public static final Map<String,String> UCAC2LOCAL
The properties of the UCAC2-database catalog.


UCAC2VIZIER

public static final Map<String,String> UCAC2VIZIER
The properties of the UCAC2-VizieR catalog.


UCAC3VIZIER

public static final Map<String,String> UCAC3VIZIER
The properties of the UCAC2-VizieR catalog.


UCAC3SUPP

public static final Map<String,String> UCAC3SUPP
The properties of the UCAC2-VizieR catalog.


BSCVIZIER

public static final Map<String,String> BSCVIZIER
The properties of the bright star-VizieR catalog.


BSCSERIAL

public static final Map<String,String> BSCSERIAL
The properties of the bright star-serialized catalog.


HIPPVIZIER

public static final Map<String,String> HIPPVIZIER
The properties of the Hipparchos-VizieR catalog.


HIPPSERIAL

public static final Map<String,String> HIPPSERIAL
The properties of the Hipparchos-VizieR catalog.


ASCCVIZIER

public static final Map<String,String> ASCCVIZIER
The properties of the all-sky compiled catalog-VizieR catalog.


GSCVIZIER

public static final Map<String,String> GSCVIZIER
The properties of the Guide Star 1-VizieR catalog.


GSC2VIZIER

public static final Map<String,String> GSC2VIZIER
The properties of the Guide Star 2-VizieR catalog.


UCACSUPPVIZIER

public static final Map<String,String> UCACSUPPVIZIER
The properties of the UCAC Supplement-VizieR catalog.


TYCHO2VIZIER

public static final Map<String,String> TYCHO2VIZIER
The properties of the Tycho-2 VizieR catalog.


PPMXVIZIER

public static final Map<String,String> PPMXVIZIER

PPMXLVIZIER

public static final Map<String,String> PPMXLVIZIER

KEY_CATALOGNAME

public static final String KEY_CATALOGNAME
The user-friendly name of the catalog.

See Also:
Constant Field Values

KEY_METHODNAME

public static final String KEY_METHODNAME
The method name in the Resolver class.

See Also:
Constant Field Values

KEY_RAOFFSET

public static final String KEY_RAOFFSET
The key to the maximum ra-error of the catalog.

See Also:
Constant Field Values

KEY_DEOFFSET

public static final String KEY_DEOFFSET
The key to the maximum de-error of the catalog.

See Also:
Constant Field Values

KEY_MAGOFFSET

public static final String KEY_MAGOFFSET
The key to the maximum mag-error of the catalog.

See Also:
Constant Field Values

KEY_POSITIONERROR

public static final String KEY_POSITIONERROR
The key to the position error circle radius.

See Also:
Constant Field Values

KEY_RESOLVEMAG

public static final String KEY_RESOLVEMAG
The key to the maximum mag allowing for simbad-name resolving.

See Also:
Constant Field Values

KEY_RETRIEVEBASE

public static final String KEY_RETRIEVEBASE
The key to the times for retreiving the catalogs.

See Also:
Constant Field Values

KEY_RETRIEVEFIELD

public static final String KEY_RETRIEVEFIELD
The key to the times for retreiving the catalogs.

See Also:
Constant Field Values

DEFCATALOGNAME

private static final String DEFCATALOGNAME
The default catalog name.

See Also:
Constant Field Values

DEFMETHODNAME

private static final String DEFMETHODNAME
The default retrieval method.

See Also:
Constant Field Values

DEFRAOFFSET

public static final double DEFRAOFFSET
The maximum offset in ra*cos(de) in degrees.

See Also:
Constant Field Values

DEFDEOFFSET

public static final double DEFDEOFFSET
The maximum offset in de in degrees.

See Also:
Constant Field Values

DEFMAGOFFSET

public static final float DEFMAGOFFSET
The maximum offset in magnitude. Zero means no bounds.

See Also:
Constant Field Values

DEFPOSITIONERROR

public static final double DEFPOSITIONERROR
The default positional error in degrees.

See Also:
Constant Field Values

DEFRESOLVEMAG

public static final float DEFRESOLVEMAG
The maximum magnitude for simbad resolving.

See Also:
Constant Field Values

DEFRETREIVEBASE

private static final long DEFRETREIVEBASE
The default retreive time for the catalog resource.

See Also:
Constant Field Values

DEFRETREIVEFIELD

private static final long DEFRETREIVEFIELD
The default retreive time for the catalog resource.

See Also:
Constant Field Values

KNOWNCATALOGS

protected static final Map<String,Map<String,String>> KNOWNCATALOGS
A mapping of catalog names to catalog properties.


retrieve

private Method retrieve
The method in the Resolver class to invoke.


stars

private List<StarDescription> stars
The list of stars as StarDescriptions.

Constructor Detail

StarCatalog

public StarCatalog(Map<String,String> prop)
Constructs a new star catalog. The method name and the catalog name must be specified in the properties, otherwise construction fails.

Throws:
IllegalArgumentException - If the name or method are missing.
Method Detail

getCatalogProperties

public static Map<String,String> getCatalogProperties(String name)
Retrieves properties for a star catalog given the name.


fromName

public static StarCatalog fromName(String catname)
Creates a catalog from a given name, if this name is known.


init

public void init()
Inits the star catalog by finding the appropriate method in the Resolver class.

Specified by:
init in interface Initializable
Overrides:
init in class PropertyResources

getCatalogName

public String getCatalogName()
Returns the name of the catalog.


getMethodName

public String getMethodName()
Returns the method name to use in the Resolver class.


getPositionError

public double getPositionError()
Returns the maximum positional error expected for this catalog as an error circle radius around a position.


getRetrieveTime

public long getRetrieveTime(double radius)
Returns the estimated time for resolving the catalog.


retrieveCatalog

public List<StarDescription> retrieveCatalog(StarDescription around,
                                             double radius)
Retrieves the catalog by calling the appropriate static method in the Resolver class.

Returns:
A list of StarDescriptions.

setStarList

public void setStarList(List<StarDescription> retrieved)
Sets the list of stars in this catalog. Use in combination with retrieveCatalog(astro.StarDescription, double).


getStarList

public List<StarDescription> getStarList()
Returns the star list assigned to this catalog. Must be set explicetly before calling this method.


getClosestEntry

public StarDescription getClosestEntry(StarDescription center)
Finds the star that is closest to the given center in this catalog.


findClosestEntry

public static int findClosestEntry(StarDescription guide,
                                   List<StarDescription> fov)
Scans the list of stars for the star that is closest to the supplied center.


merge

public void merge(StarCatalog other)
Merges this catalog with another catalog. Starting from this catalog's star list, we merge the target catalog into this one, updating all necessary fields.


merge

public static List<StarDescription> merge(List<StarDescription> main,
                                          List<StarDescription> add)
Matches a list-array of StarDescription to yield a single list with no double entries.


merge

public static List<StarDescription> merge(List<StarDescription> main,
                                          List<StarDescription> add,
                                          double error)
Matches a list -array of StarDescription to yield a single list with no double entries. The maximum offset in ra/de can be specified.


merge

public static List<StarDescription> merge(List<StarDescription> main,
                                          List<StarDescription> add,
                                          double error,
                                          float magoff)
Matches a list of StarDescription to yield a single list with no double entries. The maximum offset in ra/de and the magnitude can be specified. If matching entries are found, non-defined fields in the StarDescription are updated. Please note that the standard procedure is to match the main list to the following list, i.e. the first list should hold the 'best' entries. We assume that all StarDescriptions in the list are at least marginally valid. The list returned is a new instance.


commonNames

public int commonNames()
This is an exhaustive search on the simbad service. Each star entry found in the catalog's list with a magnitude lesser than KEY_RESOLVEMAG is queried in the GSC 1.2 catalog. If a match is found, the GSC name is used to fetch a more common name in the Simbad name resolving service. If this query is successful, the simbad common name replaces the old star name.

Returns:
The number of updated entries.