protected override DataFrameBuilder AddColumns(DataFrameBuilder dataFrameBuilder) { dataFrameBuilder = AddColumnForAxis(dataFrameBuilder, dataFrameBuilder.BaseAxis); var points = dataFrameBuilder.Points; var apexes = new double?[points.Count]; var starts = new double?[points.Count]; var fwhms = new double?[points.Count]; for (int i = 0; i < points.Count; i++) { var point = points[i]; if (point.IsMissing) { continue; } starts[i] = point.Z; var middleErrorTag = point.Tag as MiddleErrorTag; if (middleErrorTag != null) { apexes[i] = middleErrorTag.Middle; fwhms[i] = middleErrorTag.Error; } } var dataFrame = new DataFrame(dataFrameBuilder.ValueAxis.Title.Text, dataFrameBuilder.Points.Count); dataFrame = dataFrame.AddColumn(new DataColumn <double?>(@"Apex", apexes)); dataFrame = dataFrame.AddColumn(new DataColumn <double?>(@"Start", starts)); dataFrame = dataFrame.AddColumn(GetColumnForAxis(dataFrameBuilder, dataFrameBuilder.ValueAxis).SetTitle(@"End")); dataFrame = dataFrame.AddColumn(new DataColumn <double?>(@"FWHM", fwhms)); dataFrameBuilder = dataFrameBuilder.AddColumn(dataFrame); return(dataFrameBuilder); }
protected override DataFrameBuilder AddColumns(DataFrameBuilder dataFrameBuilder) { dataFrameBuilder = AddColumnForAxis(dataFrameBuilder, dataFrameBuilder.BaseAxis); dataFrameBuilder = AddColumnForAxis(dataFrameBuilder, dataFrameBuilder.ValueAxis); var points = dataFrameBuilder.Points; var errors = new double?[points.Count]; for (int i = 0; i < points.Count; i++) { var point = points[i]; if (point.IsMissing) { continue; } var errorTag = point.Tag as ErrorTag; if (errorTag != null) { errors[i] = errorTag.Error; } } dataFrameBuilder = dataFrameBuilder.AddColumn(new DataColumn <double?>(@"StdErr", errors)); return(dataFrameBuilder); }