net.aerith.misao.pixy.pairing
Class BrightnessBasedPairMaker

java.lang.Object
  |
  +--net.aerith.misao.util.OperationObservable
        |
        +--net.aerith.misao.util.Operation
              |
              +--net.aerith.misao.pixy.pairing.BrightnessBasedPairMaker

public class BrightnessBasedPairMaker
extends Operation

The BrightnessBasedPairMaker is a class to make pairs among two lists of stars. From the brightest star to the faintest star, a star in the first list is getting paired with a star in the second list. If some stars are in the specified search area, the brightest one is selected as a counterpart. If all stars in the specified search area are too faint over the specified difference, it will not be paired with any one.

The (x,y) position and magnitude of stars in the both lists must be set properly. The two lists are sorted in the constructor.


Field Summary
protected  double acceptable_mag_difference
          The difference of magnitude to be accepted to paired with.
protected  StarList first_list
          The first list of stars.
protected  PositionMap first_map
          The map of the first list of stars.
protected  java.util.Vector pair_list
          The list of pairs.
protected  double search_radius
          The radius to search a counterpart.
protected  StarList second_list
          The second list of stars.
protected  PositionMap second_map
          The map of the second list of stars.
 
Fields inherited from class net.aerith.misao.util.Operation
monitor_set, stopped
 
Fields inherited from class net.aerith.misao.util.OperationObservable
observer_list
 
Constructor Summary
BrightnessBasedPairMaker(StarList first_list, StarList second_list)
          Constructs a BrightnessBasedPairMaker with two lists of stars.
 
Method Summary
 java.util.Vector getPairList()
          Gets the list of pairs.
 void operate()
          Operates.
 boolean ready()
          Returns true if the operation is ready to start.
 void setAcceptableMagnitudeDifference(double delta_mag)
          Sets the differenct of magnitude to be accepted to paired with.
 void setMapAreas(PositionMap map1, PositionMap map2)
          Sets the map areas to check if a star is out of the area on the other map.
 void setSearchRadius(double radius)
          Sets the radius to search a counterpart.
 
Methods inherited from class net.aerith.misao.util.Operation
addMonitor, isStopped, perform, run, stop
 
Methods inherited from class net.aerith.misao.util.OperationObservable
addObserver, deleteObserver, notifyEnd, notifyFailed, notifyStart, notifySucceeded, notifyWarned
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

first_list

protected StarList first_list
The first list of stars.

second_list

protected StarList second_list
The second list of stars.

first_map

protected PositionMap first_map
The map of the first list of stars.

second_map

protected PositionMap second_map
The map of the second list of stars.

search_radius

protected double search_radius
The radius to search a counterpart.

acceptable_mag_difference

protected double acceptable_mag_difference
The difference of magnitude to be accepted to paired with.

pair_list

protected java.util.Vector pair_list
The list of pairs.
Constructor Detail

BrightnessBasedPairMaker

public BrightnessBasedPairMaker(StarList first_list,
                                StarList second_list)
Constructs a BrightnessBasedPairMaker with two lists of stars.
Parameters:
first_list - the first list of stars.
second_list - the second list of stars.
Method Detail

setSearchRadius

public void setSearchRadius(double radius)
Sets the radius to search a counterpart.
Parameters:
radius - the radius to search a counterpart.

setAcceptableMagnitudeDifference

public void setAcceptableMagnitudeDifference(double delta_mag)
Sets the differenct of magnitude to be accepted to paired with.
Parameters:
delta_mag - the differenct of magnitude.

setMapAreas

public void setMapAreas(PositionMap map1,
                        PositionMap map2)
Sets the map areas to check if a star is out of the area on the other map. If the specified map is null, stars will not been checked if out of area or not.
Parameters:
map1 - the map area of the first list of stars.
map2 - the map area of the second list of stars.

getPairList

public java.util.Vector getPairList()
Gets the list of pairs.
Returns:
the list of pairs.

ready

public boolean ready()
Returns true if the operation is ready to start.
Overrides:
ready in class Operation
Returns:
true if the operation is ready to start.

operate

public void operate()
             throws java.lang.Exception
Operates.
Overrides:
operate in class Operation
Throws:
java.lang.Exception - if an error occurs.