uk.ac.starlink.ttools.plot2.layer
Interface SpectrogramPlotter.ChannelGrid

Enclosing class:
SpectrogramPlotter

@Equality
public static interface SpectrogramPlotter.ChannelGrid

Defines the spectrum frequency channels. These are assumed the same for every spectrum in the spectrogram (every X coordinate). Each channel has an index (0..channelCount-1) and a lower and upper Y (spectral) axis bound. Typically the upper bound of channel i will be the lower bound of channel i+1, but this is not enforced. It is expected, though not enforced, that channel bound pairs are monotonically increasing with channel index.


Method Summary
 void getChannelBounds(int ichan, double[] ybounds)
          Reports the upper and lower Y (spectral) bounds for a given channel.
 int getChannelCount()
          Returns the number of channels if known.
 int[] getChannelRange(double ylo, double yhi)
          Returns the range of channel indices which are completely or partially covered in a given range of Y (spectral) values.
 

Method Detail

getChannelCount

int getChannelCount()
Returns the number of channels if known.

Returns:
number of channels in this grid, or -1 if not known

getChannelRange

int[] getChannelRange(double ylo,
                      double yhi)
Returns the range of channel indices which are completely or partially covered in a given range of Y (spectral) values.

Parameters:
ylo - lower bound of Y value
yhi - upper bound of Y value
Returns:
2-element array giving (lower, upper+1) index of channels visible in the given Y range

getChannelBounds

void getChannelBounds(int ichan,
                      double[] ybounds)
Reports the upper and lower Y (spectral) bounds for a given channel.

Parameters:
ichan - channel index
ybounds - 2-element array, on return contains (lower,upper) bounds of channel on the Y (spectral) axis


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.