net.aerith.misao.catalog.io
Class Tycho2Reader

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

public class Tycho2Reader
extends CatalogReader

The Tycho2Reader is a class to read the Tycho-2 Catalogue file.

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.


Field Summary
protected  CircumArea circum_area
          The circum area to read stars.
protected  int current_file_index
          The index of current file.
protected  int current_plate_index
          The index of current plate.
protected  int current_star_index
          The index of current star.
protected  double decl_end
          The maximum Decl.
protected  double decl_start
          The minimum Decl.
protected  java.io.BufferedReader index_reader
          The input stream reader of index.
protected  double next_decl_end
          The maximum Decl.
protected  double next_decl_start
          The minimum Decl.
protected  double next_ra_end
          The maximum R.A.
protected  double next_ra_start
          The minimum R.A.
protected  double ra_end
          The maximum R.A.
protected  double ra_start
          The minimum R.A.
protected  int read_star_index
          The index of already read star.
protected  int star_index_end
          The end index of stars in the current plate.
protected  int star_index_start
          The start index of stars in the current plate.
protected  java.io.DataInputStream stream
          The input stream to read stars.
 
Fields inherited from class net.aerith.misao.catalog.io.CatalogReader
center_coor, date, limiting_mag, url_set
 
Constructor Summary
Tycho2Reader()
          Constructs an empty Tycho2Reader.
Tycho2Reader(java.net.URL url)
          Constructs a Tycho2Reader with URL of the catalog file.
 
Method Summary
 void close()
          Closes a catalog.
 java.lang.String getHelpMessage()
          Gets the help message.
 double getMaximumPositionErrorInArcsec()
          Gets the maximum error of position in arcsec.
 java.lang.String getName()
          Gets the catalog name.
 boolean isInDirectory()
          Checks if the catalog data is in a directory.
 void open(Coor coor, double fov)
          Opens a catalog.
private  java.io.DataInputStream openDataFile(int file_number)
          Opens the star data file.
 CatalogStar readNext()
          Reads one star from the opened catalog.
 boolean supportsExamination()
          Checks if the catalog supports the use in PIXY examination.
 
Methods inherited from class net.aerith.misao.catalog.io.CatalogReader
addURL, getDateLimit, getDateLimitMessage, getFovLimit, getFovLimitMessage, hasDateLimit, hasFovLimit, isDateDependent, isFile, open, read, setDate, setDefaultURL, setLimitingMagnitude
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

circum_area

protected CircumArea circum_area
The circum area to read stars.

index_reader

protected java.io.BufferedReader index_reader
The input stream reader of index.

stream

protected java.io.DataInputStream stream
The input stream to read stars.

current_file_index

protected int current_file_index
The index of current file.

current_plate_index

protected int current_plate_index
The index of current plate.

current_star_index

protected int current_star_index
The index of current star.

read_star_index

protected int read_star_index
The index of already read star.

star_index_start

protected int star_index_start
The start index of stars in the current plate.

star_index_end

protected int star_index_end
The end index of stars in the current plate.

ra_start

protected double ra_start
The minimum R.A. of the current plate.

ra_end

protected double ra_end
The maximum R.A. of the current plate.

decl_start

protected double decl_start
The minimum Decl. of the current plate.

decl_end

protected double decl_end
The maximum Decl. of the current plate.

next_ra_start

protected double next_ra_start
The minimum R.A. of the next plate.

next_ra_end

protected double next_ra_end
The maximum R.A. of the next plate.

next_decl_start

protected double next_decl_start
The minimum Decl. of the next plate.

next_decl_end

protected double next_decl_end
The maximum Decl. of the next plate.
Constructor Detail

Tycho2Reader

public Tycho2Reader()
Constructs an empty Tycho2Reader.

Tycho2Reader

public Tycho2Reader(java.net.URL url)
Constructs a Tycho2Reader with URL of the catalog file.
Parameters:
url - the URL of the catalog file.
Method Detail

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.

isInDirectory

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

supportsExamination

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

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.

getHelpMessage

public java.lang.String getHelpMessage()
Gets the help message.
Overrides:
getHelpMessage in class CatalogReader
Returns:
the help message.

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.

openDataFile

private java.io.DataInputStream openDataFile(int file_number)
                                      throws java.io.IOException
Opens the star data file.
Parameters:
file_number - the file number.
Returns:
the input stream.
Throws:
java.io.IOException - if a file cannot be accessed.