public ICalibratonDataSets Select(ICalibrationSchema schema)
        {
            ICalibratonDataSets ds = null;

            if (schema.Responses.Length > 1)
            {
                throw new Exception("Only one output variable is required.");
            }
            else
            {
                IVariable outputv          = schema.Responses[0];
                TimeSeriesQueryCriteria qc = new TimeSeriesQueryCriteria()
                {
                    Start      = schema.Start,
                    End        = schema.End,
                    SiteID     = outputv.SiteID,
                    VariableID = outputv.VariableID
                };
                var ts = outputv.GetValues(qc, mOdmAdaptor);
                if (ts != null)
                {
                    ds = new CalibrationDatasets(ts[0, ":", "0"], ts.DateTimes);
                    schema.InstancesCount = ts.Size[1];

                    double[][] input = new double[schema.Stimulus.Length][];
                    int        i     = 0;
                    foreach (IVariable v in schema.Stimulus)
                    {
                        qc = new TimeSeriesQueryCriteria()
                        {
                            Start      = schema.Start,
                            End        = schema.End,
                            SiteID     = v.SiteID,
                            VariableID = v.VariableID
                        };
                        input[i] = v.GetValues(qc, mOdmAdaptor)[0, ":", "0"];
                        i++;
                    }
                    ds.InputData = input;
                    schema.CalibratonDataSets = ds;
                }
            }
            return(ds);
        }