|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
mysql.AbstractSql
mysql.TargetSql
public class TargetSql
A class that allows static access to a database containing astrophysical properties of stars. In the default setup, the table of this database is called 'target' and has the following structure:
CREATE TABLE "target" (
"objname" varchar(255) NOT NULL,
"simbad" varchar(255) UNIQUE,
"objra" real,
"objdec" real,
"objpmra" real,
"objpmdec" real,
"objequin" real,
"typ" integer,
"sptype" varchar(255),
"sptyp1" integer,
"sptyp2" integer,
"vhelio" real,
"vsini" real,
"v" real,
"vminusr" real,
"bminusv" real,
"period" real,
"parallax" real,
"objtype" varchar(255),
"sb" integer,
"z" real,
"mass" real,
"logg" real,
"teff" real,
"orbit" double precision[],
"option" double precision[],
"history" character varying(10000)
Constraint "target_pkey" Primary Key ("objname")
);
GRANT ALL on "target" to "postgres";
GRANT ALL on "target" to "stella";
GRANT SELECT on "target" to "guest";
In this setup, the columns have the following meanings:
Loading the database can be done by passing an target-xml file to
Load, querying for an existing entry can be done with the
#query method.
| Nested Class Summary | |
|---|---|
static class |
TargetSql.Lookup
Takes the star name on the command line and see if it is present in the database. |
static class |
TargetSql.Panel
We read all entries from the database and construct info panels for it. |
static class |
TargetSql.Resolve
Resolves the star on the command line. |
static class |
TargetSql.StarSql
A class that extends a StarDescription to host additional info
relevant for stellar activity. |
static class |
TargetSql.Xml
Reads an xml file and gets the main star out of it. |
static class |
TargetSql.XmlUpdate
Reads an xml file and gets the main star out of it. |
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private static String |
DEFBVFIELD
The key to the B-V color in the database. |
private static String |
DEFDEFIELD
The key to the object ra in the database. |
private static String |
DEFEQUINOXFIELD
The key to the object type id in the database. |
private static String |
DEFHISTORYFIELD
The key to the metalicity real in the database. |
private static String |
DEFLOGGFIELD
The key to the metalicity real in the database. |
private static String |
DEFMASSFIELD
The key to the metalicity real in the database. |
private static String |
DEFMETALFIELD
The key to the metalicity real in the database. |
private static String |
DEFOBJECTNAMEFIELD
The key to the object name in the database. |
private static String |
DEFOBJECTTYPEFIELD
The key to the object type description in the database. |
private static String |
DEFOPTIONFIELD
The key to the metalicity real in the database. |
private static String |
DEFORBITFIELD
The key to the metalicity real in the database. |
private static String |
DEFPARALLAXFIELD
The key to the parallax in the database. |
private static String |
DEFPERIODFIELD
The key to the period in the database. |
private static String |
DEFPMDEFIELD
The key to the object ra in the database. |
private static String |
DEFPMRAFIELD
The key to the object ra in the database. |
private static String |
DEFRAFIELD
The key to the object ra in the database. |
private static String |
DEFSBFIELD
The key to the binarity integer in the database. |
private static String |
DEFSIMBADFIELD
The key to the simbad name in the database. |
private static String |
DEFSPTYPE1FIELD
The key to the spectral type integer in the database. |
private static String |
DEFSPTYPE2FIELD
The key to the luminosity integer in the database. |
private static String |
DEFSPTYPEFIELD
The key to the spectral type in the database. |
private static String |
DEFTABLE
The default table name. |
private static String |
DEFTEFFFIELD
The key to the metalicity real in the database. |
private static String |
DEFTYPFIELD
The key to the object type id in the database. |
private static String |
DEFVHELIOFIELD
The key to the heliocentric radial velocity in the database. |
private static String |
DEFVMAGFIELD
The key to the V magnitude in the database. |
private static String |
DEFVRFIELD
The key to the V-R color in the database. |
private static String |
DEFVSINIFIELD
The key to the rotational velocity in the database. |
static String |
KEY_BVFIELD
The key to the B-V color in the database. |
static String |
KEY_DEFIELD
The key to the object ra id in the database. |
static String |
KEY_EQUINOXFIELD
The key to the object type id in the database. |
static String |
KEY_HISTORYFIELD
The key to the metalicity real in the database. |
static String |
KEY_LOGGFIELD
The key to the metalicity real in the database. |
static String |
KEY_MASSFIELD
The key to the metalicity real in the database. |
static String |
KEY_METALFIELD
The key to the metalicity real in the database. |
static String |
KEY_OBJECTNAMEFIELD
The key to the object name in the database. |
static String |
KEY_OBJECTTYPEFIELD
The key to the object type description in the database. |
static String |
KEY_OPTIONFIELD
The key to the metalicity real in the database. |
static String |
KEY_ORBITFIELD
The key to the metalicity real in the database. |
static String |
KEY_PARALLAXFIELD
The key to the parallax in the database. |
static String |
KEY_PERIODFIELD
The key to the period in the database. |
static String |
KEY_PMDEFIELD
The key to the object ra id in the database. |
static String |
KEY_PMRAFIELD
The key to the object ra id in the database. |
static String |
KEY_RAFIELD
The key to the object ra id in the database. |
static String |
KEY_SBFIELD
The key to the binarity integer in the database. |
static String |
KEY_SIMBADFIELD
The key to the simbad name in the database. |
static String |
KEY_SPTYPE1FIELD
The key to the spectral type integer in the database. |
static String |
KEY_SPTYPE2FIELD
The key to the luminosity integer in the database. |
static String |
KEY_SPTYPEFIELD
The key to the spectral type in the database. |
static String |
KEY_TEFFFIELD
The key to the metalicity real in the database. |
static String |
KEY_TYPFIELD
The key to the object type id in the database. |
static String |
KEY_VHELIOFIELD
The key to the heliocentric radial velocity in the database. |
static String |
KEY_VMAGFIELD
The key to the V magnitude in the database. |
static String |
KEY_VRFIELD
The key to the V-R color in the database. |
static String |
KEY_VSINIFIELD
The key to the rotational velocity in the database. |
static List<String> |
NOLOOKUP
These are currently known types that are NOT for stellar lookup. |
private static String[] |
TABLEIDS
These are the corresponding table ids |
private static double[] |
TABLERADIUS
These are the search radii in arcmin. |
private static String[] |
TABLES
These are the vizier catalogs to query, plus radii and IDs. |
private static String[] |
TFIELDS
Teff, logT, theta field names of thoses catalogs. |
| Fields inherited from class mysql.AbstractSql |
|---|
KEY_TABLE |
| 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 | |
|---|---|
TargetSql(Map<String,String> prop)
Sets the properties of the history database and adds my defaults. |
|
| Method Summary | |
|---|---|
private StarDescription |
fromNextRow(ResultSet single,
String simbad,
String common)
Takes a result set, advancec it to the next row and tries to parse a star out of the returns. |
private static int |
parseClass(String prim,
String sec)
Parses a primary spectral class like OBAFGKM and a secondary spectral class like 0123456789 into an integer by 10*(OBAFGKM)+sec. |
private static int |
parseLuminosity(String lum)
Parses a luminosity class. |
boolean |
push(StarDescription simbad)
Takes a star and pushes it into the db. |
static StarDescription |
resolve(String name)
Takes a star name and tries to fill up database values from various simbad catalogs. |
StarDescription |
retrieveStar(String simbad)
Takes a star name and retrieves the info in the target database with the given objname entry. |
StarDescription |
retrieveUnique(String simbad)
Takes a star name and retrieves the info in the target database. |
protected boolean |
update(StarDescription update)
Updates a star entry. |
| Methods inherited from class mysql.AbstractSql |
|---|
getPassword, getTable, getUserName, init, isEntry |
| 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 |
|---|
public static final List<String> NOLOOKUP
public static final String KEY_OBJECTNAMEFIELD
public static final String KEY_SIMBADFIELD
public static final String KEY_TYPFIELD
public static final String KEY_EQUINOXFIELD
public static final String KEY_RAFIELD
public static final String KEY_DEFIELD
public static final String KEY_PMRAFIELD
public static final String KEY_PMDEFIELD
public static final String KEY_SPTYPEFIELD
public static final String KEY_SPTYPE1FIELD
public static final String KEY_SPTYPE2FIELD
public static final String KEY_VHELIOFIELD
public static final String KEY_VSINIFIELD
public static final String KEY_VMAGFIELD
public static final String KEY_BVFIELD
public static final String KEY_VRFIELD
public static final String KEY_PERIODFIELD
public static final String KEY_PARALLAXFIELD
public static final String KEY_OBJECTTYPEFIELD
public static final String KEY_SBFIELD
public static final String KEY_METALFIELD
public static final String KEY_MASSFIELD
public static final String KEY_LOGGFIELD
public static final String KEY_TEFFFIELD
public static final String KEY_ORBITFIELD
public static final String KEY_OPTIONFIELD
public static final String KEY_HISTORYFIELD
private static final String DEFTABLE
private static final String DEFOBJECTNAMEFIELD
private static final String DEFSIMBADFIELD
private static final String DEFTYPFIELD
private static final String DEFEQUINOXFIELD
private static final String DEFRAFIELD
private static final String DEFDEFIELD
private static final String DEFPMRAFIELD
private static final String DEFPMDEFIELD
private static final String DEFSPTYPEFIELD
private static final String DEFSPTYPE1FIELD
private static final String DEFSPTYPE2FIELD
private static final String DEFVHELIOFIELD
private static final String DEFVSINIFIELD
private static final String DEFVMAGFIELD
private static final String DEFBVFIELD
private static final String DEFVRFIELD
private static final String DEFPERIODFIELD
private static final String DEFPARALLAXFIELD
private static final String DEFOBJECTTYPEFIELD
private static final String DEFSBFIELD
private static final String DEFMETALFIELD
private static final String DEFMASSFIELD
private static final String DEFLOGGFIELD
private static final String DEFTEFFFIELD
private static final String DEFORBITFIELD
private static final String DEFOPTIONFIELD
private static final String DEFHISTORYFIELD
private static final String[] TABLES
private static final String[] TABLEIDS
private static final String[] TFIELDS
private static final double[] TABLERADIUS
| Constructor Detail |
|---|
public TargetSql(Map<String,String> prop)
| Method Detail |
|---|
public StarDescription retrieveUnique(String simbad)
TargetSql.StarSql object is constructed and all
the relevant information is filled into it.
simbad - A simbad-resolvable name.public StarDescription retrieveStar(String simbad)
private StarDescription fromNextRow(ResultSet single,
String simbad,
String common)
throws SQLException
simbad - A name for simbad-resolvable name, not-nullcommon - A name for simbad-preferred name.
SQLExceptionprotected boolean update(StarDescription update)
public boolean push(StarDescription simbad)
public static StarDescription resolve(String name)
private static final int parseClass(String prim,
String sec)
private static final int parseLuminosity(String lum)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||