本文整理汇总了C#中Altaxo.GetTableProperty方法的典型用法代码示例。如果您正苦于以下问题:C# Altaxo.GetTableProperty方法的具体用法?C# Altaxo.GetTableProperty怎么用?C# Altaxo.GetTableProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Altaxo
的用法示例。
在下文中一共展示了Altaxo.GetTableProperty方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: QuestPreferredNumberOfFactors
/// <summary>
/// Asks the user for the preferred number of factors to use for calculation and plotting and stores that number in the
/// PLS content tag of the table.
/// </summary>
/// <param name="table">The table which contains the PLS model.</param>
public static void QuestPreferredNumberOfFactors(Altaxo.Data.DataTable table)
{
MultivariateContentMemento plsMemo = table.GetTableProperty("Content") as MultivariateContentMemento;
if(plsMemo==null)
return;
QuestPreferredNumberOfFactors(plsMemo);
}
示例2: PlotXCrossResiduals
/// <summary>
/// Plots the x (spectral) residuals (of cross prediction) of all spectra invidually in a graph.
/// </summary>
/// <param name="table">The table with the PLS model data.</param>
public static void PlotXCrossResiduals(Altaxo.Data.DataTable table)
{
MultivariateContentMemento plsMemo = table.GetTableProperty("Content") as MultivariateContentMemento;
if(plsMemo==null)
return;
if(plsMemo.PreferredNumberOfFactors<=0)
QuestPreferredNumberOfFactors(plsMemo);
for(int nComponent=0;nComponent<plsMemo.NumberOfConcentrationData;nComponent++)
{
Altaxo.Graph.GUI.IGraphController graphctrl = Current.ProjectService.CreateNewGraph();
PlotXResiduals(table,graphctrl.Doc.Layers[0],nComponent,plsMemo.PreferredNumberOfFactors);
}
}
示例3: PlotXLeverage
/// <summary>
/// Plots the x (spectral) leverage into a graph.
/// </summary>
/// <param name="table">The table with the PLS model data.</param>
public static void PlotXLeverage(Altaxo.Data.DataTable table)
{
MultivariateContentMemento plsMemo = table.GetTableProperty("Content") as MultivariateContentMemento;
if(plsMemo==null)
return;
if(plsMemo.PreferredNumberOfFactors<=0)
QuestPreferredNumberOfFactors(plsMemo);
Altaxo.Graph.GUI.IGraphController graphctrl = Current.ProjectService.CreateNewGraph();
PlotXLeverage(table,graphctrl.Doc.Layers[0],plsMemo.PreferredNumberOfFactors);
}
示例4: PlotPredictionScores
/// <summary>
/// Plots all preprocessed spectra into a newly created graph.
/// </summary>
/// <param name="table">The table of PLS output data.</param>
public static void PlotPredictionScores(Altaxo.Data.DataTable table)
{
MultivariateContentMemento plsMemo = table.GetTableProperty("Content") as MultivariateContentMemento;
if(plsMemo==null)
return;
if(plsMemo.PreferredNumberOfFactors<=0)
QuestPreferredNumberOfFactors(plsMemo);
GetAnalysis(table).CalculateAndStorePredictionScores(table, plsMemo.PreferredNumberOfFactors);
AscendingIntegerCollection sel = new AscendingIntegerCollection();
for(int i=0;i<plsMemo.NumberOfConcentrationData;i++)
{
string name = WorksheetAnalysis.GetPredictionScore_ColumnName(i,plsMemo.PreferredNumberOfFactors);
if(null!=table[name])
sel.Add(table.DataColumns.GetColumnNumber(table[name]));
}
Worksheet.Commands.PlotCommands.PlotLine(table,sel,true,false);
}
示例5: CalculatePreprocessedSpectra
/// <summary>
/// Fills a provided table (should be empty) with the preprocessed spectra. The spectra are saved as columns (independently on their former orientation in the original worksheet).
/// </summary>
/// <param name="calibtable">The table containing the calibration model.</param>
/// <param name="desttable">The table where to store the preprocessed spectra. Should be empty.</param>
public void CalculatePreprocessedSpectra(
Altaxo.Data.DataTable calibtable,
Altaxo.Data.DataTable desttable)
{
MultivariateContentMemento plsMemo = calibtable.GetTableProperty("Content") as MultivariateContentMemento;
if(plsMemo==null)
throw new ArgumentException("Table does not contain a PLSContentMemento");
IMatrix matrixX = GetRawSpectra(plsMemo);
IMultivariateCalibrationModel calib = GetCalibrationModel(calibtable);
// do spectral preprocessing
plsMemo.SpectralPreprocessing.ProcessForPrediction(matrixX,calib.PreprocessingModel.XMean,calib.PreprocessingModel.XScale);
// for the new table, save the spectra as column
DoubleColumn xcol = new DoubleColumn();
for(int i=matrixX.Columns;i>=0;i--)
xcol[i] = calib.PreprocessingModel.XOfX[i];
desttable.DataColumns.Add(xcol,_XOfX_ColumnName,ColumnKind.X,0);
for(int n=0;n<matrixX.Rows;n++)
{
DoubleColumn col = new DoubleColumn();
for(int i=matrixX.Columns-1;i>=0;i--)
col[i] = matrixX[n,i];
desttable.DataColumns.Add(col,n.ToString(),ColumnKind.V,0);
}
}
示例6: PlotXCrossResiduals
/// <summary>
/// Plots the x (spectral) residuals (of cross prediction) of all spectra invidually in a graph.
/// </summary>
/// <param name="table">The table with the PLS model data.</param>
public static void PlotXCrossResiduals(Altaxo.Data.DataTable table)
{
MultivariateContentMemento plsMemo = table.GetTableProperty("Content") as MultivariateContentMemento;
if (plsMemo == null)
return;
if (plsMemo.PreferredNumberOfFactors <= 0)
QuestPreferredNumberOfFactors(plsMemo);
for (int nComponent = 0; nComponent < plsMemo.NumberOfConcentrationData; nComponent++)
{
string newName = string.Format("GXCrossResidualsC{0}#{1}F", nComponent, plsMemo.PreferredNumberOfFactors);
var graphctrl = CreateNewGraphWithXYLayer(table.GetPropertyContext(), Main.ProjectFolder.CreateFullName(table.Name, newName), table.Name);
PlotXResiduals(table, graphctrl.Doc.GetFirstXYPlotLayer(), nComponent, plsMemo.PreferredNumberOfFactors);
}
}
示例7: PlotCrossPredictedVersusActualY
/// <summary>
/// Plots the cross prediction values of all y components invidually in a graph.
/// </summary>
/// <param name="table">The table with the PLS model data.</param>
/// <param name="allowGuiForMessages">If <see langword="true"/> and an error occurs, an error message box is presented to the user.</param>
public static void PlotCrossPredictedVersusActualY(Altaxo.Data.DataTable table, bool allowGuiForMessages)
{
MultivariateContentMemento plsMemo = table.GetTableProperty("Content") as MultivariateContentMemento;
if (plsMemo == null)
{
string msg = string.Format("The table <<{0}>> does not seem to contain multivariate analysis data (content memento is missing)", table.Name);
if (allowGuiForMessages)
Current.Gui.ErrorMessageBox(msg);
else
throw new ApplicationException(msg);
return;
}
while (!Current.Project.DataTableCollection.Contains(plsMemo.OriginalDataTableName))
{
string msg = string.Format("The table of the original spectral data <<{0}>> does not exist (renamed?)", plsMemo.OriginalDataTableName);
if (allowGuiForMessages)
{
Current.Gui.ErrorMessageBox(msg);
string newName = plsMemo.OriginalDataTableName;
// TODO replace by a TableChoiceDialogBox
if (Current.Gui.ShowDialog(ref newName, "Please enter the table name of original spectral data", false))
plsMemo.OriginalDataTableName = newName;
}
else
throw new WorksheetAnalysis.OriginalDataTableNotFoundException(msg);
}
if (plsMemo.PreferredNumberOfFactors <= 0)
QuestPreferredNumberOfFactors(plsMemo);
for (int nComponent = 0; nComponent < plsMemo.NumberOfConcentrationData; nComponent++)
{
string newName = string.Format("GCrossPredVsActC{0}#{1}F", nComponent, plsMemo.PreferredNumberOfFactors);
var graphctrl = CreateNewGraphWithXYLayer(table.GetPropertyContext(), Main.ProjectFolder.CreateFullName(table.Name, newName), table.Name);
PlotCrossPredictedVersusActualY(table, graphctrl.Doc.GetFirstXYPlotLayer(), nComponent, plsMemo.PreferredNumberOfFactors);
}
}
示例8: PlotXLeverage
/// <summary>
/// Plots the x (spectral) leverage into a graph.
/// </summary>
/// <param name="table">The table with the PLS model data.</param>
public static void PlotXLeverage(Altaxo.Data.DataTable table)
{
MultivariateContentMemento plsMemo = table.GetTableProperty("Content") as MultivariateContentMemento;
if (plsMemo == null)
return;
if (plsMemo.PreferredNumberOfFactors <= 0)
QuestPreferredNumberOfFactors(plsMemo);
string newName = string.Format("GXLeverage#{0}F", plsMemo.PreferredNumberOfFactors);
newName = Main.ProjectFolder.CreateFullName(table.Name, newName);
var graphctrl = CreateNewGraphWithXYLayer(table.GetPropertyContext(), Main.ProjectFolder.CreateFullName(table.Name, newName), table.Name);
PlotXLeverage(table, graphctrl.Doc.GetFirstXYPlotLayer(), plsMemo.PreferredNumberOfFactors);
}
示例9: PredictionModelExporter
public PredictionModelExporter(Altaxo.Data.DataTable table, int numberOfFactors)
{
_table = table;
_memento = table.GetTableProperty("Content") as MultivariateContentMemento;
_numberOfFactors = numberOfFactors;
}