----- file created by makedoc on: Thu Nov  5 15:14:58 2009
----- Documentation for /scisoft/xop2.3/extensions/shadowvui/src/lib/writesh.pro -----

 NAME:
	WRITESH
 PURPOSE:
	Template to create a SHADOW  file
 CATEGORY:
	SHADOW's utilities.
 CALLING SEQUENCE:
	writesh
	(or) writesh,'file'
	(or) writesh,'file',values,columns

 OPTIONAL INPUTS:
	file: File name to be written.
	values: an array (m,npoint) with the column values to be placed
		in the file. If a column value is not defined, the routine
		sets the default value (point source, directed in
		(0,1,0), with energy of 1000eV.)
	columns: an integer (or integer array) with the column numbers
		where to place the "values"
 OPTIONAL OUTPUTS:
	str: a named variable where to put the SHADOW structure

 KEYWORD PARAMETERS:
	EV: When set to 1, converts input column 11 (wavevector) from eV
		to cm**-1 (shadow's unit)
	NOFILE: Set this keyword to prevent writing a file (to be used
		with the STR keyword)

 OUTPUTS:
	A disk file.
 COMMON BLOCKS:
	None.
 SIDE EFFECTS:
	Create a file.
 RESTRICTIONS:
	None.
 PROCEDURE:
	Defines an idl/shadow structure with default values, change
	the values for the requires columns and write the file using
	PUTRAYS procedure.
 EXAMPLE: 
	Create a source with 1000 rays and "cubic" size in [0,1]x[0,1]x[0,1]
	;values = randomu(seed,3,1000) & columns=[1,2,3]
	writesh,'cubic.dat',randomu(seed,3,1000),[1,2,3]

	Create a source with 2000 rays with stepped energy in [0,1999] eV:
	writesh,'tmp.00',transpose(findgen(2000)),11,/ev
 MODIFICATION HISTORY:
	M. Sanchez del Rio. ESRF. Grenoble, 31 May 1996
	2006/04/24 srio@esrf.fr added NoFile and Str keywords

