HiRISE

HiRISE.HiCat.Utilities
Class Utilities

java.lang.Object
  extended by HiRISE.HiCat.Utilities.Utilities

public class Utilities
extends Object

Static utility methods used by various classes in the HiCat java packages.

Version:
1.9
Author:
Rodney Heyd UA/PIRL

Field Summary
static int DEBUG
           
static int DEBUG_LONGITUDES
           
static int DEBUG_OFF
           
static String ID
          Class identifier.
 
Constructor Summary
Utilities()
           
 
Method Summary
static boolean Longitudes_Overlap(double lower_bound1, double upper_bound1, double lower_bound2, double upper_bound2)
          A boolean method indicating if two longitude ranges overlap.
static void main(String[] arguments)
           
static double shift_to_180_domain(double coordinate)
          Switches an input longitude between 180 and 360 into the -180-180 longitude domain.
static double stddev(Vector<Double> data)
          Computes the standard deviation of a Vector of Doubles.
static Vector<String> valuesToString(Vector<Value> input)
          A utility method that converts a Vector of Parameter Values into a Vector of Strings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final String ID
Class identifier.

See Also:
Constant Field Values

DEBUG_OFF

public static final int DEBUG_OFF
See Also:
Constant Field Values

DEBUG_LONGITUDES

public static final int DEBUG_LONGITUDES
See Also:
Constant Field Values

DEBUG

public static final int DEBUG
See Also:
Constant Field Values
Constructor Detail

Utilities

public Utilities()
Method Detail

Longitudes_Overlap

public static boolean Longitudes_Overlap(double lower_bound1,
                                         double upper_bound1,
                                         double lower_bound2,
                                         double upper_bound2)
A boolean method indicating if two longitude ranges overlap.

If the upper bound of a longitude range is less than the lower bound, then this method assumes that the longitude range crosses 0 degrees longitude, and returns a bolean value based on that assumption.

Parameters:
lower_bound1 - The lower longitude bound of the first longitude range
upper_bound1 - The upper longitude bound of the first longitude range
lower_bound2 - The lower longitude bound of the second longitude range
upper_bound2 - The upper longitude bound of the second longitude range
Returns:
true if the ranges overlap, false otherwise
Throws:
IllegalArgumentException - if any of the input longitudes are outside of the range of 0-360.

shift_to_180_domain

public static double shift_to_180_domain(double coordinate)
Switches an input longitude between 180 and 360 into the -180-180 longitude domain. If the input value is not in the 180 to 360 range, this method does not modify in the value of the coordinate.

Parameters:
coordinate - - the coordinate to shift
Returns:
the longitude shifted into the -180-180 domain, if a shift was necessary.

valuesToString

public static Vector<String> valuesToString(Vector<Value> input)
                                     throws PVL_Exception
A utility method that converts a Vector of Parameter Values into a Vector of Strings.

Parameters:
input - - a Vector of values
Returns:
a Vector of Strings
Throws:
PVL_Exception - if an error occurs while converting to string values.

stddev

public static double stddev(Vector<Double> data)
Computes the standard deviation of a Vector of Doubles.

Parameters:
data - A vector containing the set of data to compute the standard deviation for.
Returns:
the standard deviation of the input data.

main

public static void main(String[] arguments)

HiRISE

Copyright (C) Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona