public class TargetSql extends AbstractSql
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 TargetSql.Xml
, querying for an existing entry can be done with the resolve(java.lang.String)
method.
| Modifier and Type | Class and Description |
|---|---|
static class |
TargetSql.Lookup
Takes the star name on the command line and see if it is present in the
database.
|
static class |
TargetSql.Resolve
Resolves the star on the command line.
|
static class |
TargetSql.Tables |
static class |
TargetSql.Teff |
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.
|
AbstractSql.Columns, AbstractSql.ExtractPropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
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.
|
KEY_TABLE, SQLBATCHDIR, SQLFAILDIRKEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOMECONFIG, KEY_CLASS| Constructor and Description |
|---|
TargetSql(Map<String,String> prop)
Sets the properties of the history database and adds my defaults.
|
| Modifier and Type | Method and Description |
|---|---|
private Star |
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.
|
List<Star> |
getAllStars()
Retrieves all stars in the target db, no distinction between STELLA1 or
STELLA2 possible.
|
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(Star simbad)
Takes a star and pushes it into the db.
|
static Star |
resolve(String name)
Takes a star name and tries to fill up database values from various
simbad catalogs.
|
private Star |
retrieveRow(ResultSet single,
String simbad,
String common) |
Star |
retrieveStar(String simbad)
Takes a star name and retrieves the info in the target database with the
given objname entry.
|
Star |
retrieveUnique(String simbad)
Takes a star name and retrieves the info in the target database.
|
protected boolean |
update(Star update)
Updates a star entry.
|
delete, distinct, distinct, exit, getAccess, getDefaultArchive, getDefaultFormat, getTable, init, insert, isEntry, release, release, replace, retrieve, retrieve, retrieve, single, singleclone, createFrom, createFrom, createFrom, createInstance, getApplet, getAsResources, getLocate, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, hasLocalURLs, initProperties, keyCreate, keyCreate, reload, setAppletaugment, augment, 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, parseObject, reload, removeProperty, requires, rescanned, setObject, setProperties, setProperty, stringProperties, toStringequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdefaultBoolean, 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, stringPropertiespublic 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
public Star retrieveUnique(String simbad)
SqlStar object is constructed and all
the relevant information is filled into it.simbad - A simbad-resolvable name.public Star retrieveStar(String simbad)
public List<Star> getAllStars()
private Star fromNextRow(ResultSet single, String simbad, String common) throws SQLException
simbad - A name for simbad-resolvable name, not-nullcommon - A name for simbad-preferred name.SQLExceptionprivate Star retrieveRow(ResultSet single, String simbad, String common) throws SQLException
SQLExceptionprotected boolean update(Star update)
public boolean push(Star simbad)
public static Star resolve(String name)
private static final int parseClass(String prim, String sec)
private static final int parseLuminosity(String lum)