edu.nrao.sss.model.source
Class SourceBrightnessFilter

java.lang.Object
  extended by edu.nrao.sss.model.source.SourceBrightnessFilter
All Implemented Interfaces:
Filter<SourceBrightness>

public class SourceBrightnessFilter
extends Object
implements Filter<SourceBrightness>

A filter that operates on SourceBrightness objects.

Version Info:

$Revision: 1616 $
$Date: 2008-10-10 14:25:31 -0600 (Fri, 10 Oct 2008) $
$Author: dharland $

Since:
2006-06-09
Author:
David M. Harland

Constructor Summary
SourceBrightnessFilter()
          Creates a new wide-open filter that allows all brightnesses to pass.
 
Method Summary
 boolean allows(SourceBrightness sb)
          Returns true if this filter allows the given source brightness to pass through it.
 boolean blocks(SourceBrightness sb)
          Returns true if this filter blocks the given source brightness.
 void clearAll()
          Returns this filter to a wide-open state.
 void clearFlux()
          Returns the flux density criterion to its wide-open state.
 void clearFrequency()
          Returns the frequency criterion to its wide-open state.
 void clearPolarization()
          Returns the polarization criterion to its wide-open state.
 void clearTime()
          Returns the time criterion to its wide-open state.
 void setFlux(FluxDensity minimumFlux, FluxDensity maximumFlux)
          Sets the flux density criterion of this filter to the given range.
 void setFrequency(Frequency newFrequency)
          Sets the frequency criterion of this filter to newFrequency.
 void setFrequency(FrequencyRange newRange)
          Sets the frequency criterion of this filter to newRange.
 void setPolarization(StokesParameter newPolarization)
          Sets the polarization criterion of this filter to newPolarization.
 void setTime(Date newTime)
          Sets the time criterion of this filter to newTime.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceBrightnessFilter

public SourceBrightnessFilter()
Creates a new wide-open filter that allows all brightnesses to pass.

Method Detail

clearAll

public void clearAll()
Returns this filter to a wide-open state. After this call all filtering criteria will be in their wide-open states and this filter will allow all brightnesses to pass.


clearFlux

public void clearFlux()
Returns the flux density criterion to its wide-open state.

Since:
2008-07-29
See Also:
setFlux(FluxDensity, FluxDensity)

setFlux

public void setFlux(FluxDensity minimumFlux,
                    FluxDensity maximumFlux)
Sets the flux density criterion of this filter to the given range.

Null values may be used to establish floors or ceilings. For example, to block all sources with a flux density less than F call: myFilter.setFlux(F, null);.

Only those brightnesses whose flux densities are in the range established here may pass through this filter.

Parameters:
minimumFlux - the minimum flux density that may pass through this filter. A value of null will be interpreted as a desire to have no minimum value.
maximumFlux - the maximum flux density that may pass through this filter. A value of null will be interpreted as a desire to have no maximum value.
Since:
2008-07-29
See Also:
clearFlux()

clearFrequency

public void clearFrequency()
Returns the frequency criterion to its wide-open state.

See Also:
setFrequency(Frequency)

setFrequency

public void setFrequency(Frequency newFrequency)
Sets the frequency criterion of this filter to newFrequency.

Clients may choose to use this method to set a single frequency, or setFrequency(FrequencyRange) to set a range of frequencies. When a single frequency is set, a match is deemed to occur when a source brightness's valid frequency range contains that single frequency. When a range of frequencies is used, a match is deemed to occur whenever the valid range has any overlap with that range of frequencies.

Calling this method always removes any previously set range of frequencies. If newFrequency is null, it will be interpreted as the desire to clear the single frequency as well.

Parameters:
newFrequency - the new frequency criterion for this filter.
See Also:
clearFrequency(), setFrequency(FrequencyRange)

setFrequency

public void setFrequency(FrequencyRange newRange)
Sets the frequency criterion of this filter to newRange.

Clients may choose to use setFrequency(Frequency) to set a single frequency, or this method to set a range of frequencies. When a single frequency is set, a match is deemed to occur when a source brightness's valid frequency range contains that single frequency. When a range of frequencies is used, a match is deemed to occur whenever the valid range has any overlap with that range of frequencies.

Calling this method always removes any previously set single frequency. If newRange is null, it will be interpreted as the desire to clear the range of frequencies as well.

Parameters:
newRange - the new frequency criterion for this filter.
Since:
2008-10-10
See Also:
clearFrequency(), setFrequency(Frequency)

clearTime

public void clearTime()
Returns the time criterion to its wide-open state.

See Also:
setTime(Date)

setTime

public void setTime(Date newTime)
Sets the time criterion of this filter to newTime. If newTime is null, it will be interpreted as the desire to clear the time criterion.

Only those brightnesses whose valid time intervals contain newTime may pass through this filter.

Parameters:
newTime - the new time criterion for this filter.
See Also:
clearTime()

clearPolarization

public void clearPolarization()
Returns the polarization criterion to its wide-open state.

See Also:
setPolarization(StokesParameter)

setPolarization

public void setPolarization(StokesParameter newPolarization)
Sets the polarization criterion of this filter to newPolarization. If newPolarization is null, it will be interpreted as the desire to clear the polarization criterion.

Only those brightnesses whose polarizations equal newPolarization may pass through this filter.

Parameters:
newPolarization - the new polarization criterion for this filter.
See Also:
clearPolarization()

blocks

public boolean blocks(SourceBrightness sb)
Returns true if this filter blocks the given source brightness. Null brightnesses are always blocked.

Specified by:
blocks in interface Filter<SourceBrightness>
Parameters:
sb - the brightness to be filtered.
Returns:
true if this filter blocks sb.

allows

public boolean allows(SourceBrightness sb)
Returns true if this filter allows the given source brightness to pass through it. Null brightnesses are always blocked.

Specified by:
allows in interface Filter<SourceBrightness>
Parameters:
sb - the brightness to be filtered.
Returns:
true if this filter allows sb to pass through it.


Copyright © 2009. All Rights Reserved.