Beispiel #1
0
		/// <summary>
		/// Returns the corresponding x-values of the spectra (In fact only the first spectra is used to determine which x-column is used).
		/// </summary>
		/// <param name="srctable">The source table where the data for the spectra are located.</param>
		/// <param name="spectrumIsRow">True if the spectra in the table are organized horizontally, false if spectra are vertically oriented.</param>
		/// <param name="spectralIndices">The selected indices wich indicate all (wavelength, frequencies, etc.) that belong to one spectrum. If spectrumIsRow==true, this are the selected column indices, otherwise the selected row indices.</param>
		/// <param name="measurementIndices">The indices of all measurements (spectra) selected.</param>
		/// <returns>The x-values corresponding to the first spectrum.</returns>
		public static double[] GetXOfSpectra(Altaxo.Data.DataTable srctable, bool spectrumIsRow, Altaxo.Collections.IAscendingIntegerCollection spectralIndices, Altaxo.Collections.IAscendingIntegerCollection measurementIndices)
		{
			if (srctable == null)
				throw new ArgumentException("Argument srctable may not be null");

			int group;
			Altaxo.Data.INumericColumn col;

			if (spectrumIsRow)
			{
				group = srctable.DataColumns.GetColumnGroup(spectralIndices[0]);

				col = srctable.PropertyColumns.FindXColumnOfGroup(group) as Altaxo.Data.INumericColumn;
			}
			else // vertical oriented spectrum
			{
				group = srctable.DataColumns.GetColumnGroup(measurementIndices[0]);

				col = srctable.DataColumns.FindXColumnOfGroup(group) as Altaxo.Data.INumericColumn;
			}

			if (col == null)
				col = new IndexerColumn();

			double[] result = new double[spectralIndices.Count];

			for (int i = 0; i < spectralIndices.Count; i++)
				result[i] = col[spectralIndices[i]];

			return result;
		}
Beispiel #2
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                IndexerColumn s = null != o ? (IndexerColumn)o : new IndexerColumn();

                return(s);
            }