net.aerith.misao.catalog.io
Class Ucac1Reader

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

public class Ucac1Reader
extends CatalogReader

The Ucac1Reader is a class to read the UCAC1 Catalogue.

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.


Inner Class Summary
protected  interface Ucac1Reader.EndOfChunkException
          The EndOfChunkException is an exception thrown when all records in a chunk are read.
 
Field Summary
protected  CircumArea circum_area
          The circum area to read stars.
protected  double current_base_decl
          The base Decl.
protected  double current_base_ra
          The base R.A.
protected  int current_chunk
          The current chunk number.
protected  int current_end_number
          The last star number in current chunk.
protected  int current_file_index
          The index of current file.
protected  int current_position
          The current position in the file.
protected  int current_record_size
          The record size in current zone.
protected  int[] current_seek_position
          The seek position of chunks in current zone.
protected  int current_star_number
          The current star number.
protected  java.io.DataInputStream current_stream
          The current_input stream.
protected  int current_zone
          The current zone number.
protected static int file_N
          The number of files.
protected  java.util.Vector zone_list
          The list of zones to be read.
 
Fields inherited from class net.aerith.misao.catalog.io.CatalogReader
center_coor, date, limiting_mag, url_set
 
Constructor Summary
Ucac1Reader()
          Constructs an empty Ucac1Reader.
Ucac1Reader(java.net.URL url)
          Constructs a Ucac1Reader with URL of directory containing the AC 2000.2 Catalogue.
 
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.
 CatalogStar readNext()
          Reads one data 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

file_N

protected static final int file_N
The number of files.

current_stream

protected java.io.DataInputStream current_stream
The current_input stream.

current_file_index

protected int current_file_index
The index of current file.

current_base_ra

protected double current_base_ra
The base R.A. of current chunk.

current_base_decl

protected double current_base_decl
The base Decl. of current zone.

current_record_size

protected int current_record_size
The record size in current zone.

current_seek_position

protected int[] current_seek_position
The seek position of chunks in current zone.

current_position

protected int current_position
The current position in the file.

current_chunk

protected int current_chunk
The current chunk number.

current_star_number

protected int current_star_number
The current star number.

current_end_number

protected int current_end_number
The last star number in current chunk.

current_zone

protected int current_zone
The current zone number.

circum_area

protected CircumArea circum_area
The circum area to read stars.

zone_list

protected java.util.Vector zone_list
The list of zones to be read.
Constructor Detail

Ucac1Reader

public Ucac1Reader()
Constructs an empty Ucac1Reader.

Ucac1Reader

public Ucac1Reader(java.net.URL url)
Constructs a Ucac1Reader with URL of directory containing the AC 2000.2 Catalogue.
Parameters:
url - the URL of directory containing CD-ROMs data.
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, 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. Note that data with the same ID are also returned one by one.
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.