astro
Class AsciiCatalog

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

public class AsciiCatalog
extends PropertyBundles

This class reads an ascii-file and parses it to a list of star description. If any of the property keys is set, it corresponds to the column number and the length of the field. Each key should point to a pair of integers, the first giving the starting column, second the ending column (exclusive), or the length of the field, if the second number is negative. If no second int is given, the remainder of the string is used.

The standard fortran format used in most CDS descriptions differ from the normal column assignment. Subtract one from the starting column, leave ending column as-is.


Nested Class Summary
static class AsciiCatalog.BJG2004
          Reads the stromgren catalog of NGC 1807 and 1817.
static class AsciiCatalog.FieldBy
          Reads the stromgren catalog of NGC 1807 and 1817.
static class AsciiCatalog.FieldC1
          Reads the stromgren catalog of NGC 1807 and 1817.
static class AsciiCatalog.FieldM1
          Reads the stromgren catalog of NGC 1807 and 1817.
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
static String KEY_COLOR
          The column number starting at zero that has the magnitude.
static String KEY_DE
          The column number starting at zero that has the de (decimal)e star.
static String KEY_DEDEG
          The column number starting at zero that has the de(deg) of the star.
static String KEY_DEMIN
          The column number starting at zero that has the de(min) of the star.
static String KEY_DESEC
          The column number starting at zero that has the de(sec) of the star.
static String KEY_ID
          The column number starting at zero that has the magnitude.
static String KEY_INVALID
          This key points to data that is marked invalid.
static String KEY_MAG
          The column number starting at zero that has the magnitude.
static String KEY_NAME
          The column number starting at zero that has the magnitude.
static String KEY_PMDE
          Propert motion in ra, mas/year.
static String KEY_PMRA
          Propert motion in ra, mas/year.
static String KEY_RADEG
          The column number starting at zero that has the ra(deg) of the star.
static String KEY_RAHOUR
          The column number starting at zero that has the ra hour of the star.
static String KEY_RAMIN
          The column number starting at zero that has the ra hour of the star.
static String KEY_RASEC
          The column number starting at zero that has the ra hour of the star.
 
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
AsciiCatalog(Map<String,String> info)
          Constructs a new ascii-catalog, no defaults.
 
Method Summary
private  String extract(String line, int[] be)
          Extracts a string from a line.
private  Double extractDouble(String line, String key)
           
private  Float extractFloat(String line, String key)
           
private static int[] getColumns(String pair)
          Returns an integer of beginning and end index for substring extraction.
 List<StarDescription> parseFile(File f)
          Reads a file and parses it into a list of star descriptions.
private  StarDescription parseLine(String line)
          Parses a single line.
static GeneralLinearRegression solve(List<VectorG> zxy)
          Solver for z = a1*x+a2*y+a3.
static GeneralLinearRegression solve0(List<VectorG> zxy)
          Solver for z = a1*x+a2*y+a3.
static GeneralLinearRegression solve2(List<VectorG> zxy)
          Solver for z = a1*x+a2*y+a3*y^2+a4.
static boolean wcsExport(List<StarDescription> asc, File f)
          Exports the catalog as a tab column file suitable for WCS tools.
 
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, init, 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
 
Methods inherited from interface util.Initializable
init
 

Field Detail

KEY_NAME

public static final String KEY_NAME
The column number starting at zero that has the magnitude.

See Also:
Constant Field Values

KEY_ID

public static final String KEY_ID
The column number starting at zero that has the magnitude.

See Also:
Constant Field Values

KEY_RADEG

public static final String KEY_RADEG
The column number starting at zero that has the ra(deg) of the star.

See Also:
Constant Field Values

KEY_RAHOUR

public static final String KEY_RAHOUR
The column number starting at zero that has the ra hour of the star.

See Also:
Constant Field Values

KEY_RAMIN

public static final String KEY_RAMIN
The column number starting at zero that has the ra hour of the star.

See Also:
Constant Field Values

KEY_RASEC

public static final String KEY_RASEC
The column number starting at zero that has the ra hour of the star.

See Also:
Constant Field Values

KEY_DE

public static final String KEY_DE
The column number starting at zero that has the de (decimal)e star.

See Also:
Constant Field Values

KEY_DEDEG

public static final String KEY_DEDEG
The column number starting at zero that has the de(deg) of the star.

See Also:
Constant Field Values

KEY_DEMIN

public static final String KEY_DEMIN
The column number starting at zero that has the de(min) of the star.

See Also:
Constant Field Values

KEY_DESEC

public static final String KEY_DESEC
The column number starting at zero that has the de(sec) of the star.

See Also:
Constant Field Values

KEY_MAG

public static final String KEY_MAG
The column number starting at zero that has the magnitude.

See Also:
Constant Field Values

KEY_COLOR

public static final String KEY_COLOR
The column number starting at zero that has the magnitude.

See Also:
Constant Field Values

KEY_PMRA

public static final String KEY_PMRA
Propert motion in ra, mas/year.

See Also:
Constant Field Values

KEY_PMDE

public static final String KEY_PMDE
Propert motion in ra, mas/year.

See Also:
Constant Field Values

KEY_INVALID

public static final String KEY_INVALID
This key points to data that is marked invalid.

See Also:
Constant Field Values
Constructor Detail

AsciiCatalog

public AsciiCatalog(Map<String,String> info)
Constructs a new ascii-catalog, no defaults.

Method Detail

parseFile

public List<StarDescription> parseFile(File f)
Reads a file and parses it into a list of star descriptions.


parseLine

private StarDescription parseLine(String line)
Parses a single line.


extractDouble

private Double extractDouble(String line,
                             String key)

extractFloat

private Float extractFloat(String line,
                           String key)

getColumns

private static int[] getColumns(String pair)
Returns an integer of beginning and end index for substring extraction. if returned array has only one index, remainder of string should be used.


extract

private String extract(String line,
                       int[] be)
Extracts a string from a line. If this string equals the invalid string, return null.


wcsExport

public static boolean wcsExport(List<StarDescription> asc,
                                File f)
                         throws IOException
Exports the catalog as a tab column file suitable for WCS tools.

Throws:
IOException

solve0

public static GeneralLinearRegression solve0(List<VectorG> zxy)
Solver for z = a1*x+a2*y+a3.


solve

public static GeneralLinearRegression solve(List<VectorG> zxy)
Solver for z = a1*x+a2*y+a3.


solve2

public static GeneralLinearRegression solve2(List<VectorG> zxy)
Solver for z = a1*x+a2*y+a3*y^2+a4.