edu.nrao.sss.model.resource.vla
Class VlaConfiguration

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

public class VlaConfiguration
extends CorrelatorConfiguration

The configuration of the VLA correlator.

This class was created without a lot of care. It is meant to be used for a short period of time, primarily to support Ka observing on the "interim" system.

UPDATE: the code in here has become progressively worse. It is a dangerous class to use unless you have insider knowledge. This class is planned for destruction in 2010.

Another UPDATE: Yup, this is the worst crap i've written in a decade. Recently tried to effect a simple change in behavior, and found what appeared to be the right place to change. Took a few attempts before doing it right. This class cannot be killed soon enough.

Version Info:

$Revision: 2271 $
$Date: 2009-04-28 12:02:17 -0600 (Tue, 28 Apr 2009) $
$Author: dharland $ (last person to modify)

Since:
2008-03-14
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
VlaConfiguration(AntennaElectronics signalSrc)
           
 
Method Summary
 void actionPerformed(ActionEvent event)
           
 String[] calcLoIfSetupParams(DopplerTracker acTracker, DopplerTracker bdTracker, Date when)
          Returns an array of text that can be used in the LoIfSetup constructor.
 VlaConfiguration clone()
          Returns a copy of this configuration.
 void configureFrom(ResourceSpecification scienceView)
          This method is not yet supported.
 boolean equals(Object o)
          Returns true if o is equal to this configuration.
 Frequency getBandwidth(IFPair ifPair)
          Returns the bandwidth used for this configuration for the given IF pair.
 BandwidthCode getBandwidthCode(IFCode ifCode)
          Returns the bandwidth code used for the given IF.
 Frequency getBandwidthNominal(IFPair ifPair)
           
 Frequency getCentralFrequency(IFPair ifPair)
          Returns a copy of one of the two central frequencies that can be held by this configuration.
 Frequency getCentralSkyFrequency(IFPair ifPair, DopplerTracker dt, Date dateTime)
          Returns a central sky frequency for the given IF pair.
 Frequency getCentralSkyFrequency(IFPair ifPair, Source source, Date dateTime)
          Deprecated. do not use; see getCentralSkyFrequency(IFPair, DopplerTracker, Date)
 CorrelatorMode getCorrelatorMode()
          Returns the correlator mode for this configuration.
 FrequencyRange getFrequencyRange(IFPair ifPair)
          Returns the sky frequency range for this configuration for the given IF pair.
 BigDecimal getIntegrationTime()
          Returns a copy of the integration time for this configuration.
 CorrelatorName getName()
          Returns a more specific type for this backend.
 Set<ProcessingType> getSpectralProcessing()
          Returns the collection of spectral processing options used by this configuration.
 Frequency getSSLO(IFPair ifPair)
          Deprecated. Do not use; see getSSLO(IFPair, DopplerTracker, Date) instead.
 Frequency getSSLO(IFPair ifPair, DopplerTracker dt, Date dateTime)
          Deprecated. Do not use; see calcLoIfSetupParams(DopplerTracker, DopplerTracker, Date) instead.
 List<BigDecimal> getValidIntegrationTimes()
          Returns a list of valid integration times for the VLA correlator.
 int hashCode()
          Returns a hash code value for this configuration.
 boolean isSkyFrequency(IFPair ifPair)
          Returns true if the central frequency for the specified IFPair was specified as a Sky Frequency, false if it was specified as a Rest Frequency.
protected  VlaBasebandPair makeBasebandFrom(DigitalSignal ds)
          Creates a new baseband from the given digital signal.
protected  VlaBasebandPair makeBasebandFrom(DigitalSignal ds1, DigitalSignal ds2)
          Creates a new baseband from the given digital signals.
 void setAll(Frequency centFreqAC, Frequency centFreqBD, BandwidthCode bwAC, BandwidthCode bwBD, CorrelatorMode corrMode, Set<ProcessingType> processingOptions, BigDecimal integrationSeconds)
          A convenience method for setting all the old-style parameters at once.
 void setBandwidthCode(IFCode ifCode, BandwidthCode bwCode)
          Sets the bandwidth code to use for the given IF.
 void setBandwidthCodes(BandwidthCode ifsAC, BandwidthCode ifsBD)
          Sets the bandwidth codes for all four IFs at once, setting A & C to one value and B & D to the other.
 void setBandwidthCodes(BandwidthCode ifA, BandwidthCode ifB, BandwidthCode ifC, BandwidthCode ifD)
          Sets the bandwidth codes for all four IFs at once.
 void setCentralFrequency(IFPair ifPair, Frequency central)
          calls setCentralFrequency(ifPair, central, true);
 void setCentralFrequency(IFPair ifPair, Frequency central, boolean isSkyFrequency)
          Sets one of the two central frequencies that can be held by this configuration.
 void setCorrelatorMode(CorrelatorMode newMode)
          Sets the correlator mode for this configuration.
 void setIntegrationTime(BigDecimal seconds)
          Sets a new integration time for this configuration.
 void setSpectralProcessing(Set<ProcessingType> options)
          Sets this configuration's spectral processing options.
 void tidyUp()
          Sets the central frequency and bandwidth of the unused IF pair, if any, to that of the IF pair that is being used.
 
Methods inherited from class edu.nrao.sss.model.resource.CorrelatorConfiguration
addBasebandCollectionListener, clearId, createdBasebandsFromPersistentStore, getBasebands, getId, getOrderedBasebands, getSignalSource, getSupportedCorrelators, getType, makeFor, removeBasebandCollectionListener, setId, setSignalSource
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VlaConfiguration

public VlaConfiguration(AntennaElectronics signalSrc)
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.

makeBasebandFrom

protected VlaBasebandPair 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 VlaBasebandPair 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.

actionPerformed

public void actionPerformed(ActionEvent event)

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.

setAll

public void setAll(Frequency centFreqAC,
                   Frequency centFreqBD,
                   BandwidthCode bwAC,
                   BandwidthCode bwBD,
                   CorrelatorMode corrMode,
                   Set<ProcessingType> processingOptions,
                   BigDecimal integrationSeconds)
A convenience method for setting all the old-style parameters at once. See the individual setXxx methods for details. NOTE: This assumes your center frequencies are SKY frequencies!


setCentralFrequency

public void setCentralFrequency(IFPair ifPair,
                                Frequency central,
                                boolean isSkyFrequency)
Sets one of the two central frequencies that can be held by this configuration. TODO: This method assumes that there is only 1 receiver band selected in the AntennaElectronics' active receiver set.

Parameters:
ifPair - the IF pair for which the central frequency is being set.
central - the central frequency. To use only one central frequency, set the other to a value of zero.
isSkyFrequency - True if central is a sky frequency, false if it is a rest frequency.
Throws:
IllegalArgumentException - if either parameter is null or if central is not within the range of the selected receiver.

setCentralFrequency

public void setCentralFrequency(IFPair ifPair,
                                Frequency central)
calls setCentralFrequency(ifPair, central, true);


isSkyFrequency

public boolean isSkyFrequency(IFPair ifPair)
Returns true if the central frequency for the specified IFPair was specified as a Sky Frequency, false if it was specified as a Rest Frequency.


getCentralFrequency

public Frequency getCentralFrequency(IFPair ifPair)
Returns a copy of one of the two central frequencies that can be held by this configuration. The returned frequency will never be null but could be zero.

This central frequency may be either a rest or sky frequency; use isSkyFrequency(IFPair) to determine which it is. See also getCentralSkyFrequency(IFPair, Source, Date).

Parameters:
ifPair - the IF pair for which the central frequency is being sought.
Returns:
the central frequency for the given IF pair.
Throws:
IllegalArgumentException - if ifPair is null.

getCentralSkyFrequency

public Frequency getCentralSkyFrequency(IFPair ifPair,
                                        Source source,
                                        Date dateTime)
                                 throws CoordinateConversionException
Deprecated. do not use; see getCentralSkyFrequency(IFPair, DopplerTracker, Date)

Throws:
CoordinateConversionException

getCentralSkyFrequency

public Frequency getCentralSkyFrequency(IFPair ifPair,
                                        DopplerTracker dt,
                                        Date dateTime)
                                 throws CoordinateConversionException
Returns a central sky frequency for the given IF pair. The source and dateTime are used only if the stored frequency is a rest frequency.

Parameters:
ifPair - the IF pair for which the central sky frequency is being sought.
dt - a Doppler tracker that will provide information on source position, source velocity, and earth velocity. If this value is null Doppler tracking will not be performed.
dateTime - the date and time of the observation. This parameter is used if this configuration holds a rest frequency. The velocity of the source relative to the EVLA is calculated using this point in time. If this value is null the current system time will be used.
Returns:
the central sky frequency for the given IF pair.
Throws:
IllegalArgumentException - if ifPair is null.
CoordinateConversionException - if the position of the source cannot be converted to an equatorial RA / Dec position.
Since:
2008-07-29

getBandwidth

public Frequency getBandwidth(IFPair ifPair)
Returns the bandwidth used for this configuration for the given IF pair.

Parameters:
ifPair - the IF pair (A/C or B/D) for which the bandwidth is requested.
Returns:
the bandwidth used for this configuration for the given IF pair.

getBandwidthNominal

public Frequency getBandwidthNominal(IFPair ifPair)

getFrequencyRange

public FrequencyRange getFrequencyRange(IFPair ifPair)
Returns the sky frequency range for this configuration for the given IF pair.

Parameters:
ifPair - the IF pair (A/C or B/D) for which the bandwidth is requested.
Returns:
the frequency range used for this configuration for the given IF pair.

calcLoIfSetupParams

public String[] calcLoIfSetupParams(DopplerTracker acTracker,
                                    DopplerTracker bdTracker,
                                    Date when)
                             throws CoordinateConversionException
Returns an array of text that can be used in the LoIfSetup constructor.

Parameters:
acTracker - a doppler tracker for the A/C IF pair.
bdTracker - a doppler tracker for the B/D IF pair.
when - the point in time to use for calculating doppler shifts.
Returns:
the parameters to use in the LoIfConstructor plus one other value that tells clients whether or not this method swapped the A/C and B/D pairs. The returned array has a length of five, and the parameters are in this order:
  1. Frequency name of the band, e.g. "33GHz".
  2. SSLO A/C in MHz.
  3. SSLO B/D in MHz.
  4. The T303 path variable. Value = "0", "1", or "2".
  5. Value = "swapped" or "not swapped".
Throws:
CoordinateConversionException - see getCentralSkyFrequency(IFPair, DopplerTracker, Date).

getSSLO

public Frequency getSSLO(IFPair ifPair,
                         DopplerTracker dt,
                         Date dateTime)
                  throws CoordinateConversionException
Deprecated. Do not use; see calcLoIfSetupParams(DopplerTracker, DopplerTracker, Date) instead.

Throws:
CoordinateConversionException

getSSLO

public Frequency getSSLO(IFPair ifPair)
Deprecated. Do not use; see getSSLO(IFPair, DopplerTracker, Date) instead.


getValidIntegrationTimes

public List<BigDecimal> getValidIntegrationTimes()
Returns a list of valid integration times for the VLA correlator. The unit of time for the returned values is seconds.

Returns:
a list of valid integration times for the VLA correlator.

setIntegrationTime

public void setIntegrationTime(BigDecimal seconds)
Sets a new integration time for this configuration.

Parameters:
seconds - a new integration time for this configuration. The value should be chosen from the list of valid values.
Throws:
IllegalArgumentException - if seconds is not one of the valid values from getValidIntegrationTimes().

getIntegrationTime

public BigDecimal getIntegrationTime()
Returns a copy of the integration time for this configuration.

Returns:
a copy of the integration time for this configuration.

setCorrelatorMode

public void setCorrelatorMode(CorrelatorMode newMode)
Sets the correlator mode for this configuration.

Parameters:
newMode - the new correlator mode for this configuration.
Throws:
IllegalArgumentException - if newMode is null.

getCorrelatorMode

public CorrelatorMode getCorrelatorMode()
Returns the correlator mode for this configuration.

Returns:
the correlator mode for this configuration.

setBandwidthCode

public void setBandwidthCode(IFCode ifCode,
                             BandwidthCode bwCode)
Sets the bandwidth code to use for the given IF.

Parameters:
ifCode - the IF for which bandCode will be applied.
bwCode - the bandwidth code to use for the given IF code. The bandwidth code determines bandwidth and the maximum number of spectral channels for the given IF.
Throws:
IllegalArgumentException - if either parameter is null.

setBandwidthCodes

public void setBandwidthCodes(BandwidthCode ifA,
                              BandwidthCode ifB,
                              BandwidthCode ifC,
                              BandwidthCode ifD)
Sets the bandwidth codes for all four IFs at once.

Parameters:
ifA - the bandwidth code to use for IF A.
ifB - the bandwidth code to use for IF B.
ifC - the bandwidth code to use for IF C.
ifD - the bandwidth code to use for IF D.
Throws:
IllegalArgumentException - if any of the parameters are null.

setBandwidthCodes

public void setBandwidthCodes(BandwidthCode ifsAC,
                              BandwidthCode ifsBD)
Sets the bandwidth codes for all four IFs at once, setting A & C to one value and B & D to the other.

See Also:
setBandwidthCodes(BandwidthCode, BandwidthCode, BandwidthCode, BandwidthCode)

getBandwidthCode

public BandwidthCode getBandwidthCode(IFCode ifCode)
Returns the bandwidth code used for the given IF.

Parameters:
ifCode - the IF for which the returned bandwidth code is used.
Returns:
the bandwidth code used for the given IF.
Throws:
IllegalArgumentException - if ifCode is null.

getSpectralProcessing

public Set<ProcessingType> getSpectralProcessing()
Returns the collection of spectral processing options used by this configuration. The returned set is the one held internally by this configuration, so any changes made to it will change this configurations options.

Returns:
the collection of spectral processing options used by this configuration.

setSpectralProcessing

public void setSpectralProcessing(Set<ProcessingType> options)
Sets this configuration's spectral processing options. This object will hold a reference to the parameter, so any changes made to the set passed to this method after the method call will have an effect on this configuration. The one exception is for a parameter value of null. If null is received, this method will create a new empty set to use instead.

Parameters:
options - new spectral processing options for this configuration.

tidyUp

public void tidyUp()
Sets the central frequency and bandwidth of the unused IF pair, if any, to that of the IF pair that is being used. This is convenient for both validation and for script generation.


clone

public VlaConfiguration clone()
Description copied from class: CorrelatorConfiguration
Returns a copy of this configuration. The returned object is a deep copy of this one, with the following exceptions:
  1. Both configurations are using the same signal source.
  2. While each configuration has its own list of listeners, the same listeners are present in each list.

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.