		
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
	&&&&&&&&&&&         PROW  		   &&&&&&&&&&&
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
	&&&&&&&&&&&  PRofile-fitting of Overlapped  &&&&&&&&&&& 
	&&&&&&&&&&&           and/or Weak           &&&&&&&&&&&
	&&&&&&&&&&&      protein diffraction data   &&&&&&&&&&&
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
	&&&&&&&&&&&	      Vsn1.3.2	    &&&&&&&&&&&
	&&&&&&&&&&&	Dominique Bourgeois	    &&&&&&&&&&&
	&&&&&&&&&&&	  bourgeoi@esrf.fr	    &&&&&&&&&&&
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

***********************************************************
*** Version *** --> PROW1.3.3 / XOP2.3
***********************************************************

THIS README FILE IS A CONCATENATION OFF THE FOLLWING FILES
THAT YOU MAY WANT TO STUDY INDIVIDUALLY

INSTALLATION.help  
USING_PROW_GUI.help
PROW_IN_BATCH_MODE.help
HOW_TO_USE_DENZO_BEFORE_PROW.help 
SETTING_INTEGRATION_PARAMETERS.help
SETTING_CONVERSION_PARAMETERS.help              
VERSION_HISTORY.help
EXCLUDE_OPTIONS.help 


*** AVAILABLE OPERATING SYSTEMS: ****
PROW runs under UNIX, and is available for the following types
of operating systems:
HPUX (Hewlett Packard)
IRIX (Silicon Graphics)
LINUX (PC)
SUNOS (Sun)
ALPHA (Dec)

*** IT IS ADVISABLE TO HAVE A LOT OF RAM ON YOUR COMPUTER ****
--> typically 256Mb, more is advisable.


*** INSTALLATION OF PROW ***
The program PrOW runs under a commercial software called IDL 
(Interactive Data Language). However, the ESRF has purchased 
a license that allows to distribute PROW freely, as part of a 
larger suite of programs developped under IDL and called XOP.
Therefore, PROW is distributed as an extension to XOP, in an
encapsulated mode. In getting PROW, you also get XOP, which is
a very powerful program to do ray tracing, and design beamline
optics. If you are not interested in XOP, just forget it after
installation is completed.
If you have already the IDL software, PROW can be installed 
directly.

***********************************************************
A/ *** Install the software (xop + prow) ***
***********************************************************
(Additional information can be found on the ESRF WEB)

A1/ Create a diectory 'xop_dir' where xop2.0 will be put.
[xop_dir should be something like /usr/local/bin/xop2.0/ or anywhere you like]

A2/ Copy all the xop tree into 'xop_dir'. 
If (xop+prow) has been distributed as a 'tar' file, just copy this file into
'xop_dir' and untar (tar xvf 'tarfile') from there.

A3/ In 'xop_dir' there is a script-file called 'xop': modify this file so that
XOP_HOME='xop_dir'

***********************************************************
B/ *** Check files ***
***********************************************************

B1/ All the files related to PROW should be in the directory 
'xop_dir'/extensions
The file 'prow.sav' contains most of the PROW code.
The file 'batch_prow.sav' and 'batch_prow.com' allow to run PROW 
integration in batch mode
The file 'batch_convert.sav' and 'batch_convert.com' allow to run 
PROW conversion in batch mode

B2/ PROW is calling C programs. These programs are compiled in the form 
of 'shared libraries', and are located in directories 
'xop_dir/extensions/PROW/system_name', where 'system_name' is the name of your 
system: HPUX for HP, SGI for Silicon Graphics, LINUX for Linux, Sun for sun, 
DEC for DEC.
There should be 7 '.so' files in the directory 'xop_dir/extensions/PROW/system_name'

B3/ HELP files are located in the directory 'xop_dir/extensions/PROW/HELP/

***********************************************************
C/ *** Starting the PROW Graphical User Interface (GUI) ***
***********************************************************

XOP is started with: -> 'xop_dir'/xop (the script file 'xop' must be 
executable: (chmod a+x xop))

Prow is started with -> 'xop_dir'/xop prow

It is nice to define an alias in your .cshrc file like:
-> alias prow 'xop_dir'/xop prow
So that typing just 'prow' will start the prow GUI.

The default directory where images are looked for in Prow is defined by an 
environment variable called $DATA. 
Some other files like prow integration parameters are looking in $PRED. 
So to easily access your data, put in your .cshrc file:
setenv DATA where_your_data_are
setenv PRED where_your_parameters_are
or:
setenv DATA where_your_data_are
setenv PRED $DATA

***********************************************************
D/ *** Running PROW in batch mode:
***********************************************************
In the 'xop_dir'/extensions directory, there are two files: 
'batch_prow.sav' and 'batch_convert.sav'.
There are also two command files:
'batch_prow.com' and 'batch_convert.com'

In batch_prow.com, replace the line 
'xop_batch_prow' by 'xop_dir'/xop batch_prow 
In batch_convert.com, replace the line 
'xop_batch_convert' by 'xop_dir'/xop batch_convert 
 
Make these two .com files executable.
chmod a+x batch_prow.com
chmod a+x batch_convert.com

It is convenient to define the following aliases in ~/.cshrc:
alias batch_prow xop_dir/extensions/batch_prow.com
alias batch_convert xop_dir/extensions/batch_convert.com

For how to use batch_prow and batch_convert, see the file
PROW_IN_BATCH_MODE.help



THE FOLLOWING CONCERNS INSTALLATION OF PROW FOR USERS ALREADY HAVING IDL.
(NON-ENCAPSULATED VERSION)

--> Create a directory "where_is_the_source_code" where PROW will be unloaded
--> Uncompress PROW with uncompress prow_vsn?.?.?.tar.Z
--> Unload PROW with tar xvf prow_vsn?.?.tar *
--> Make sure scripts in '/where_is_the_source_code/scr' are executable.
--> If necessary recompile all .c programs in '/where_is_the_source_code/cprog/SRC/',
by proper modification of '/where_is_the_source_code/cprog/SRC/Makefile'.
The C routines have been compiled optimally for  HPUX/PA8000 and SGI/IRIX6.2. 
as well as for LINUX and DEC.

--> Define a startup IDL file called ".idl_prow", as shown in the following :
SETUP_KEYS
SET_PLOT,'x'
!PATH = '/where_is_the_source_code/read:' + !PATH
!PATH = '/where_is_the_source_code/main:' + !PATH
!PATH = '/where_is_the_source_code/aux:' + !PATH
!PATH = '/where_is_the_source_code/misc:' + !PATH
!PATH = '/where_is_the_source_code/cprog:' + !PATH
!PATH = '/where_is_the_source_code/batch:' + !PATH
!PATH = '/where_is_the_source_code/pred:' + !PATH
!PATH = '/where_is_the_source_code/gui:' + !PATH
!PATH = '/where_is_the_source_code/cryst:' + !PATH

--> Modify your .cshrc script as follows :
#PROW (Integration program, /IDL)
 # STARTUP FILE : define all the paths
setenv IDL_STARTUP	~/.idl_prow
 # Cfiles directory : the shared object libraries (.so files) are located in this directory
 
 # Main PROW directory
setenv PROW_DIR		/where_is_the_source_code/
 # IF HPUX 
setenv PROW_C 		${PROW_DIR}/cprog/SRC/HPUX/ 
 # IF SGI 
 #setenv PROW_C 		${PROW_DIR}/cprog/SRC/SGI/ 

 # Cfiles directory : some shell scripts are located in this directory
setenv PROW_SCR 	${PROW_DIR}/scr/

 # Help directory : some help files are located in this directory
setenv PROW_HELP 	${PROW_DIR}/help/

 # DATA directory : images will be looked for in this directory by default
 # this directory can be changed according to needs
setenv DATA	 	~/MYDATA/
 # PRED directory : predictions will be looked for in this directory by default
 # this directory can be changed according to needs
setenv PRED	 	~/MYPREDICTIONS/

IF RUNNING LAUE INTEGRATION WITH PROW :
 --> some CCP4 Laue suite routines must be accessed. The
executables of the suite should be in directory $LBIN (see your 
ccp4.setup file)
--> If necessary recompile the C routine modif_geasc.c


*** STARTING PROW from IDL ****

--> To start PROW, just type, depending on the image format in use :

IDL> prow

You can also choose a format at startup time :
PROW,format='myformat' 
my_format can be :
 mar18 --> MAR 18 CM  image plate scanner [the default]
 mar30 --> MAR 30 CM  image plate scanner 
 mar345 --> MAR 345 MM  image plate scanner  
 marccd --> MAR CCD detector
 edf --> EDF format for EMBL Weisssenberg IP scanner.
 binary2 --> 2bytes integer binary format
 binary4 --> 4bytes integer binary format
 esrf --> ESRF data format (2 bytes)
 esrf_long --> ESRF data format (4 bytes)

if using binary format, you can specify xs=my_xsize and ys=my_ysize. The defaults
is 1242*1152 (ESRF PRINCETON CCD camera)

if using binary or ESRF format, you add the keyword /FRELON to specify that you are
using the FRELON CCD camera.

if you have an image in mind, you can also type : PROW,format='my_format',file='myimage'

Some exemples :
 prow,file='/users/me/my_mar18cm.image'
 prow,format='mar30'
 prow,format='binary2',xs=1200,ys=1287
 prow,format='esrf',/FRELON
 prow,format='edf',file='my_edf_format.image'





		
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
	&&&&&&&&&&&         PROW  		   &&&&&&&&&&&
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
	&&&&&&&&&&&  PRofile-fitting of Overlapped  &&&&&&&&&&& 
	&&&&&&&&&&&           and/or Weak           &&&&&&&&&&&
	&&&&&&&&&&&      protein diffraction data   &&&&&&&&&&&
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
	&&&&&&&&&&&	      Vsn1.3.2	    &&&&&&&&&&&
	&&&&&&&&&&&	Dominique Bourgeois	    &&&&&&&&&&&
	&&&&&&&&&&&	  bourgeoi@esrf.fr	    &&&&&&&&&&&
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

***********************************************************
*** Version *** --> PROW1.3.2 / XOP2.0 
***********************************************************

*** TIPS FOR USING THE PROW GRAPHICAL USER INTERFACE

**************************************************************
VERY IMPORTANT
**************
Don't forget to read the 'info' line that stands
above the analysis-> menu.
If the program seems to hang, it is probably that you have not
followed the information displayed on this 'info' line.
Remember that most routines must be exited with a right-mouse
click. If you start a next routine without having quit the 
preceding one, this next routine will not be executed until a 
right-mouse click is given. Once you give this right-mouse 
click, all the operations that you have tried to do will be
executed in series.
**************************************************************

**************
Pixel position/value/resolution
**************
When the mouse is moved on the main or zoom window, you can follow
the X,Y value of the current pixel, its Z value [pixel intensity], and
possibly the resolution of the pixel. For the resolution to be correct
the menu: diffraction->enter_view_diffraction_parameters must be filled
correctly.

**************
Logarithmic display
**************
You can try that. Usually the contrast is better when logarithmic display
is on.

**************
Cursor input style
**************
Use 'track cursor' to refresh the zoom window at every mouse displacement

**************
Interpolation style
**************
By default the display in the zoom window is interpolated (smoothed).
At large zoom values this might not be adequate. Switch to non interpolated
mode in this case.

*************
Changing Zoom window size
*************
This can be done using the menu load->change_zoom_window_size

*************
Changing Study window size
*************
This can be done using the menu load->change_study_window_size

*** LOOKING AND ANALYZING IMAGES ***

This help file is under development ...
The menus are relatively obvious though ...
		
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
	&&&&&&&&&&&         PROW  		   &&&&&&&&&&&
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
	&&&&&&&&&&&  PRofile-fitting of Overlapped  &&&&&&&&&&& 
	&&&&&&&&&&&           and/or Weak           &&&&&&&&&&&
	&&&&&&&&&&&      protein diffraction data   &&&&&&&&&&&
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
	&&&&&&&&&&&	      Vsn1.3.2	    &&&&&&&&&&&
	&&&&&&&&&&&	Dominique Bourgeois	    &&&&&&&&&&&
	&&&&&&&&&&&	  bourgeoi@esrf.fr	    &&&&&&&&&&&
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

***********************************************************
*** Version *** --> PROW1.3.2 / XOP2.0 
***********************************************************

**************************************************
*** HOW TO RUN INTEGRATION WITH PROW GUI
**************************************************
Once proper parameters for integration have been properly
defined, the integration can be carried out through the
PROW GUI with menu:
integration->integrate

Similarly, once proper parameters for conversion have been properly
defined, the conversion can be carried out through the
PROW GUI with menu:
integration->convert

It is advised to do that only for 1 or a few images. For the bulk of
the job, it is much preferable to use the batch mode.
 
**************************************************
*** HOW TO RUN PROW INTEGRATION IN BATCH MODE
**************************************************
The file 'batch_prow.com' allows to run PROW integration in batch mode
The file 'batch_convert.com' allows to run PROW conversion in batch mode
These files are located in directory 'xop_dir'/extensions

A/ batch_prow.com
The input parameters to the batch_prow command file are :
# 1/ the name of the main .idl file containing integration parameters 
[saved from menu: integration->integration_parameters->save_parameters]
# 2/ the starting image number (the number specified in the .idl command 
file is not taken into account)
# 3/ the ending image number (the number specified in the .idl command file 
is not taken into account) 
# 4/ the number of images to be integrated during each subsession.
Because of a memory leak intrinsic to IDL, we split the session into several
sub-sessions. In each sub-session, a number of images 
(typically 10 to 30 depending  on the computer RAM and on the image size and 
number of predicted spots) are processed. 
All the sub-sessions are run automatically.
# 5/ set to 'yes' if an old reference file is used.
# 6/ if $5 is set to 'yes', the name of the reference profile file

EXEMPLE: batch_prow.com my_parameters.idl 1 90 30
-> will use parameters 'my_parameters.idl' 
-> will integrate images 1 to 90
-> in sessions of 30 images (ie 3 sessions) to preserve memory.

B/ batch_convert.com
# The input parameters to the command file are :
# 1/ the name of the main .idl file containing conversion parameters.
[saved from menu: integration->conversion_parameters->save_parameters]
# 2/ the starting image number (the number specified in the .idl command file is not taken into account)
# 3/ the ending image number (the number specified in the .idl command file is not taken into account)

EXEMPLE: batch_convert.com my_conversion.idl 1 90 
-> will use parameters 'my_conversion.idl' 
-> will convert images 1 to 90




		
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
	&&&&&&&&&&&         PROW  		   &&&&&&&&&&&
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
	&&&&&&&&&&&  PRofile-fitting of Overlapped  &&&&&&&&&&& 
	&&&&&&&&&&&           and/or Weak           &&&&&&&&&&&
	&&&&&&&&&&&      protein diffraction data   &&&&&&&&&&&
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
	&&&&&&&&&&&	      Vsn1.3.2	    &&&&&&&&&&&
	&&&&&&&&&&&	Dominique Bourgeois	    &&&&&&&&&&&
	&&&&&&&&&&&	  bourgeoi@esrf.fr	    &&&&&&&&&&&
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

***********************************************************
*** Version *** --> PROW1.3.2 / XOP2.0 
***********************************************************


*** INDICATIONS TO PREPARE .X DENZO FILES FOR PROCESSING WITH PROW.

The idea is to generate all the predictions with DENZO, taking 
advantage of the excellent refinement capabilities of this program. 
ALL spots should be predicted with DENZO, not only the good ones: 
saturated spots, overlapped spots, spots with a faulty background 
should be predicted so that PROW can deal with them.
From the DENZO predictions and the images, PROW will perform an 
accurate integration,and generate new files in a special format 
(.prow files). In a second step, these .prow files will be converted 
back into .x files, having the DENZO format, and which canbe used as 
usual for further scaling.

The strategy is thus the following:
A/ Run a DENZO session in the following way: refinement should be 
carried out with only good spots, and a 'dummy' integration should 
follow for ALL spots:
***********************
start refinement
overlap spot
reject fraction 0.75
overload value 65000
reject slope 50
fit bla bli blo and what you like

ovlp none
reject fraction 0.2
overload value 500000
reject slope 5000
calculate go
**********************

B/ Define the proper integration parameters for PROW
C/ Define the proper conversion parameters for PROW
D/ Run a PROW integration session using the batch mode (batch_prow.com)
E/ Run a PROW convertion session using the batch mode (batch_convert.com)

Steps D/ and E/ can be run in a single command file. Or possibly steps 
A/, D/ and E/ if all the parameters for PROW have been correctly defined
in advance.

		
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
	&&&&&&&&&&&         PROW  		   &&&&&&&&&&&
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
	&&&&&&&&&&&  PRofile-fitting of Overlapped  &&&&&&&&&&& 
	&&&&&&&&&&&           and/or Weak           &&&&&&&&&&&
	&&&&&&&&&&&      protein diffraction data   &&&&&&&&&&&
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
	&&&&&&&&&&&	      Vsn1.3.2	    &&&&&&&&&&&
	&&&&&&&&&&&	Dominique Bourgeois	    &&&&&&&&&&&
	&&&&&&&&&&&	  bourgeoi@esrf.fr	    &&&&&&&&&&&
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

***********************************************************
*** Version *** --> PROW1.3.2 / XOP2.0 
***********************************************************

**************************************************
*** CHOOSING PARAMETERS FOR INTEGRATION WITH PROW.
**************************************************
Once you have run a preliminary DENZO session, start the PROW
GUI, load an image, and load the corresponding predictions from
DENZO.

*** To load an image: ***
A1/ Choose the proper image format in menu:
load->file_format
A2/ Load the image in menu:
load->load_file
A3/ Adjust the colors in menu:
colors->
If the option colors->b/w(saturated in red) has been chosen
then the saturation value taken into account is the one defined
in menu detector_parameters-> and all pixels having or exceeding
the saturation value will be marked in red.

*** To load the corresponding predictions: ***
A1/ Choose the proper prediction format in menu :
analysis->predictions->parameters
A2/ Load the predictions in menu :
analysis->predictions->load
Predictions are marked by squares, whose size correspond to the
chosen boxsize. 


For running a good integration session with PROW, a number of
parameters must be set.
-> These parameters are entered in menu:
integration->integration_parameters->enter_view_parameters

-> The parameters can be saved in (binary) files, in menu:
integration->integration_parameters->save_parameters

-> The parameters can be restored from (binary) files, in menu:
integration->integration_parameters->load_parameters

-> Some of these parameters are obvious: like filenames.
-> Some others are less obvious: however there are routines
to help figuring out these. Also, many of the parameters are 
automatically adjusted during integration and the defaults
values will do.

*** OBVIOUS PARAMETERS THAT MUST BE ENTERED  ****
-> Xsize of image
-> Ysize of image
-> Raster size of detector
-> Saturation value of the detector
-> Detector type [note that 'ccd' refers to images of binary format 
without a header, with 2 bytes per pixel, and xsize/ysize as defined]
-> Resolution limits [use 1000 0.1 to integrate the whole resolution
range from DENZO ; Useful for a first test to integrate only low 
resolution data.]
-> All the various filenames.


*** OTHER PARAMETERS THAT MUST BE ENTERED BY USER IN ORDER OF PRIORITY ****

1/ *** Box-size and overlap distance (automatic optimisation)
(at present ONLY SQUARE BOXES are used)
--> Use integration->estimate_box_size_and_overlap_distance. 
1a/ You must have loaded some predictions first. When using denzo predictions, 
the raster size is not automatically obtained from .x files, so, depending 
on the image format, it is very important that the proper pixel size be 
entered manually in menu diffraction->enter_view_diffraction_parameters. 
1b/ Choose the image area to pick spots. 
1c/ Run the routine. Look at the proposed values. 
If they make sense, use them. If not, retry with less, lower resolution 
spots, or choose values manually with the help of the analysis-> menu. 
1d/ The 'overlap distance for selection of reference spots' and 'maximum 
distance for overlap deconvolution' are automatically set to 1/4 of the 
determined overlap distance.


1bis/ *** Box-size and overlap distance (manual optimisation)
If the automated optimization was not successful, a manual choice has to
be made:
1bis-a/ Box-size (at present USE ONLY SQUARE BOXES OF ODD PIXEL NUMBERS)
--> Use analysis->spot_shape->show with different boxsizes, and look at 
spots at say 10% of maximum. The border of the 3D profile should fall into
noise on all sides.

1bis-b/ Overlap distance
--> Use analysis->FWHM->calculate for contour at 5 to 10% depending 
on image quality. Look at several spots and take a compromise of the 
calculated long axes as the overlap distance. Be generous. The overlap 
distance must be given in [mm], whereas the long axes are given in [pixels] 
so overlap_distance=pixel_size*(average_long_axes).

1bis-c/ Overlap distance for selection of reference spots:
Set it to overlap distance/4.0 
1bis-d/ Maximum distance for overlap deconvolution.
Set it to overlap distance/4.0 


Note about overlap distance: the entered value corresponds to the distance
for which spots separated by less than this distance will be checked for
overlap deconvolution. Spots separated by more than this distance will never
be deconvoluted, even if they are actually spatially overlapped. Spots 
separated by less than this distance will be actually deconvoluted only if 
their optimized profile fitting area are found to intersec. This means that
the overlap distance can be chosen quite generously, and that only those 
spots that necessitate deconvolution will be deconvoluted.  

2/ *** The fitting-area ****
In PrOW, the 'fitting area' (equivalent of 'spot radius' or 'spot elliptical' 
is optimized individually for each spot. However, it is preferable to set 
a maximum size for this fitting area so that it can not end up being 
enormously big. The maximum size of the fitting area is like a 'restrain', 
and is determined by the user in the following way:
--> Use the integration->restrain_fitting_area and follow instruction. 
Pretty similar than the determination of box size and overlap distance.  
The proper box-size must have been chosen before.
Once you are asked to draw the restrained fitting area, generally choose a 
circle or an ellipse, and draw generously around the displayed average-spot shape. 

3/ *** The maximum oscillation distance for reference peak search ***
This should be set to approximately the oscillation range through which the 
spot shape in the images do not radically change. 
So more radiation damage, or more anisotropy means reducing this 
oscillation distance. In general, take the equivalent of 5 to 10 images.

4/ *** Radial & Angular distance for reference peak search
In general, the worse your images, the larger the Radial & Angular distance 
should be.
Increase if you get an error message like 
'Choose larger area for reference peak search'. 

5/ ***  Maximum number of reference peaks.
Increase if your images are really great. 


6/ *** Masks
Masks can be applied to mask out ill defined regions of the image.
Two masks can be provided called 'beamstop mask' and 'mask'.
Use the menu:
integration->define_mask
The name of the mask files that you can create in this way are entered
in integration->integration_parameters->enter_view_parameters


7/ For all other parameters, use the default values, unless you want
to play.
 
In the following, these parameters are explained:

7a/ *** Local refinement : 0
Set to 1 if you want to refine the predictions locally
to center of gravity, 0 if no local prediction change.
Set to 1 only if indexing refined very poorly. Local
refinement takes time, and in most cases improves only
marginally. It may also introduce some bias.

7b/ *** Number of excluded pixels around spot area for background 
calculation [raster] : 1
In each sector, the pixels that are allowed to contribute to background
selection are limited. They cannot lie within the fitting area corresponding 
to any spot, plus a safety margin defined by this parameter. 
A safety margin of 1 or 2 pixels is OK. In case of crowded patterns
(Laue), all pixels within a box may easily end up belonging to neighbour 
spot areas, which has the effect that the background calculation may get 
spurious. In such a case, it is preferable not to use any safety margin.

7c/ *** Reference spots files already existing : 0
set to 0 if reference spots are to be (re)calculated.
set to 1 if old .ref files are to be used instead (this is 
usually a bad idea, unless you are sure of what you are doing, for
exemple no conflict is introduced by changing integration parameters)

7d/ *** Reinterpolate according to experimental spots position : 0
Not recommended. It may introduce systematic errors, even if
the statistical factors get better.

7e/ *** Offset value of the detector : 0
offset of the detector [counts] (0 for MAR IP detectors)

7f/ *** Gain of the detector at 1.5418 A (CuKalpha) : 1.2
(1.2 for MAR IP detectors ; 0.73 for ESRF XRII @ F/11 NA)
(1.2 for MAR 345 detectors)
Experimentally, it is found that higher values tend to give better results : 
multiply the theoretical value by ca 1.8.

7g/ ***Initial percentage of background pixels in integration box : 25
Initializes the selection of background pixels [%] in the box. 
Example : if 25 [%] is selected, then the 25% lower value pixels will be 
taken as a first set of background pixels. The correct and final value will be 
adjusted by the program. Use 25%, this is fine. Consider increasing only if
;the integration box is really big.

7h/ *** Number of sectors for reference peak search : 18
This is the number of sectors in the image where reference profiles
will be searched. This aims at getting a better coverage, ie a more
uniform distribution of the reference profiles. The minimum value
is 2, ie one inner (from center to 2/3 of the image radius) and one 
outer (from 2/3 to 1 image radius) sector.

7i/ *** Maximum number of reference peaks : 200
7j/ *** Minimum number of reference peaks : 50
maximum,minimum number of reference peaks for each image.
The maximum number is only important if 'Maximum oscillation
distance' is not set to zero. In such a case, tons of reference
spots may be selected and a maximum value < 1000 is a good idea.
The minimum number sets a compromise between the quality and
the quantity of selected reference spots. If the value is high,
more reference spots of lesser and lesser quality will be added.
Only critical for poor data sets, when 'Maximum oscillation
distance' is not set.

7k/ *** Minimum I/Sig(I) for initial selection of reference peaks : 3.0
This will help determine the first selection of reference spots.
Lower the value for poor data sets, but if you don't do it, the
program will do it for you, it will just take more time to figure
it out. Conversely, if you set the value too low, a lot of firstly
selected reference spots will have to be thrown away, which again
slows down the program. Try intial value between 2 and 4.

7l/ *** Alow partial for selection of reference peaks : 1
If YES set to 1, else to 0
The theory tells NO, the practise tells YES. So ...
usually Yes, unless profiles from partials differ from
profiles of fullies, and images are really of good quality.

7m/ *** Maximum oscillation distance for reference peaks search : 4
Allowed oscillation distance for selection of reference peaks
in [degree]. This allows to extend the selection of reference
spots to neighbouring images. At the moment, only PREVIOUSLY
integrated images. This helps A LOT for bad data sets, and
especially when everything is overlapped. However, to restart 
a session which has crashed, you have to use the IDL batch file:
batch_integ,file='my_integ_parameters_file',RESTART='the_.ref_filename_of_the
last_successfully_integrated_image'.

7n/ *** Radial distance for reference peaks search : 50
Radial distance [mm] to look around for getting the reference peak when 
integrating a weak or overlapped peak by profile fitting.
Will be increased automatically if necessary, but only up to a certain
point. If this point is reached, it is considered that the image can
not be integrated in a correct way.

7o/ *** Angular width for reference peaks search : 30 
Angular distance [degrees] to look around for getting the reference peak when 
integrating a weak or overlapped peak by profile fitting.
Will be increased automatically if necessary, but only up to a certain
point. If this point is reached, it is considered that the image can
not be integrated in a correct way.

7p/ *** Search reference peaks in symmetrical sector if necessary : 1
in case reference peaks are too few, give the possibility to extend the search 
to symmetrical regions of the image (normally no, unless there is
good isotropy of the spot shapes. Usually the case for Laue images)

8/ ****  PARAMETERS FOR DISPLAY AND "DEBUGGING"  ****

8a/ *** Show image during integration : 0
Set to 0 to avoid using graphics or 1 to get image displayed
(with predictions etc). (Set to 1 if any of the SHOW parameters
below is set to 1.)
Displaying images is nice, but slows down integration.

8b/ *** Show reference peaks during integration : 0
8c/ *** Show strong peaks during integration : 0
8d/ *** Show weak peaks during integration : 0
8e/ *** Show overlaped peaks during integration : 0
Set all these to 0 unless you want to have fun and
follow integration step by step. This can be quite
some fun, and should be tried at least once (but one
after the other, not all together, this would make a mess)

8f/ *** Show a defined [h,k,l] : 0
Reflection to be seen : 1 7 -12
Set to 1 if a particular reflection is to be studied.
Can be very useful to track what happened to some curious
results


		
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
	&&&&&&&&&&&         PROW  		   &&&&&&&&&&&
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
	&&&&&&&&&&&  PRofile-fitting of Overlapped  &&&&&&&&&&& 
	&&&&&&&&&&&           and/or Weak           &&&&&&&&&&&
	&&&&&&&&&&&      protein diffraction data   &&&&&&&&&&&
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
	&&&&&&&&&&&	      Vsn1.3.2	    &&&&&&&&&&&
	&&&&&&&&&&&	Dominique Bourgeois	    &&&&&&&&&&&
	&&&&&&&&&&&	  bourgeoi@esrf.fr	    &&&&&&&&&&&
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

***********************************************************
*** Version *** --> PROW1.3.2 / XOP2.0 
***********************************************************

**************************************************
*** CHOOSING PARAMETERS FOR CONVERSION WITH PROW.
**************************************************
This step is very simple. It is used to convert .prow files
back into the normal .x format suitable for further scaling
of the data. However a few filters are used at this stage, like
removal of potential ice spots, zingers, spots with abnormally low 
intensities, spots with a faulty background or faulty integrated
intensities. 

Essentially you only need to enter correct filenames and 
turn on or off the filters.

-> Conversion parameters are entered in menu:
integration->conversion_parameters->enter_view_parameters

-> The parameters can be saved in (binary) files, in menu:
integration->conversion_parameters->save_parameters

-> The parameters can be restored from (binary) files, in menu:
integration->conversion_parameters->load_parameters

-> *** The different filters ****
1/ Remove overlapped spots : 0
;You don't want to do that, otherwise don't
;use PROW. But can be useful to see the degradation brought
;by overlapped spots.

2/ Remove spots with large RMS deviations : 1
;Use this option to try to remove non sense intensities
;based on deviation from the average value in the resolution bins.
;Can be very useful to get rid of ice spots or zingers on ccd detectors.

3/ Remove outliers : 1
;Good idea to set to 1, unless you have a largely redundant data set. 
BEWARE, the DEFAULY IS SET TO 0, ie not remove outliers. 

3bis/ Resolution limits to keep profile fitting outliers : 0.1
;Usulally, and especially if you use the option "Combine profile fitted 
;with box integrated intensities", you want to keep the reflections flaged
;as being outliers for bad profile-fitting. In such a case, input a value
;inferior to the high resolution limit of the data. Otherwise, if 'remove
;outliers' has been set to 1, the data with bad profile fitting and whose 
;resolution is < the given value, will be thrown away.
;Don't bother with this, set to 0.1: The net effect is that only the outliers
;with faulty background subtraction will be removed.

4/ Remove too large negative intensities : -5000
;A good idea to use that. Such reflexions are usually nonsense, they will
;not be recovered properly by truncate or similar program.


-> For all other parameters keep the default, unless you want to play. 

Combine profile fitted with box integrated intensities : 1
;This is strongly advised (at least for monochromatic data).
;Based on the chi_square test of the
;profile fitted intensities, more or less weight is given to the
;box integrated value.

Scale down intensities : 0
;Don't do that, unless the values are so big they don't fit in the DENZOX format.
;This is never the case anyway.

Keep reflexions only in a limited region : 0
;Set to 0 if not (the usual case), to 1 if Yes.
Minimum distance to beam center to keep reflexions : 0.000
Maximum distance to beam center to keep reflexions : 10000.
;If 'Keep reflexions only in a limited region' has been set to 1,
;Enter the low and high limits. Don't bother with this.









		
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
	&&&&&&&&&&&         PROW  		   &&&&&&&&&&&
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
	&&&&&&&&&&&  PRofile-fitting of Overlapped  &&&&&&&&&&& 
	&&&&&&&&&&&           and/or Weak           &&&&&&&&&&&
	&&&&&&&&&&&      protein diffraction data   &&&&&&&&&&&
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
	&&&&&&&&&&&	      Vsn1.3.2	    &&&&&&&&&&&
	&&&&&&&&&&&	Dominique Bourgeois	    &&&&&&&&&&&
	&&&&&&&&&&&	  bourgeoi@esrf.fr	    &&&&&&&&&&&
	&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

***********************************************************
*** Version *** --> PROW1.3.2 / XOP2.0 
***********************************************************

*** HISTORY OF THE PROW VERSIONS


 &&&&&&&  NEW FEATURES OF PROW vsn 1.3.2 &&&&&&&

--> There is now an automated way of estimating the proper boxsize and 
overlap distance to be used in an integration session.
See the menu integration->estimate_boxsize_and_overlap_distance

--> There is now a better way to determine the restrained spot area,
which is based on an average spotshape rather than from a more or less
random choice of some diffraction spots, as was done before.
See the menu integration->estimate_restrain_fitting_area

--> There is now the possibility to define a maximum slope above which
background calculation is declared faulty. Useful for ice rings.

-> A few cosmetics have been improved:
-> Swapping bytes from the marccd detector is now automatically performed.
-> Some menus have been rearranged: everything which is directly related to
the integration parameters is now under the 'integration' menu (estimation
of boxsize, overlap distance, retrained fitting area, masks). 
 

 &&&&&&&  NEW FEATURES OF PROW vsn 1.3 &&&&&&& 
--> Reordering of some menus to make more sense for entering integration parameters.
--> Introduction of RAXIS detectors.
--> Possibility to run PrOW in batch-mode: this is done with the two command files batch_prow.com 
and batch_convert.com.

 &&&&&&&  NEW FEATURES OF PROW vsn 1.2.6 1.2.7 1.2.8 &&&&&&& 
--> Improvement of Laue soft limit integration


 &&&&&&&  NEW FEATURES OF PROW vsn 1.2.5 &&&&&&& 

--> Spot area : the contour level associated to the restrained fitting area in each image sector is
now automatically determined. It varies between 0.1% (stronger sectors) to 15% (weaker sectors). 
The integration parameter "Contour level for area selection in each sector" has been removed.

--> Estimation of chi_square values. The chi_square estimation has been made more meaningful. In the 
aerlier versions, chi_square values were overoptimistic. The result (for monochromatic integration) is
a stronger weight given to the box integration for the stronger spots.

--> The algorithm for the elimination of ice spots (or strong outliers) has been improved.

--> This version can be used under : HPUX 10.2 ; IRIX 6.2/6.3/6.4 ; SUNos ; LINUX

 &&&&&&&  NEW FEATURES OF PROW vsn 1.2.4 &&&&&&& 

--> Spot area  : a restrained fitting area in now determined
automatically and independantly, in each sector of the image. This area is computed
from the average reference profile in the sector. The region within a contour level
of this avarage profile, as given by the parameter "Contour level for area selection in each sector"
is selected. For very weak data, a contour level of about 10% is advisable, for strong data choose a 
lower level, like 1%. The area determined in this way is used exactly in the same way as the 
old "restrained fitting area". The latter can still be used as an overall limit, which avoids
exceedingly big local areas to be selected.

--> Background area : in each sector, the pixels that are allowed to contribute to background
selection are now limited. They cannot lie within the fitting area corresponding to any spot, 
plus a safety margin defined by the parameter : "Number of excluded pixels around spot area 
for background calculation". A safety margin of 1 or 2 pixels is OK. In case of crowded patterns
(Laue), all pixels within a box may easily end up belonging to neighbour spot areas, which has the
effect that the background calculation may get spurious. In such a case, no safety margin may be
used, and the contour level for spot areas should be rather big.

 &&&&&&&  NEW FEATURES OF PROW vsn 1.2.3 &&&&&&& 

--> Mask and restrained fitting area can now be drawn as ellipses. 
In the case of restrained fitting area, this is probably one of the least 'user biased' way of 
defining the area, and it is much easier.

--> Restrained fitting area can be visualized in the following way :
If a .ref or a .prow file has been loaded with menu analysis/prediction/load, then the restrained
area that was used when these files were created is also loaded.
If a .x (denzo) or a .geasc (lauegen) file has been loaded (with the same menu), then the restrained
area as defined by the file indicated in integration/integration_parameters/enter_view_parameters, is 
loaded.
In both case, the restrained area appears in the zoom window, in blue, as soon as the zoom factor exceeds 4.

--> Selection of reference spots : is now more efficient, especially for weak patterns.
In particular, the case where large portions of the image contains only overlapped reflections can be
handle in a smarter way. Previously, no reference profile could have been selected from such a region,
and in case of anisotropic pattern, this caused problems. Now there is a way around this : set the 
overlap distance for reference peaks to a SMALLER, not bigger, value than for regular peaks. This value could
even be set very small. Then the program will select reference spots in the 'overlapped' regions in the 
following way : for each candidate (which might in principle be overlapped) it will look at the I/sigI of
the neighbouring peaks and compare it with I/SigI of the candidate itself. Only those candidates for which
the I/SigI of the neighbours is at least 10 times smaller than teir own I/SigI, will be selected. In many
cases, especially for monochromatic patterns, this feature is important.

--> Colors : during integration :
	All predicted spots are shown in GREEN
	All overlapped spots are shown in LIGHT BLUE
	All strong (box integrated) spots are shown in RED
	All reference peaks WHICH ARE NOT BOX INTEGRATED are shown in DEEP BLUE

 &&&&&&&  NEW FEATURES OF PROW vsn 1.2.2 &&&&&&& 

--> Reference profile are now searched in sectors of the image. This gives a more
 uniform coverage of the image area by the reference profiles. The number of sectors
 has to be input by the user.

--> Restrained fitting area are now automatically calculated, and independantly
in each sector. However, the option "restrain fitting area" is still available, and
should be used in difficult cases. 

 &&&&&&&  NEW FEATURES OF PROW vsn 1.2.0 &&&&&&& 

--> Integration features.
	+++ Reference spots are now interpolated according to predicted spot position.
	+++ Selection of reference spots is not limited to the current image. Reference
		spots can be selected from already processed images, over a chosen phi range.

	+++ Local refinement before integration is not used by default.
	+++ Many others small things
	
	Overall the data quality is MUCH improved over previous version.

--> Computing features.
	+++ The program now runs on a Graphical User Interface.
	+++ Some routines were recoded in C to speed up efficiency.







&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Procedure to use LSCALE exclusion mode in integration with Soft Laue mode :
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

IDL> read_lscale,'my_lauenorm.log',bins,lambda,lambdapol,ranges, 
polorder,lmin,lmax
			
The curve can be checked with :
IDL> l=FLOAT(lmin)+indgen(100)/100.*(FLOAT(lmax)-FLOAT(lmin)) & 
plot,l,1/chebychev(lambdapol,l)

It is saved with : 
IDL> save,lambdapol,file='my_lscale_lambdacurve.idl'


&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Procedure to use produce a IDL format file containing monochromatic data.
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

IDL> mono=read_mtz('mono_data.mtz') ; the monochromatic SF are in field .entry(n)
IDL> mono.entry(0)=mono.entry(n) ; if n > 0
IDL> laue_group=32 ; for example
IDL> save,mono,laue_group,file='mono_data.idl'


&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Procedure to use produce a threshold and B factor
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

Run the program ESTIMATE_EXCL.PRO
You have to edit the routine and run it by entering IDL and typing
IDL> .run estimate_excl
Then examine the logfile.
