;+ NAME: ; xclip ;PURPOSE: ; Replaces with FLAGs the values of the array that are BEYOND ; the limits specified. ;CALLING SEQUENCE: ; xclip, amin, amax, y, flag=flag, _extra=_extra ;INPUT: ; amin, amax = the minumum and maximum values ; y = the input array ;OUTPUT: ; y = set to flag for points less than amin or greater than amax ;KEYWORDS: ; flag = the value that clipped data will be set to, the default is ; -0.0/0.0 (NaN) ;HISTORY: ; 2-feb-2007, jmm, jimm.ssl.berkeley.edu from Vassilis' ; clip_deflag.pro ; 9-feb-2007, change big value to Nan ; ;$LastChangedBy$ ;$LastChangedDate$ ;$LastChangedRevision$ ;$URL$ ;- Pro xclip, amin, amax, y, flag = flag, _extra = _extra If(keyword_set(flag)) Then big = flag Else big = -0.0/0.0 ;More than max value? ;less than min value? ss = where(y Lt amin Or y Gt amax, nss) If(nss Gt 0) Then y[ss] = big ;All Done Return End