# 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.

Since:
  16 Jul 2013
Author:
  Mark Taylor

## Method Summary

Modifier and Type
Method
Description
`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.
`String`
`getSpectralName()`
Returns the name of the quantity plotted on the spectral axis.
`String`
`getSpectralUnit()`
Returns the unit of the quantity plotted on the spectral axis.

## Method Details

### 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

### getSpectralName

String getSpectralName()
Returns the name of the quantity plotted on the spectral axis.

Returns:
  spectral quantity name, may be null

### getSpectralUnit

String getSpectralUnit()
Returns the unit of the quantity plotted on the spectral axis.

Returns:
  spectral quanity units, may be null