----- file created by makedoc on: Thu Sep 11 15:03:13 2014
----- Documentation for /scisoft/xop2.4/extensions/shadowvui/src/lib/shresample.pro -----

 NAME:
	SHRESAMPLE
 PURPOSE:
	This function reads a Shadow file/structure and resamples
	it in another one with less rays, but all rays have intensity one
 CATEGORY:
	SHADOW's utilities.
 CALLING SEQUENCE:
	result = shResample(shadow_in)
 INPUTS:
	shadow_in: The IDL structure with SHADOW data
 OUTPUTS:
	 Result: The IDL/Shadow structure of the resampled beam
 KEYWORD PARAMETERS (INPUT):
	SEED = Initialization for the random sample generator randomu1()
	_Extra = extra keywords accepted by ShRead()

 ALGORITHM: 
        A variance reduction technique: a number of random numbers
        equal to the number of raysis created. For each ray, if the 
        intensity if smaller than the corresponding random value, the ray 
        is discarded. The intensity of the good (not discarted) rays is then 
        set to one. 

 MODIFICATION HISTORY:
	M. Sanchez del Rio. ESRF. Grenoble May 2007


