; NAME: ; COSRAYS ; ; PURPOSE: ; This function returns and array of cosmic rays to be added ; ; CALLING SEQUENCE: ; Result = COSRAYS (raymask, maxval) ; ; INPUTS: ; Raymask = The boolean frame that marks the cosmic ray locations ; Maxval = The maximum value cosmic rays are to have (in terms of ; photons) ; ; OUTPUT: ; An array with cosmic rays, and all else 0 ; ; PROCEDURE: ; First find the locations with cosmic rays, then and the cosmic ; ray's light to the locations ; ; MODIFICATION HISTORY: ; created Jun 13 2003 by John Dermody function COSRAYS, raymask, maxval ; copy so we arn't malicious rayframe = 1. - float(raymask) ; get sizes nx = (size(inframe))[1] ny = (size(inframe))[2] ; add rays badloc = where(rayframe eq 1) if (badloc eq [-1]) then return, rayframe nbad = (size(badloc))[1] rayframe[badloc] = maxval * (randomu(seed, nbad)^2) return, rayframe end