Exemple #1
0
        // suggested in .99.1 version:
        /// <summary>
        /// Remove a number of adjacent rows from the table.  This routine
        /// was inspired by code by R.Mathar but re-implemented using changes
        /// in the ColumnTable class abd AsciiTable so that we can do
        /// it for all FITS tables.
        /// <param name="firstRow">The (0-based) index of the first row to be deleted.
        /// This is zero-based indexing: 0<=firstrow< number of rows.</param>
        /// <param name="nRow">The total number of rows to be deleted.</param>
        public virtual void DeleteRows(int firstRow, int nRow)
        {
            // Just ignore invalid requests.
            if (nRow <= 0 || firstRow >= NRows || nRow <= 0)
            {
                return;
            }

            /* correct if more rows are requested than available */
            if (nRow > NRows - firstRow)
            {
                nRow = NRows - firstRow;
            }

            table.DeleteRows(firstRow, nRow);
            myHeader.SetNaxis(2, NRows);
        }