;+ ; NAME: ; ARRDELETE ; ; AUTHOR: ; Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770 ; craigm@lheamail.gsfc.nasa.gov ; ; PURPOSE: ; Remove a portion of an existing array. ; ; CALLING SEQUENCE: ; NEWARR = ARRDELETE(INIT, [AT=POSITION,] [LENGTH=NELEM]) ; ; DESCRIPTION: ; ; ARRDELETE will remove or excise a portion of an existing array, ; INIT, and return it as NEWARR. The returned array will never be ; larger than the initial array. ; ; By using the keywords AT and LENGTH, which describe the position ; and number of elements to be excised respectively, any segment of ; interest can be removed. By default the first element is removed. ; ; INPUTS: ; ; INIT - the initial array, which will have a portion deleted. Any ; data type, including structures, is allowed. Regardless of ; the dimensions of INIT, it is treated as a one-dimensional ; array. If OVERWRITE is not set, then INIT itself is ; unmodified. ; ; KEYWORDS: ; ; AT - a long integer indicating the position of the sub-array to be ; deleted. If AT is non-negative, then the deleted portion ; will be NEWARR[AT:AT+LENGTH-1]. If AT is negative, then it ; represents an index counting from then *end* of INIT, ; starting at -1L. ; Default: 0L (deletion begins with first element). ; ; LENGTH - a long integer indicating the number of elements to be ; removed. ; ; OVERWRITE - if set, then INIT will be overwritten in the process of ; generating the new array. Upon return, INIT will be ; undefined. ; ; COUNT - upon return, the number of elements in the resulting array. ; If all of INIT would have been deleted, then -1L is ; returned and COUNT is set to zero. ; ; EMPTY1 - if set, then INIT is assumed to be empty (i.e., to have ; zero elements). The actual value passed as INIT is ; ignored. ; ; RETURNS: ; ; The new array, which is always one-dimensional. If COUNT is zero, ; then the scalar -1L is returned. ; ; SEE ALSO: ; ; STORE_ARRAY in IDL Astronomy Library ; ; MODIFICATION HISTORY: ; Written, CM, 02 Mar 2000 ; Added OVERWRITE and EMPTY1 keyword, CM 04 Mar 2000 ; ; $Id: arrdelete.pro,v 1.2 2001/03/25 18:10:41 craigm Exp $ ; ;- ; Copyright (C) 2000, Craig Markwardt ; This software is provided as is without any warranty whatsoever. ; Permission to use, copy, modify, and distribute modified or ; unmodified copies is granted, provided this copyright and disclaimer ; are included unchanged. ;-