net.aerith.misao.catalog.io
Class UsnoAReader

java.lang.Object
  |
  +--net.aerith.misao.catalog.io.CatalogReader
        |
        +--net.aerith.misao.catalog.io.UsnoAReader
Direct Known Subclasses:
UsnoA10Reader, UsnoA20Reader

public abstract class UsnoAReader
extends CatalogReader

The UsnoAReader is a class to read USNO-A1.0/A2.0 CD-ROMs.

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 static int buffer_size
          The buffer size to read data at one time.
protected  CircumArea circum_area
          The circum area to read stars.
protected  int current_block_index
          The index of block in the current file.
protected  int current_block_size
          The size of current block.
protected  int current_buffer_count
          The number of buffers to read current block.
protected  int current_buffer_index
          The index of buffer in the current block.
protected  int current_data_index
          The index of data in the current buffer.
protected  Coor current_end_coor
          The R.A.
protected  int current_file_index
          The index of current file.
protected  int current_star_index
          The index of star in the current file.
protected  Coor current_start_coor
          The R.A.
protected  java.io.DataInputStream current_stream_acc
          The current input stream of ACC file.
protected  java.io.DataInputStream current_stream_cat
          The current input stream of CAT file.
protected  byte[] data_buffer
          The buffer to read data.
 
Fields inherited from class net.aerith.misao.catalog.io.CatalogReader
center_coor, date, limiting_mag, url_set
 
Constructor Summary
UsnoAReader()
           
 
Method Summary
 void close()
          Closes a catalog.
protected abstract  UsnoAStar createStar(short file_number, int star_number, Coor coor, boolean valid_R_mag, short R_mag10, boolean valid_B_mag, short B_mag10, double V_mag)
          Creates a UsnoAStar object based on the specified parameters.
protected abstract  int getDiscNumber(int index)
          Gets the disc number of the specified index.
protected abstract  int getFileNumber(int index)
          Gets the file number of the specified index.
 double getMaximumPositionErrorInArcsec()
          Gets the maximum error of position in arcsec.
protected abstract  int getNumberOfFiles()
          Gets the number of files.
 void open(Coor coor, double fov)
          Opens a catalog.
 CatalogStar readNext()
          Reads one data from the opened catalog.
 
Methods inherited from class net.aerith.misao.catalog.io.CatalogReader
addURL, getDateLimit, getDateLimitMessage, getFovLimit, getFovLimitMessage, getHelpMessage, getName, 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

buffer_size

protected static final int buffer_size
The buffer size to read data at one time.

circum_area

protected CircumArea circum_area
The circum area to read stars.

current_stream_acc

protected java.io.DataInputStream current_stream_acc
The current input stream of ACC file.

current_stream_cat

protected java.io.DataInputStream current_stream_cat
The current input stream of CAT file.

data_buffer

protected byte[] data_buffer
The buffer to read data.

current_file_index

protected int current_file_index
The index of current file.

current_block_index

protected int current_block_index
The index of block in the current file.

current_block_size

protected int current_block_size
The size of current block.

current_buffer_index

protected int current_buffer_index
The index of buffer in the current block.

current_buffer_count

protected int current_buffer_count
The number of buffers to read current block.

current_data_index

protected int current_data_index
The index of data in the current buffer.

current_star_index

protected int current_star_index
The index of star in the current file.

current_start_coor

protected Coor current_start_coor
The R.A. and Decl. at the south west corner of an area to read.

current_end_coor

protected Coor current_end_coor
The R.A. and Decl. at the north east corner of an area to read.
Constructor Detail

UsnoAReader

public UsnoAReader()
Method Detail

getNumberOfFiles

protected abstract int getNumberOfFiles()
Gets the number of files. It must be overrided in the subclasses.
Returns:
the number of files.

getFileNumber

protected abstract int getFileNumber(int index)
Gets the file number of the specified index. It must be overrided in the subclasses.
Parameters:
index - the index.
Returns:
the file number.

getDiscNumber

protected abstract int getDiscNumber(int index)
Gets the disc number of the specified index. It must be overrided in the subclasses.
Parameters:
index - the index.
Returns:
the disc number.

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.

createStar

protected abstract UsnoAStar createStar(short file_number,
                                        int star_number,
                                        Coor coor,
                                        boolean valid_R_mag,
                                        short R_mag10,
                                        boolean valid_B_mag,
                                        short B_mag10,
                                        double V_mag)
Creates a UsnoAStar object based on the specified parameters. It must be overrided in the subclasses.
Parameters:
file_numer - the file number.
star_number - the star number in the area.
coor - the R.A. and Decl.
valid_R_mag - true if R magnitude is recorded.
R_mag10 - the R magnitude in 0.1 mag unit.
valid_B_mag - true if B magnitude is recorded.
B_mag10 - the B magnitude in 0.1 mag unit.
V_mag - the V magnitude.
Returns:
the UsnoAStar object

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, and the file is in any CD-ROMs.
CdromNotFoundException - if a file does not exists in any URL, and the file is in a CD-ROM.

readNext

public CatalogStar readNext()
                     throws java.io.IOException,
                            java.io.FileNotFoundException,
                            CdromNotFoundException,
                            QueryFailException
Reads one data 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, and the file is in any CD-ROMs.
CdromNotFoundException - if a file does not exists in any URL, and the file is in a CD-ROM.
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.