edu.nrao.sss.model.source
Class SourceBrightness

java.lang.Object
  extended by edu.nrao.sss.model.source.SourceBrightness
All Implemented Interfaces:
Identifiable, Cloneable, Comparable<SourceBrightness>
Direct Known Subclasses:
DescriptiveBrightness, FileBasedBrightness

public abstract class SourceBrightness
extends Object
implements Identifiable, Cloneable, Comparable<SourceBrightness>

The brightness of an astronomical source.

Version Info:

$Revision: 1709 $
$Date: 2008-11-14 11:22:37 -0700 (Fri, 14 Nov 2008) $
$Author: dharland $

Since:
2006-04-04
Author:
David M. Harland

Field Summary
 
Fields inherited from interface edu.nrao.sss.util.Identifiable
UNIDENTIFIED
 
Method Summary
 SourceBrightness clone()
          Returns a source brightness that is equal to this one.
 int compareTo(SourceBrightness other)
          Compares this brightness to other for order.
static SourceBrightness createBrightness(BrightnessDistribution type)
          Returns a source brightness instance for the distribution of the given type.
static SourceBrightness[] createBrightnesses(VlaFluxObservation fluxRec)
          Creates a pair of source brightnesses based on fluxRec.
 boolean equals(Object o)
          Returns true if o is equal to this source brightness.
 URL getBrightnessFile()
          Returns the file upon which this source brightness is based, if any.
 BrightnessDistribution getDistributionType()
          Returns the distribution type of this brightness.
 Long getId()
           
 double getLimbDarkening()
          Returns the limb darkening of this source brightness.
 double getMajorAxisDiameter()
          Returns the diameter of the major axis of this source brightness in A.U.
 double getMinorAxisDiameter()
          Returns the diameter of the minor axis of this source brightness in A.U.
 String getObservation()
          Returns text that represents the observational data upon which this brightness is based.
 FluxDensity getPeakFluxDensity()
          Returns the peak flux density of this source brightness.
 StokesParameter getPolarization()
          Returns the polarization of this source brightness.
 double getPositionAngle()
          Returns the position angle of this source brightness in degrees.
 FluxDensity getTotalFluxDensity()
          Returns the total flux density of this source brightness.
 FrequencyRange getValidFrequency()
          Returns the frequency range for which this source brightness is valid.
 TimeInterval getValidTime()
          Returns the interval of time for which this brightness is valid.
 VlaFluxObservation getVlaObservation()
          Returns the VLA flux data upon which this brightness is based.
 int hashCode()
          Returns a hash code value for this source brightness.
 boolean isFileBased()
          Returns true if this source brightness if based on the contents of a file, false otherwise.
 boolean isValidFor(Date time)
          Returns true if this brightness is valid for the given point in time.
 void reset()
          Resets this brightness to its initial state.
 void setValidTime(TimeInterval interval)
          Sets the interval of time for which this brightness is valid.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createBrightness

public static SourceBrightness createBrightness(BrightnessDistribution type)
Returns a source brightness instance for the distribution of the given type.

Parameters:
type - the brightness distribution for which a source brightness instance is desired.
Returns:
a new source brightness of the given type.

createBrightnesses

public static SourceBrightness[] createBrightnesses(VlaFluxObservation fluxRec)
Creates a pair of source brightnesses based on fluxRec.

The returned array will have exactly two brightnesses. The element at index zero will hold a brightness for left circular polarization; the element at index one will hold a brightness for right circular polarization.

Parameters:
fluxRec - an observation of the flux of a source performed by the VLA.
Returns:
a pair of source brightnesses based on fluxRec.

reset

public void reset()
Resets this brightness to its initial state. A reset brightness has the same state as a new brightness.


getId

public Long getId()
Specified by:
getId in interface Identifiable

getDistributionType

public BrightnessDistribution getDistributionType()
Returns the distribution type of this brightness.

Returns:
the distribution type of this brightness.

getPolarization

public StokesParameter getPolarization()
Returns the polarization of this source brightness.

Returns:
the polarization of this source brightness.

setValidTime

public void setValidTime(TimeInterval interval)
Sets the interval of time for which this brightness is valid.

If interval is null, it will be treated as an non-null interval of zero length.

Parameters:
interval - the interval of time for which this brightness is valid.

getValidTime

public TimeInterval getValidTime()
Returns the interval of time for which this brightness is valid.

The return value is guaranteed to be non-null. It is also the range that is held internally by this source brightness, so any changes made to the returned range will be reflected in this object.

Returns:
the interval of time for which this brightness is valid.

isValidFor

public boolean isValidFor(Date time)
Returns true if this brightness is valid for the given point in time.

Parameters:
time - the point in time to be checked.

getValidFrequency

public FrequencyRange getValidFrequency()
Returns the frequency range for which this source brightness is valid.

The return value is guaranteed to be non-null. It is also the range that is held internally by this source brightness, so any changes made to the returned range will be reflected in this object.

Returns:
the valid frequency range for this source velocity.

getPeakFluxDensity

public FluxDensity getPeakFluxDensity()
Returns the peak flux density of this source brightness.

The returned value is guaranteed to be non-null. It is also the peak flux density that is held internally by this source brightness, so any changes made to the returned flux density will be reflected in this object.

Returns:
the peak flux density of this source brightness.

getTotalFluxDensity

public FluxDensity getTotalFluxDensity()
Returns the total flux density of this source brightness.

The returned value is guaranteed to be non-null. It is also the total flux density that is held internally by this source brightness, so any changes made to the returned flux density will be reflected in this object.

Returns:
the total flux density of this source brightness.

getMajorAxisDiameter

public double getMajorAxisDiameter()
Returns the diameter of the major axis of this source brightness in A.U.

Returns:
the diameter of the major axis of this source brightness in A.U.

getMinorAxisDiameter

public double getMinorAxisDiameter()
Returns the diameter of the minor axis of this source brightness in A.U.

Returns:
the diameter of the minor axis of this source brightness in A.U.

getPositionAngle

public double getPositionAngle()
Returns the position angle of this source brightness in degrees. The position angle is based on the major axis. A north-south orientation of the major axis is taken to be zero degrees. Positive angles are measured eastward from north.

Returns:
the position angle of this source brightness in degrees.

getLimbDarkening

public double getLimbDarkening()
Returns the limb darkening of this source brightness.

The value returned is a measure of shape.

Returns:
the limb darkening of this source brightness.

isFileBased

public boolean isFileBased()
Returns true if this source brightness if based on the contents of a file, false otherwise.

Returns:
true if this source brightness if based on the contents of a file.

getBrightnessFile

public URL getBrightnessFile()
Returns the file upon which this source brightness is based, if any. If this source is not file based, a phony URL will be returned.

Returns:
the file upon which this source brightness is based, if any.

getObservation

public String getObservation()
Returns text that represents the observational data upon which this brightness is based. If there is no such data, the empty string ("") will be returned.

Returns:
text representation of an observation of this brightness.

getVlaObservation

public VlaFluxObservation getVlaObservation()
Returns the VLA flux data upon which this brightness is based.

Returns:
the VLA flux data upon which this brightness is based.

clone

public SourceBrightness clone()
Returns a source brightness that is equal to this one.

If anything goes wrong during the cloning procedure, a RuntimeException will be thrown.

Overrides:
clone in class Object

equals

public boolean equals(Object o)
Returns true if o is equal to this source brightness.

Overrides:
equals in class Object

hashCode

public int hashCode()
Returns a hash code value for this source brightness.

Overrides:
hashCode in class Object

compareTo

public int compareTo(SourceBrightness other)
Compares this brightness to other for order.

One brightness is deemed to be "less than" the other if it has a valid frequency range that is less than that of the other. In the case that two brighnesses have the same valid frequency range, the valid time range is used as a tie-breaker. If these are the same other attributes are compared until a difference is found. If none are found, the return value is zero.

Specified by:
compareTo in interface Comparable<SourceBrightness>
Parameters:
other - the brightness to which this one is compared.
Returns:
a negative integer, zero, or a positive integer as this brightness is less than, equal to, or greater than the other brightness.


Copyright © 2009. All Rights Reserved.