net.aerith.misao.catalog.io
Class StarListReader

java.lang.Object
  |
  +--net.aerith.misao.catalog.io.CatalogReader
        |
        +--net.aerith.misao.catalog.io.StarListReader

public class StarListReader
extends CatalogReader

The StarListReader is a class to keep the list of catalog stars and read stars from the list.

The (x,y) position is also set properly so that (0,0) represents the specified R.A. and Decl. to open method and (1,1) represents the position 1 deg to the west and 1 deg to the north.

Note that it does not clone the star objects. So the star object obtained by the read() or readNext() method should not be modified.


Field Summary
protected  int current_index
          The current index.
protected  double fov_in_degree
          The field of view in degree.
protected  java.util.Vector list
          The list of stars.
protected  double maximum_error_in_arcsec
          The maximum error of position in arcsec.
 
Fields inherited from class net.aerith.misao.catalog.io.CatalogReader
center_coor, date, limiting_mag, url_set
 
Constructor Summary
StarListReader()
          Constructs a StarListReader.
 
Method Summary
 void addStar(CatalogStar star)
          Adds a star.
 void close()
          Closes a catalog.
 double getMaximumPositionErrorInArcsec()
          Gets the maximum error of position in arcsec.
 java.lang.String getName()
          Gets the catalog name.
 void open(Coor coor, double fov)
          Opens a catalog.
 CatalogStar readNext()
          Reads one star from the opened catalog.
 
Methods inherited from class net.aerith.misao.catalog.io.CatalogReader
addURL, getDateLimit, getDateLimitMessage, getFovLimit, getFovLimitMessage, getHelpMessage, hasDateLimit, hasFovLimit, isDateDependent, isFile, isInDirectory, open, read, setDate, setDefaultURL, setLimitingMagnitude, supportsExamination
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

list

protected java.util.Vector list
The list of stars.

maximum_error_in_arcsec

protected double maximum_error_in_arcsec
The maximum error of position in arcsec.

fov_in_degree

protected double fov_in_degree
The field of view in degree.

current_index

protected int current_index
The current index.
Constructor Detail

StarListReader

public StarListReader()
Constructs a StarListReader.
Method Detail

addStar

public void addStar(CatalogStar star)
Adds a star.
Parameters:
star - the star to add.

getName

public java.lang.String getName()
Gets the catalog name. It must be unique among all subclasses.
Overrides:
getName in class CatalogReader
Returns:
the catalog name.

getMaximumPositionErrorInArcsec

public double getMaximumPositionErrorInArcsec()
Gets the maximum error of position in arcsec. It is the search area size to identify with other stars.
Overrides:
getMaximumPositionErrorInArcsec in class CatalogReader
Returns:
the maximum error of position in arcsec.

open

public void open(Coor coor,
                 double fov)
          throws java.io.IOException,
                 java.io.FileNotFoundException,
                 CdromNotFoundException
Opens a catalog. This method must be invoked at first.
Overrides:
open in class CatalogReader
Parameters:
coor - the R.A. and Decl. of the center.
fov - the field of view to read in degree.
Throws:
java.io.IOException - if a file cannot be accessed.
java.io.FileNotFoundException - if a file does not exists in any URL.
CdromNotFoundException - if this reader is to read data from CD-ROMs and a file does not exists in any URL.

readNext

public CatalogStar readNext()
                     throws java.io.IOException,
                            java.io.FileNotFoundException,
                            CdromNotFoundException,
                            QueryFailException
Reads one star from the opened catalog. After this method is invoked, the cursor is promoted to tne next star. When every data is read, it returns null.
Overrides:
readNext in class CatalogReader
Returns:
a star data.
Throws:
java.io.IOException - if a file cannot be accessed.
java.io.FileNotFoundException - if a file does not exists in any URL.
CdromNotFoundException - if this reader is to read data from CD-ROMs and a file does not exists in any URL.
QueryFailException - if the query to the server is failed.

close

public void close()
           throws java.io.IOException
Closes a catalog. This method must be invoked finally.
Overrides:
close in class CatalogReader
Throws:
java.io.IOException - if a file cannot be accessed.