edu.nrao.sss.model.source.sort
Class SourceProximitySortKey

java.lang.Object
  extended by edu.nrao.sss.model.source.sort.SourceProximitySortKey
All Implemented Interfaces:
Orderable, Comparator<SourceCatalogEntry>

public class SourceProximitySortKey
extends Object
implements Orderable, Comparator<SourceCatalogEntry>

Compares sources based on their proximity to a given point in the sky.

Version Info:

$Revision: 1617 $
$Date: 2008-10-10 16:52:33 -0600 (Fri, 10 Oct 2008) $
$Author: dharland $ (last person to modify)

Since:
2008-10-08
Author:
David M. Harland

Field Summary
static Date NOW
          Tells this key to get position information as of the current system time.
 
Constructor Summary
SourceProximitySortKey()
          Creates a new key for sorting sources by their proximity to a particular sky position.
 
Method Summary
 int compare(SourceCatalogEntry sce1, SourceCatalogEntry sce2)
           
 SortOrder getOrder()
           
 double getSeparationInDegrees(SourceCatalogEntry sce)
          Returns the angular separation, in degrees, between sce and the central position of this object.
 void setCentralPosition(SkyPosition newPoint)
          Sets the point in the sky from which all other sources will be measured.
 void setObserverParameters(EarthPosition location, TimeZone timeZone)
          Sets the earth position and time zone to be used in coordinate conversions.
 void setOrder(SortOrder newOrder)
           
 void setQueryTime(Date newTime)
          Sets the time for which position information will be requested.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

NOW

public static final Date NOW
Tells this key to get position information as of the current system time.

Constructor Detail

SourceProximitySortKey

public SourceProximitySortKey()
Creates a new key for sorting sources by their proximity to a particular sky position.

Method Detail

getSeparationInDegrees

public double getSeparationInDegrees(SourceCatalogEntry sce)
Returns the angular separation, in degrees, between sce and the central position of this object.

Parameters:
sce - a celestial source.
Returns:
the angular separation between source and this object's central sky position.

setCentralPosition

public void setCentralPosition(SkyPosition newPoint)
Sets the point in the sky from which all other sources will be measured.

Parameters:
newPoint - a point in the sky. Sources will be compared to each other based on their angular distance from this point. A value of null is not allowed.
Throws:
IllegalArgumentException - if newPoint is null.

setObserverParameters

public void setObserverParameters(EarthPosition location,
                                  TimeZone timeZone)
Sets the earth position and time zone to be used in coordinate conversions. This method is rarely used. The observer's parameters come into play only when dealing with conversions to or from AZ/EL. The default position and time zone are those of the EVLA.

Parameters:
location - the location of the observer to be used in coordinate conversion calculations. A value of null will result in the use of the EVLA's position.
timeZone - the time zone of the observer to be used in coordinate conversion calculations. A value of null will result in the use of the EVLA's position.
Since:
2008-10-08

setQueryTime

public void setQueryTime(Date newTime)
Sets the time for which position information will be requested. The constant NOW may be used as a signal to use the current system time.

Parameters:
newTime - the time at which position information will be evaluated.

setOrder

public void setOrder(SortOrder newOrder)
Specified by:
setOrder in interface Orderable

getOrder

public SortOrder getOrder()
Specified by:
getOrder in interface Orderable

compare

public int compare(SourceCatalogEntry sce1,
                   SourceCatalogEntry sce2)
Specified by:
compare in interface Comparator<SourceCatalogEntry>


Copyright © 2009. All Rights Reserved.