net.aerith.misao.util
Class MagnitudeTranslationFormula

java.lang.Object
  |
  +--net.aerith.misao.util.MagnitudeTranslationFormula

public class MagnitudeTranslationFormula
extends java.lang.Object

The MagnitudeTranslationFormula represents a formula to convert pixel value into magnitude.

The parameters represents the following formula.

     magnitude = base_magnitude + gradient * log_2.5 ( value )
 


Field Summary
protected  double base_magnitude
          The base magnitude.
protected  double gradient
          The gradient.
static int MODE_CALCULATE_GRADIENT
          The mode which represents to calculate both the base magnitude and the gradient.
static int MODE_FIX_GRADIENT
          The mode which represents to fix the gradient as -1.
 
Constructor Summary
MagnitudeTranslationFormula()
          Constructs a MagnitudeTranslationFormula.
MagnitudeTranslationFormula(java.util.Vector pair_list, int mode)
          Constructs a MagnitudeTranslationFormula based on the specified list of StarPair which consists of a detected star image and a catalog data.
 
Method Summary
 double convertToMagnitude(double value)
          Converts the specified pixel value into magnitude.
 double convertToPixelValue(double magnitude)
          Converts the specified magnitude into pixel value.
static MagnitudeTranslationFormula create(java.lang.String string)
          Creates a MagnitudeTranslationFormula object from the String object which represents the formula.
 double getBaseMagnitude()
          Gets the base magnitude.
 double getGradient()
          Gets the gradient.
 java.lang.String getOutputString()
          Returns a string representation of the state of this object.
protected  java.lang.String paramString()
          Returns a raw string representation of the state of this object, for debugging use.
 void setBaseMagnitude(double new_magnitude)
          Sets the base magnitude.
 void setGradient(double new_gradient)
          Sets the gradient.
 java.lang.String toString()
          Returns a string representation of the state of this object, for debugging use.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

base_magnitude

protected double base_magnitude
The base magnitude.

gradient

protected double gradient
The gradient.

MODE_FIX_GRADIENT

public static final int MODE_FIX_GRADIENT
The mode which represents to fix the gradient as -1.

MODE_CALCULATE_GRADIENT

public static final int MODE_CALCULATE_GRADIENT
The mode which represents to calculate both the base magnitude and the gradient.
Constructor Detail

MagnitudeTranslationFormula

public MagnitudeTranslationFormula()
Constructs a MagnitudeTranslationFormula.

MagnitudeTranslationFormula

public MagnitudeTranslationFormula(java.util.Vector pair_list,
                                   int mode)
Constructs a MagnitudeTranslationFormula based on the specified list of StarPair which consists of a detected star image and a catalog data. Depending on the specified mode number, the gradient can be fixed as -1, or calculated to fit the data in the specified list.
Parameters:
pair_list - the list of pairs of a detected star image and a catalog data.
mode - the mode to calculate the formula, to fix the gradient as -1 or not.
Method Detail

getBaseMagnitude

public double getBaseMagnitude()
Gets the base magnitude.
Returns:
the base magnitude.

setBaseMagnitude

public void setBaseMagnitude(double new_magnitude)
Sets the base magnitude.
Parameters:
new_magnitude - the new base magnitude.

getGradient

public double getGradient()
Gets the gradient.
Returns:
the gradient.

setGradient

public void setGradient(double new_gradient)
Sets the gradient.
Parameters:
new_gradient - the new gradient.

convertToMagnitude

public double convertToMagnitude(double value)
Converts the specified pixel value into magnitude.
Parameters:
value - the pixel value to convert.
Returns:
the converted magnitude.

convertToPixelValue

public double convertToPixelValue(double magnitude)
Converts the specified magnitude into pixel value.
Parameters:
magnitude - the magnitude to convert.
Returns:
the converted pixel value.

create

public static MagnitudeTranslationFormula create(java.lang.String string)
Creates a MagnitudeTranslationFormula object from the String object which represents the formula.
Parameters:
string - the string which represents the formula.
Returns:
a new MagnitudeTranslationFormula object of the specified string.

getOutputString

public java.lang.String getOutputString()
Returns a string representation of the state of this object.
Returns:
a string representation of the state of this object.

paramString

protected java.lang.String paramString()
Returns a raw string representation of the state of this object, for debugging use. It should be invoked from toString method of the subclasses.
Returns:
a string representation of the state of this object.

toString

public java.lang.String toString()
Returns a string representation of the state of this object, for debugging use.
Overrides:
toString in class java.lang.Object
Returns:
a string representation of the state of this object.