edu.nrao.sss.model.resource.evla
Class WidarSubband

java.lang.Object
  extended by edu.nrao.sss.model.resource.CorrelatorSubbandAbs
      extended by edu.nrao.sss.model.resource.evla.WidarSubband
All Implemented Interfaces:
CorrelatorSubband, HasBandwidth, Identifiable, Cloneable

public class WidarSubband
extends CorrelatorSubbandAbs

A subband of a WIDAR correlator baseband.

Version Info:

$Revision: 2291 $
$Date: 2009-05-08 11:09:46 -0600 (Fri, 08 May 2009) $
$Author: dharland $ (last person to modify)

Since:
2008-03-11
Author:
David M. Harland

Field Summary
 
Fields inherited from class edu.nrao.sss.model.resource.CorrelatorSubbandAbs
freqRange, name, productGroups, requantizationBits
 
Fields inherited from interface edu.nrao.sss.util.Identifiable
UNIDENTIFIED
 
Constructor Summary
WidarSubband()
          Helps create a new WIDAR subband.
 
Method Summary
 WidarSubband clone()
          Returns a copy of this subband.
 boolean equals(Object o)
          Returns true if o is equal to this subband.
static WidarSubband fromXml(Reader reader)
          Creates a new subband based on the XML data read from reader.
static WidarSubband fromXml(String xmlFile)
          Creates a new subband from the XML data in the given file.
 SortedSet<Frequency> getAllowableBandwidths()
          Returns the set of bandwidths to which this object may be set.
 SortedSet<Integer> getAllowableRequantizations()
          Returns the set of allowable requantization values for this subband.
 AutoCorrMode getAutoCorrMode()
          Returns the autocorrelation mode to use for this subband, if any.
 WidarBaseband getBaseband()
          Returns the baseband to which this subband belongs.
 BurstMode getBurstMode()
          Returns the burst mode to use for this subband, if any.
 int getChannelIncrementSize()
           
 Frequency getMaximumBandwidth()
          Returns the largest bandwidth to which this object may be set.
 int getMaximumChannelCount()
           
 Frequency getMinimumBandwidth()
          Returns the smallest bandwidth to which this object may be set.
 boolean getMixerPhaseErrorCorr()
          Returns true if the stage 2 mixer should update the phase error and model.
 PhasedArray getPhasedArray()
          Returns the phase array parameters to use for this subband, if any.
 PulsarBinning getPulsarBinning()
          Returns the pulsar binning parameters to use for this subband, if any.
 int getPulsarGatingPhase()
          Returns the shift of the pulsar gate in fractions of a cycle.
 RadarMode getRadarMode()
          Returns the pulsar binning parameters to use for this subband, if any.
 int getSbId()
           
 int getSignalToNoiseRatio()
          Returns the percent of signal in the input data.
 ToneExtraction getToneExtraction()
          Returns the tone extraction parameters to use for this subband, if any.
 boolean getUseStage2Mixer()
          Returns true if the stage 2 mixer is in use for this subband.
 boolean hasDiscreteBandwidths()
          Returns true if this object may be set only to pretermined bandwidths.
 int hashCode()
          Returns a hash code for this subband.
protected  WidarCorrelationProductGroup makeCorrelationProductGroup()
          Creates and returns a new product group that could be used with this subband.
 AutoCorrMode overrideDefaultAutoCorrMode(boolean override)
          Tells this subband to override, or restore, auto correlation mode defaults.
 BurstMode overrideDefaultBurstMode(boolean override)
          Tells this subband to override, or restore, burst mode defaults.
 PhasedArray overrideDefaultPhasedArray(boolean override)
          Tells this subband to override, or restore, phased array defaults.
 PulsarBinning overrideDefaultPulsarBinning(boolean override)
          Tells this subband to override, or restore, pulsar binning defaults.
 RadarMode overrideDefaultRadarMode(boolean override)
          Tells this subband to override, or restore, radar mode defaults.
 ToneExtraction overrideDefaultToneExtraction(boolean override)
          Tells this subband to override, or restore, pulsar gating defaults.
 void setBandwidth(Frequency newWidth)
          Sets the bandwidth of this subband.
 void setCentralFrequency(Frequency newCenter)
          Sets the central frequency of this subband.
 void setMixerPhaseErrorCorr(boolean correct)
          Tells the correlator whether or not the stage 2 mixer should update the phase error and model.
 void setPulsarGatingPhase(int newPhase)
          Sets the shift of the pulsar gate in fractions of a cycle
 void setRequantization(int bits)
          Sets the number of bits to which data should be requantized.
 void setSignalToNoiseRatio(int newRatio)
          Sets the percent of signal in the input data.
 void setUseStage2Mixer(boolean use)
          Turns the stage 2 mixer on or off for this subband.
 SubBand toVci()
           
 String toXml()
          Returns an XML representation of this subband.
 void writeAsXmlTo(Writer writer)
          Writes an XML representation of this subband to writer.
 
Methods inherited from class edu.nrao.sss.model.resource.CorrelatorSubbandAbs
addNewCorrelationProductGroup, clearId, createdProdGrpsFromPersistentStore, getAllowableBandwidthClosestTo, getAllowableBandwidthFor, getBandwidth, getCentralFrequency, getContainer, getCorrelationProductGroups, getFrequencyRange, getId, getMaximumCentralFrequency, getMinimumCentralFrequency, getName, getProxiedRange, getRequantization, removeCorrelationProductGroup, setCentralProxiedFrequency, setContainer, setName
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WidarSubband

public WidarSubband()
Helps create a new WIDAR subband.

Method Detail

getBaseband

public WidarBaseband getBaseband()
Description copied from interface: CorrelatorSubband
Returns the baseband to which this subband belongs.

Some implementations may allow for the creation of subbands apart from any baseband, with the idea that this subband would eventually be added to a baseband. Prior to being added to a baseband the return value from this method would be null.

Specified by:
getBaseband in interface CorrelatorSubband
Overrides:
getBaseband in class CorrelatorSubbandAbs
Returns:
the baseband to which this subband belongs, or null if it belongs to no baseband.

getMinimumBandwidth

public Frequency getMinimumBandwidth()
Description copied from interface: HasBandwidth
Returns the smallest bandwidth to which this object may be set.

Returns:
the smallest bandwidth to which this object may be set.

getMaximumBandwidth

public Frequency getMaximumBandwidth()
Description copied from interface: HasBandwidth
Returns the largest bandwidth to which this object may be set.

Returns:
the largest bandwidth to which this object may be set.

hasDiscreteBandwidths

public boolean hasDiscreteBandwidths()
Description copied from interface: HasBandwidth
Returns true if this object may be set only to pretermined bandwidths. A return value of false indicates that this object may be set to any bandwidth in the range allowed by HasBandwidth.getMinimumBandwidth() and HasBandwidth.getMaximumBandwidth().

If the returned value is true, the method HasBandwidth.getAllowableBandwidths() will give the set of predetermined bandwidths.

Returns:
true if this object may be set only to pretermined bandwidths.

getAllowableBandwidths

public SortedSet<Frequency> getAllowableBandwidths()
Description copied from interface: HasBandwidth
Returns the set of bandwidths to which this object may be set.

If the return value of HasBandwidth.hasDiscreteBandwidths() is false all frequencies in the range allowed by HasBandwidth.getMinimumBandwidth() and HasBandwidth.getMaximumBandwidth() are valid and this method will return an empty set. Otherwise it will return the set of allowable bandwidths.

Returns:
the set of bandwidths to which this object may be set.

setBandwidth

public void setBandwidth(Frequency newWidth)
Sets the bandwidth of this subband.

In addition to doing the work described in the method specifications, this WIDAR version also turns off the stage 2 mixer, if it happened to be on, and if the new width is 128 MHz.

Specified by:
setBandwidth in interface CorrelatorSubband
Overrides:
setBandwidth in class CorrelatorSubbandAbs
Parameters:
newWidth - the new bandwidth of this subband.

setCentralFrequency

public void setCentralFrequency(Frequency newCenter)
Sets the central frequency of this subband.

In addition to the side effects mentioned in the specification of this method, this implementation will also snap the center frequency to an imaginary grid. If the stage 2 filter is not turned on, the center of this subband must be equal to BW / 2 + BW * n, n=0,1,2,..., where BW is the bandwidth of this subband.

Specified by:
setCentralFrequency in interface CorrelatorSubband
Overrides:
setCentralFrequency in class CorrelatorSubbandAbs
Parameters:
newCenter - the central frequency of this subband.

getAllowableRequantizations

public SortedSet<Integer> getAllowableRequantizations()
Description copied from interface: CorrelatorSubband
Returns the set of allowable requantization values for this subband.

Returns:
the set of allowable requantization values for this subband.

setRequantization

public void setRequantization(int bits)
Description copied from interface: CorrelatorSubband
Sets the number of bits to which data should be requantized.

This subband allows only certain values for the number of bits. These values are given by CorrelatorSubband.getAllowableRequantizations(). If a disallowed value is sent to this method, it will be replaced by the nearest acceptable value. If it is equally near two acceptable values, the smaller one will be used.

Parameters:
bits - the number of bits to which data should be requantized.

getMaximumChannelCount

public int getMaximumChannelCount()

getChannelIncrementSize

public int getChannelIncrementSize()

makeCorrelationProductGroup

protected WidarCorrelationProductGroup makeCorrelationProductGroup()
Description copied from class: CorrelatorSubbandAbs
Creates and returns a new product group that could be used with this subband.

Specified by:
makeCorrelationProductGroup in class CorrelatorSubbandAbs

toVci

public SubBand toVci()

getSbId

public int getSbId()

overrideDefaultAutoCorrMode

public AutoCorrMode overrideDefaultAutoCorrMode(boolean override)
Tells this subband to override, or restore, auto correlation mode defaults.

Parameters:
override - instruction to override, or restore, auto correlation mode defaults.
Returns:
null if override is false. If override is true, returns the AutoCorrMode held internally by this subband. This means clients can operate directly on the returned object and impact this subband.

getAutoCorrMode

public AutoCorrMode getAutoCorrMode()
Returns the autocorrelation mode to use for this subband, if any. The default value of this property is null.

This is a VCI property. The returned object was generated from VCI XML schema elements and is the actual instance held internally by this subband.

Returns:
the autocorrelation mode to use for this subband, if any.
See Also:
overrideDefaultAutoCorrMode(boolean)

overrideDefaultBurstMode

public BurstMode overrideDefaultBurstMode(boolean override)
Tells this subband to override, or restore, burst mode defaults.

Parameters:
override - instruction to override, or restore, burst mode defaults.
Returns:
null if override is false. If override is true, returns the BurstMode held internally by this subband. This means clients can operate directly on the returned object and impact this subband.

getBurstMode

public BurstMode getBurstMode()
Returns the burst mode to use for this subband, if any. The default value of this property is null.

This is a VCI property. The returned object was generated from VCI XML schema elements and is the actual instance held internally by this subband.

Returns:
the autocorrelation mode to use for this subband, if any.
See Also:
overrideDefaultBurstMode(boolean)

overrideDefaultPhasedArray

public PhasedArray overrideDefaultPhasedArray(boolean override)
Tells this subband to override, or restore, phased array defaults.

Parameters:
override - instruction to override, or restore, phased array defaults.
Returns:
null if override is false. If override is true, returns the PhasedArray held internally by this subband. This means clients can operate directly on the returned object and impact this subband.

getPhasedArray

public PhasedArray getPhasedArray()
Returns the phase array parameters to use for this subband, if any. The default value of this property is null.

This is a VCI property. The returned object was generated from VCI XML schema elements and is the actual instance held internally by this subband.

Returns:
the phase array parameters to use for this subband, if any.
See Also:
overrideDefaultPhasedArray(boolean)

overrideDefaultPulsarBinning

public PulsarBinning overrideDefaultPulsarBinning(boolean override)
Tells this subband to override, or restore, pulsar binning defaults.

Parameters:
override - instruction to override, or restore, pulsar binning defaults.
Returns:
null if override is false. If override is true, returns the PulsarBinning held internally by this subband. This means clients can operate directly on the returned object and impact this subband.

getPulsarBinning

public PulsarBinning getPulsarBinning()
Returns the pulsar binning parameters to use for this subband, if any. The default value of this property is null.

This is a VCI property. The returned object was generated from VCI XML schema elements and is the actual instance held internally by this subband.

Returns:
the pulsar binning parameters to use for this subband, if any.
See Also:
overrideDefaultPulsarBinning(boolean)

overrideDefaultRadarMode

public RadarMode overrideDefaultRadarMode(boolean override)
Tells this subband to override, or restore, radar mode defaults.

Parameters:
override - instruction to override, or restore, radar mode defaults.
Returns:
null if override is false. If override is true, returns the RadarMode held internally by this subband. This means clients can operate directly on the returned object and impact this subband.

getRadarMode

public RadarMode getRadarMode()
Returns the pulsar binning parameters to use for this subband, if any. The default value of this property is null.

This is a VCI property. The returned object was generated from VCI XML schema elements and is the actual instance held internally by this subband.

Returns:
the pulsar binning parameters to use for this subband, if any.
See Also:
overrideDefaultRadarMode(boolean)

overrideDefaultToneExtraction

public ToneExtraction overrideDefaultToneExtraction(boolean override)
Tells this subband to override, or restore, pulsar gating defaults.

Parameters:
override - instruction to override, or restore, pulsar gating defaults.
Returns:
null if override is false. If override is true, returns the ToneExtraction held internally by this subband. This means clients can operate directly on the returned object and impact this subband.

getToneExtraction

public ToneExtraction getToneExtraction()
Returns the tone extraction parameters to use for this subband, if any. The default value of this property is null.

This is a VCI property. The returned object was generated from VCI XML schema elements and is the actual instance held internally by this subband.

Returns:
the tone extraction parameters to use for this subband, if any.
See Also:
overrideDefaultToneExtraction(boolean)

getMixerPhaseErrorCorr

public boolean getMixerPhaseErrorCorr()
Returns true if the stage 2 mixer should update the phase error and model. If the stage 2 mixer is not being used, this value is irrelevant. The default value of this property is true.

Returns:
true if the stage 2 mixer should update the phase error and model.

setMixerPhaseErrorCorr

public void setMixerPhaseErrorCorr(boolean correct)
Tells the correlator whether or not the stage 2 mixer should update the phase error and model.

Parameters:
correct - use a value of true if the stage 2 mixer should update the phase error and model.

getPulsarGatingPhase

public int getPulsarGatingPhase()
Returns the shift of the pulsar gate in fractions of a cycle.

Returns:
the shift of the pulsar gate in fractions of a cycle. The returned value will be an integer from 0 through 100.

setPulsarGatingPhase

public void setPulsarGatingPhase(int newPhase)
Sets the shift of the pulsar gate in fractions of a cycle

Parameters:
newPhase - fraction of a cycle. The value must be in the range 0 through 100.
Throws:
IllegalArgumentException - if newPhase is less than zero or greater than one hundred.

getSignalToNoiseRatio

public int getSignalToNoiseRatio()
Returns the percent of signal in the input data.

Returns:
the percent of signal in the input data. The returned value will be an integer from 0 through 100.

setSignalToNoiseRatio

public void setSignalToNoiseRatio(int newRatio)
Sets the percent of signal in the input data.

Parameters:
newRatio - percent of signal in the input data. The value must be in the range 0 through 100.
Throws:
IllegalArgumentException - if newRatio is less than zero or greater than one hundred.

setUseStage2Mixer

public void setUseStage2Mixer(boolean use)
Turns the stage 2 mixer on or off for this subband.

If the stage 2 mixer is off, this subband is restricted to certain slots in its baseband. If this subband's bandwidth is W, and if the stage 2 mixer is off, then the low frequency of this subband's range must start at 0, W, 2W, etc.

Parameters:
use - true if the stage 2 mixer should be used for this subband.

getUseStage2Mixer

public boolean getUseStage2Mixer()
Returns true if the stage 2 mixer is in use for this subband.

Returns:
true if the stage 2 mixer is in use for this subband.
See Also:
setUseStage2Mixer(boolean)

toXml

public String toXml()
             throws JAXBException
Returns an XML representation of this subband.

Returns:
an XML representation of this subband.
Throws:
JAXBException - if anything goes wrong during the conversion to XML.
See Also:
writeAsXmlTo(Writer)

writeAsXmlTo

public void writeAsXmlTo(Writer writer)
                  throws JAXBException
Writes an XML representation of this subband to writer.

Parameters:
writer - the device to which XML is written.
Throws:
JAXBException - if anything goes wrong during the conversion to XML.

fromXml

public static WidarSubband fromXml(String xmlFile)
                            throws JAXBException,
                                   XMLStreamException,
                                   FileNotFoundException
Creates a new subband from the XML data in the given file.

Parameters:
xmlFile - the name of an XML file. This method will attempt to locate the file by using Class.getResource(String).
Returns:
a new subband from the XML data in the given file.
Throws:
FileNotFoundException - if the XML file cannot be found.
JAXBException - if the schema file used (if any) is malformed, if the XML file cannot be read, or if the XML file is not schema-valid.
XMLStreamException - if there is a problem opening the XML file, if the XML is not well-formed, or for some other "unexpected processing conditions".

fromXml

public static WidarSubband fromXml(Reader reader)
                            throws JAXBException,
                                   XMLStreamException
Creates a new subband based on the XML data read from reader.

Parameters:
reader - the source of the XML data. If this value is null, null is returned.
Returns:
a new subband based on the XML data read from reader.
Throws:
XMLStreamException - if the XML is not well-formed, or for some other "unexpected processing conditions".
JAXBException - if anything else goes wrong during the transformation.

clone

public WidarSubband clone()
Returns a copy of this subband.

The returned subband is nearly, but not quite, a deep copy of this subband. Properties that are not copied:

  1. Those properties not copied by the super class.
  2. baseline board pairs - this collection will be empty.

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

Overrides:
clone in class CorrelatorSubbandAbs

equals

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

Overrides:
equals in class CorrelatorSubbandAbs

hashCode

public int hashCode()
Returns a hash code for this subband.

Overrides:
hashCode in class CorrelatorSubbandAbs


Copyright © 2009. All Rights Reserved.