net.aerith.misao.catalog.io
Class CatalogReader

java.lang.Object
  |
  +--net.aerith.misao.catalog.io.CatalogReader
Direct Known Subclasses:
Ac2000Reader, CatalogDBReader, FileReader, Gsc11Reader, MinorPlanetCheckerReader, StarListReader, TicReader, Tycho2Reader, TychoSeparatedReader, Ucac1Reader, UsnoAReader, VizieRUsnoAReader

public abstract class CatalogReader
extends java.lang.Object

The CatalogReader is an abstract class of catalog reader.

R.A. and Decl. of the center, and field of view are required. In order to read all stars in the specified area, invoke read method. In order to read stars in the specified area one by one, invoke open method at first, then invoke readNext method repeatedly until it returns null. Finally invoke close method.

The (x,y) position must be 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.


Field Summary
protected  Coor center_coor
          The R.A.
protected  JulianDay date
          The date.
protected  double limiting_mag
          The limiting magnitude to read.
protected  URLSet url_set
          The set of urls where to read data.
 
Constructor Summary
CatalogReader()
           
 
Method Summary
 void addURL(java.net.URL new_url)
          Adds URL where to read data.
abstract  void close()
          Closes a catalog.
 double getDateLimit()
          Gets the limit on the date.
 java.lang.String getDateLimitMessage()
          Gets the message for limit on the date.
 double getFovLimit()
          Gets the limit on the field of view.
 java.lang.String getFovLimitMessage()
          Gets the message for limit on the field of view.
 java.lang.String getHelpMessage()
          Gets the help message.
 double getMaximumPositionErrorInArcsec()
          Gets the maximum error of position in arcsec.
abstract  java.lang.String getName()
          Gets the catalog name.
 boolean hasDateLimit()
          Returns true if the reader has limit on the date.
 boolean hasFovLimit()
          Returns true if the reader has limit on the field of view.
 boolean isDateDependent()
          Checks if the catalog depends on the date.
 boolean isFile()
          Checks if the catalog data is a file.
 boolean isInDirectory()
          Checks if the catalog data is in a directory.
 void open()
          Opens a catalog to read all star data.
abstract  void open(Coor coor, double fov)
          Opens a catalog.
 CatalogStarList read(Coor coor, double fov)
          Reads all star data in the specified area.
abstract  CatalogStar readNext()
          Reads one star from the opened catalog.
 void setDate(JulianDay date)
          Sets the date.
protected  void setDefaultURL()
          Sets the default catalog path.
 void setLimitingMagnitude(double new_limiting_mag)
          Sets the limiting magnitude to read.
 boolean supportsExamination()
          Checks if the catalog supports the use in PIXY examination.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

url_set

protected URLSet url_set
The set of urls where to read data. In principle, one URL is set in the constructor.

center_coor

protected Coor center_coor
The R.A. and Decl. of the center to read.

limiting_mag

protected double limiting_mag
The limiting magnitude to read.

date

protected JulianDay date
The date.
Constructor Detail

CatalogReader

public CatalogReader()
Method Detail

setDefaultURL

protected void setDefaultURL()
Sets the default catalog path. This method must be invoked in the constructor of the subclasses.

addURL

public void addURL(java.net.URL new_url)
Adds URL where to read data.
Parameters:
new_url - the new URL to read data.

getName

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

isInDirectory

public boolean isInDirectory()
Checks if the catalog data is in a directory.
Returns:
true if the catalog data is in a directory.

isFile

public boolean isFile()
Checks if the catalog data is a file.
Returns:
true if the catalog data is a file.

supportsExamination

public boolean supportsExamination()
Checks if the catalog supports the use in PIXY examination.
Returns:
true if the catalog can be used in PIXY examination.

isDateDependent

public boolean isDateDependent()
Checks if the catalog depends on the date.
Returns:
true if the catalog depends on the date.

setDate

public void setDate(JulianDay date)
Sets the date.
Parameters:
date - the date.

hasFovLimit

public boolean hasFovLimit()
Returns true if the reader has limit on the field of view.
Returns:
true if the reader has limit on the field of view.

getFovLimit

public double getFovLimit()
Gets the limit on the field of view.
Returns:
the limit on the field of view in degree.

getFovLimitMessage

public java.lang.String getFovLimitMessage()
Gets the message for limit on the field of view.
Returns:
the message for limit on the field of view.

hasDateLimit

public boolean hasDateLimit()
Returns true if the reader has limit on the date.
Returns:
true if the reader has limit on the date.

getDateLimit

public double getDateLimit()
Gets the limit on the date.
Returns:
the limit on the date in day.

getDateLimitMessage

public java.lang.String getDateLimitMessage()
Gets the message for limit on the date.
Returns:
the message for limit on the date.

getMaximumPositionErrorInArcsec

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

getHelpMessage

public java.lang.String getHelpMessage()
Gets the help message.
Returns:
the help message.

setLimitingMagnitude

public void setLimitingMagnitude(double new_limiting_mag)
Sets the limiting magnitude to read.
Parameters:
new_limiting_mag - the new limiting magnitude.

open

public void open()
          throws java.io.IOException,
                 java.io.FileNotFoundException,
                 CdromNotFoundException
Opens a catalog to read all star data. This method must be invoked at first.
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.

open

public abstract void open(Coor coor,
                          double fov)
                   throws java.io.IOException,
                          java.io.FileNotFoundException,
                          CdromNotFoundException
Opens a catalog. This method must be invoked at first.
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 abstract 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.
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 abstract void close()
                    throws java.io.IOException
Closes a catalog. This method must be invoked finally.
Throws:
java.io.IOException - if a file cannot be accessed.

read

public CatalogStarList read(Coor coor,
                            double fov)
                     throws java.io.IOException,
                            java.io.FileNotFoundException,
                            CdromNotFoundException,
                            QueryFailException
Reads all star data in the specified area.
Parameters:
coor - the R.A. and Decl. of the center.
fov - the field of view to read in degree.
Returns:
the list of stars in the specified area.
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.