// This is a convenience function that pulls out the mean and error of a channel,
// specified by a set of switches for a given detector. This isn't the most efficient
// way to do it if pulling out a lot of values, but it's not bad. And it is convenient.
public double[] GetChannelValueAndError(string[] switches, string detector)
{
int detectorIndex;
if (DetectorIndices.TryGetValue(detector, out detectorIndex))
{
DetectorChannelValues dcv = ChannelValues[detectorIndex];
uint channelIndex = dcv.GetChannelIndex(switches);
return(new double[] { dcv.Values[channelIndex], dcv.Errors[channelIndex] });
}
else
{
return(new double[] { 0.0, 0.0 });
}
}