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

java.lang.Object
  extended by edu.nrao.sss.model.resource.CorrelatorConfiguration
      extended by edu.nrao.sss.model.resource.evla.EvlaWidarConfiguration
All Implemented Interfaces:
TelescopeBackend, Identifiable, ActionListener, Cloneable, EventListener

public class EvlaWidarConfiguration
extends CorrelatorConfiguration

The configuration of the WIDAR correlator.

Version Info:

$Revision: 2309 $
$Date: 2009-05-14 16:46:39 -0600 (Thu, 14 May 2009) $
$Author: dharland $ (last person to modify)

Since:
2008-02-04
Author:
David M. Harland

Field Summary
 
Fields inherited from class edu.nrao.sss.model.resource.CorrelatorConfiguration
activeBBs, bbListeners, inactiveBBs, signalSource
 
Fields inherited from interface edu.nrao.sss.util.Identifiable
UNIDENTIFIED
 
Constructor Summary
EvlaWidarConfiguration(AntennaElectronics signalSrc)
          Constructs a new configuration that is initialized from signalSrc.
 
Method Summary
 void actionPerformed(ActionEvent event)
           
 EvlaWidarConfiguration clone()
          Returns a copy of this configuration.
 void configureFrom(ResourceSpecification scienceView)
          This method is not yet supported.
protected  void createdBasebandsFromPersistentStore()
          Called after basebands were created from a persistent store, such as a database or XMl file.
 boolean equals(Object o)
          Returns true if o is equal to this configuration.
 void formPairWithPartner(WidarBasebandSinglet currentSinglet)
          Updates this configuration by removing currentSinglet and its partner and replacing them with a baseband pair generated by their union.
static EvlaWidarConfiguration fromXml(Reader reader)
          Creates a new configuration based on the XML data read from reader.
static EvlaWidarConfiguration fromXml(String xmlFile)
          Creates a new configuration from the XML data in the given file.
 BlbpPool getBaselineBoardPool()
           
 int getMaxAntennaCount()
          Returns the maximum number of antennas that are compatible with this configuration.
 CorrelatorName getName()
          Returns a more specific type for this backend.
protected  List<CorrelatorBaseband> getOrderedBasebands()
          Allows concrete subclasses to be in charge of the ordering of the basebands returned by CorrelatorConfiguration.getBasebands().
 int hashCode()
          Returns a hash code value for this configuration.
protected  CorrelatorBaseband makeBasebandFrom(DigitalSignal ds)
          Creates a new baseband from the given digital signal.
protected  CorrelatorBaseband makeBasebandFrom(DigitalSignal ds1, DigitalSignal ds2)
          Creates a new baseband from the given digital signals.
 void setMaxAntennaCount(int newMax)
          Sets the maximum number of antennas in a subarray that may use this configuration.
 void splitBasebandPair(WidarBasebandPair currentPair)
          Updates this configuration by removing currentPair and replacing it with two partnered baseband singlets generated from it.
 ListOfStations toVciListOfStations(List<Integer> stationIds)
          Expresses this configuration as a VCI ListOfStations object.
 StationInputOutput toVciStationInputOutput()
          Expresses this configuration as a VCI StationInputOutput object.
 SubArray toVciSubArray(List<Integer> stationIds)
          Expresses this configuration as a VCI SubArray object.
 String toXml()
          Returns an XML representation of this configuration.
 void writeAsXmlTo(Writer writer)
          Writes an XML representation of this configuration to writer.
 
Methods inherited from class edu.nrao.sss.model.resource.CorrelatorConfiguration
addBasebandCollectionListener, clearId, getBasebands, getId, getSignalSource, getSupportedCorrelators, getType, makeFor, removeBasebandCollectionListener, setId, setSignalSource
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EvlaWidarConfiguration

public EvlaWidarConfiguration(AntennaElectronics signalSrc)
Constructs a new configuration that is initialized from signalSrc.

Parameters:
signalSrc - the antenna electronics that provide the input signals for the basebands of this configuration.
Throws:
IllegalArgumentException - if signalSrc is null.
Method Detail

getName

public CorrelatorName getName()
Description copied from interface: TelescopeBackend
Returns a more specific type for this backend.

Returns:
a more specific type for this backend.

setMaxAntennaCount

public void setMaxAntennaCount(int newMax)
Sets the maximum number of antennas in a subarray that may use this configuration. This configuration needs to know the maximum number of antennas to be used in an observation because many of the calculations for WIDAR depend on the number of antennas used.

Parameters:
newMax - the new maximum number of antennas. If this value is less than one, one will be used. If this value is greater than the number of antennas in the full array (27), 27 will be used.

getMaxAntennaCount

public int getMaxAntennaCount()
Returns the maximum number of antennas that are compatible with this configuration. See setMaxAntennaCount(int) for more information.

Returns:
the maximum number of antennas.

getOrderedBasebands

protected List<CorrelatorBaseband> getOrderedBasebands()
Description copied from class: CorrelatorConfiguration
Allows concrete subclasses to be in charge of the ordering of the basebands returned by CorrelatorConfiguration.getBasebands(). This default implementation returns a copy of the activeBBs list without any reordering

Overrides:
getOrderedBasebands in class CorrelatorConfiguration

makeBasebandFrom

protected CorrelatorBaseband makeBasebandFrom(DigitalSignal ds)
Description copied from class: CorrelatorConfiguration
Creates a new baseband from the given digital signal. Subclasses of this one decide which implementation of a CorrelatorBaseband to construct.

This method is expected to produce a CorrelatorBaseband whose CorrelatorBaseband.isSinglet() property is true.

Specified by:
makeBasebandFrom in class CorrelatorConfiguration
Parameters:
ds - the digital signal that serves as the signal source for the newly created baseband.
Returns:
a new baseband, or null if ds is null.

makeBasebandFrom

protected CorrelatorBaseband makeBasebandFrom(DigitalSignal ds1,
                                              DigitalSignal ds2)
Description copied from class: CorrelatorConfiguration
Creates a new baseband from the given digital signals. Subclasses of this one decide which implementation of a CorrelatorBaseband to construct.

This method is expected to produce a CorrelatorBaseband whose CorrelatorBaseband.isPair() property is true.

Specified by:
makeBasebandFrom in class CorrelatorConfiguration
Parameters:
ds1 - one of two digital signals that serve as the signal sources for the newly created baseband.
ds2 - one of two digital signals that serve as the signal sources for the newly created baseband.
Returns:
a new baseband, or null if either ds1 or ds2 is null.

splitBasebandPair

public void splitBasebandPair(WidarBasebandPair currentPair)
Updates this configuration by removing currentPair and replacing it with two partnered baseband singlets generated from it.

Parameters:
currentPair - the baseband pair to be split into partnered singles and replaced by them.

formPairWithPartner

public void formPairWithPartner(WidarBasebandSinglet currentSinglet)
Updates this configuration by removing currentSinglet and its partner and replacing them with a baseband pair generated by their union. If currentSinglet has no partner, this method does nothing.

Note that which baseband in a tuple of partnered singles is passed to this method is significant. For example, imagine the single partnered basebands A1 and C1. If A1 is passed to this method, the A1/C1 pair will have characteristics more similar to A1 than C1, such as the decimation of the baseband into subbands.

Parameters:
currentSinglet - the baseband singlet, along with its partner, that should be converted to a baseband pair and replaced by it.

actionPerformed

public void actionPerformed(ActionEvent event)

createdBasebandsFromPersistentStore

protected void createdBasebandsFromPersistentStore()
Description copied from class: CorrelatorConfiguration
Called after basebands were created from a persistent store, such as a database or XMl file. This method is here so that subclasses may override it. This default implementation does nothing.

Overrides:
createdBasebandsFromPersistentStore in class CorrelatorConfiguration

configureFrom

public void configureFrom(ResourceSpecification scienceView)
This method is not yet supported.

Parameters:
scienceView - a specification for the science goals to be met by this hardware.

getBaselineBoardPool

public BlbpPool getBaselineBoardPool()

toVciSubArray

public SubArray toVciSubArray(List<Integer> stationIds)
Expresses this configuration as a VCI SubArray object.

Parameters:
stationIds - the IDs of the antennas to be included in the returned object.
Returns:
a VCI SubArray object based on this configuration and stationIds.

toVciStationInputOutput

public StationInputOutput toVciStationInputOutput()
Expresses this configuration as a VCI StationInputOutput object.

Returns:
a VCI StationInputOutput object based on this configuration.

toVciListOfStations

public ListOfStations toVciListOfStations(List<Integer> stationIds)
Expresses this configuration as a VCI ListOfStations object.

Parameters:
stationIds - the IDs of the antennas to be included in the returned object.
Returns:
a VCI ListOfStations object based on this configuration and stationIds.

toXml

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

Returns:
an XML representation of this configuration.
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 configuration 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 EvlaWidarConfiguration fromXml(String xmlFile)
                                      throws JAXBException,
                                             XMLStreamException,
                                             FileNotFoundException
Creates a new configuration 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 configuration 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 EvlaWidarConfiguration fromXml(Reader reader)
                                      throws JAXBException,
                                             XMLStreamException
Creates a new configuration 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 configuration 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 EvlaWidarConfiguration clone()
Returns a copy of this configuration.

The returned clone is almost a deep copy. The exceptions which prevent us from saying it is a deep copy are:

  1. No baseline board pairs are associated with the correlation product groups of the cloned configuration.

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

Specified by:
clone in interface TelescopeBackend
Overrides:
clone in class CorrelatorConfiguration
Returns:
a copy of this backend.

equals

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

Overrides:
equals in class CorrelatorConfiguration

hashCode

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

Overrides:
hashCode in class CorrelatorConfiguration


Copyright © 2009. All Rights Reserved.