Google

SECTION 2.16 - THE ROTATION IMAGE SIMULATION VIEW-OBJECT ROUTINES

2.16.1 INTRODUCTION

The rotation pattern simulation view-object is used to display the simulation of a single crystal monochromatic X-ray rotation diffraction pattern (the pattern prediction itself must be done externally to the routine and the reflections stored in a list using the appropriate 'rpf' functions). The view-object allows either for colour coded simulations or for interactive black and white simulations where various parameters may be modified via a slider to show the effects that they have on the patterns. The indices of selected spots may be displayed. Labels may be drawn on the interactive black and white simulations. The view-object also provides a hard copy (Postscript file) option.

The following sets of routines are available:

Creating and Handling a Rotation Simulation View-Object

2.16.2 CREATING AND HANDLING A ROTATION SIMULATION VIEW-OBJECT

2.16.2.1 Introduction

The following routines are available:

Create a rotation simulation view-object - xdl_rot_sim
Calculate size requirements - xdl_rot_sim_getsize
Display a new simulation - xdl_rot_sim_new

2.16.2.2 Create a rotation simulation view-object - xdl_rot_sim

The routine xdl_rot_sim (xdlf_rot_sim) is used to create a new rotation image simulation display view-object. The simulation itself is calculated externally to the routine.
 
Fortran call:
 
         CALL XDLF_ROT_SIM  (IVH, IVHPARENT, IX, IY, ICSET, ITYPE, ISIZE,
        +                    IORD, MINDX, ICRYS, IMGNUM, FILMR, SCAX,
        +                    ROTS, ROTE, ISYN, ETA, DIVV, DIVH, DELAMB,
        +                    DELCOR, IAX_V, IAX_H, NWMAX, CUR_ROTR,
        +                    CUR_ETA, CUR_DIVV, CUR_DIVH, CUR_DELAMB,
        +                    CELL, UMAT, DELPHI, WAVE, LSYS, CTOD,
        +                    NAME1, LEN1, NAME2, LEN2, MINW, MINH, IERR)
 
Parameters:
 
IVH       (R)   View-object handle (see vh)
IVHPARENT (R)   View-object handle for parent 0=none 
                (see vh_parent)
IX        (R)   X position (may be -1 if no parent) (see x)
IY        (R)   Y position (may be -1 if no parent) (see y)
ICSET     (R)   Colorset number (see cset)
ITYPE     (R)   Simulation type =1 Colour, = 2 Monochrome with
                soft limits options etc. (see type)
ISIZE     (R)   Half width/height for displayed pattern in 
                pixels (see size)
IORD      (R)   Order of local detector axes flag. First axis
                along X windows 'x' direction on screen (to
                right), second axis along X-windows 'y' direction 
                (down).
                1  +ax1 +ax2
                2  +ax1 -ax2
                3  -ax1 +ax2
                4  -ax1 -ax2
                5  +ax2 +ax1
                6  +ax2 -ax1
                7  -ax2 +ax1
                8  -ax2 -ax1
MINDX     (R)   Index to spot list (as returned from 
                rpff_reflist_init call)
ICRYS     (R)   Crystal number
IMGNUM    (R)   Image number
FILMR     (R)   Pattern radius in mm (see filmr)
SCAX(3)   (R)   Rotation (scan) axis vector as used in the 
                prediction 
ROTS      (R)   Rotation start for current image (degrees) as used
                in the prediction
ROTE      (R)   Rotation end for current image (>ROTS) (degrees) 
                as used in the prediction
ISYN      (R)   Flag =1 synchrotron, =0 lab source as used in the
                prediction
ETA       (R)   Mosaicity (halfwidth, radians) as used in the 
                prediction
DIVV      (R)   Verical divergence (half width, radians) as used
                in the prediction
DIVH      (R)   Horizontal divergence (half width, radians) as
                used in the prediction
DELAMB    (R)   Delta-lambda/lambda as used in the prediction    
DELCOR    (R)   Correlated dispersion (half width, radians as used in
                the prediction
IAX_V     (R)   No. of vertical axis (lab frame) 1=X, 2=Y, 3=Z
                as used in the prediction
IAX_H     (R)   No. of horizontal axis (lab frame) 1=X, 2=Y, 3=Z
                as used in the prediction
NWMAX     (R)   Maximum no. of images to treat as a non too-wide
                partial as used in the prediction
CUR_ROTR  (R)   Current rotation range for type 2 plots (must
                be <= predicted range)
CUR_ETA   (R)   Current 'eta' value for type 2 plots (must
                be <= value used in the prediction)
CUR_DIVV  (R)   Current 'divv' value for type 2 plots (must
                be <= value used in the prediction)
CUR_DIVH  (R)   Current 'divh' value for type 2 plots (must
                be <= value used in the prediction)
CUR_DELAMB(R)   Current 'delamb' value for type 2 plots (must
                be <= value used in the prediction)
CELL(6)   (R)   Real cell parameters in Angstroms and degrees
                for annotation of type 2 Postscript plots
UMAT(3,3) (R)   'U' matrix for annotation of type 2 Postscript 
                plots
DELPHI(3) (R)   Missetting angles in degrees for annotation of 
                type 2 Postscript plots
WAVE      (R)   Wavelength in Angstroms for annotation of type 2 
                Postscript plots
LSYS(2)   (R)   Crystal system 1-7, Lattice type 1-7
CTOD      (R)   Crystal to detector distance (mm)
MINW      (R)   Minimum width for view-object or 0 
                (see min_width)
MINH      (R)   Minimum height for view-object or 0 
                (see min_height)
NAME1     (R)   Character string containing the name of the 1'st
                decector axis (max 4 characters in length)
                ** Pass address using the XDLSTR function **
LEN1      (R)   Length of the name string - must be >0 
                (cf len1) (max 4 chars) 
NAME2     (R)   Character string containing the name of the 2'nd
                detector axis (max 4 characters in length)
                ** Pass address using the XDLSTR function **
LEN2      (R)   Length of the name string - must be >0 
                (cf len1) (max 4 chars) 
IERR      (W)   Returns status from xdl_rot_sim call
 
'C' call:
 
int xdl_rot_sim (int vh, int vh_parent, int x, int y, int cset, int type, 
                 int size, int iord, int mindx, int icrys, int imgnum, 
		 float filmr, float * scax, float rots, float rote, 
                 int isyn, float eta, float divv, float divh, float delamb, 
                 float delcor, int iax_v, int iax_h, int nwmax, 
                 float cur_rotr, float cur_eta, float cur_divv, 
                 float cur_divh, float cur_delamb, 
                 float * cell, float * umat, float * delphi, 
                 float wave, int * lsys, float ctod,
                 char * name1, int len1, char * name2, int len2, 
                 int min_width, int min_height)
 
Parameters:
 
int       vh;              User selected view-object handle (R)
int       vh_parent;       View-object handle for the parent base frame, 
                           if 0 then a base  level frame is created to
                           enclose the view-object (R)
int       x;               x coordinate for the view-object.
                           If no parent may be -1 to give default x (R)
int       y;               y coordinate for the view-object.
                           If no parent may be -1 to give default y (R)
int       cset;            Number of the colorset to be used; must
                           have 53 or more colorcells allocated (R) 
int       type;            Simulation type =1 Colour, =2 Monochrome with
                           soft limit sliders etc.
int       size;            Pattern display area half width/height in
                           pixels (R)
int       iord;            Order of local detector axes flag. First axis
                           along X windows 'x' direction on screen (to
                           right), second axis along X-windows 'y' 
                           direction (down).
                             1  +ax1 +ax2
                             2  +ax1 -ax2
                             3  -ax1 +ax2
                             4  -ax1 -ax2
                             5  +ax2 +ax1
                             6  +ax2 -ax1
                             7  -ax2 +ax1
                             8  -ax2 -ax1
                             (R)
 int       mindx;          Reflection list index as returned from
                           prl_init (R)
int       icrys;           Crystal number (R)
int       imgnum;          Image number (R)
float     filmr;           Pattern radius in mm (R)
float     scax[3];         Rotation (scan) axis vector as used in the
                           prediction (R)
float     rots;            Rotation start for current image (degrees) as
                           used in the prediction (R)
float     rote;            Rotation end for current image (>ROTS) 
                           (degrees) as usedin the prediction (R)
int       isyn;            Flag =1 synchrotron, =0 lab source as used
                           in the prediction (R)
float     eta;             Mosaicity (half width, radians) as used in the 
                           prediction (R)
float     divv;            Verical divergence (half width) (radians) as
                           used in the prediction (R)
float     divh;            Horizontal divergence (half width) (radians)
                           as used in the prediction (R)
float     delamb;          Delta-lambda/lambda as used in the
                           prediction (R)    
float     delcor;          Correlated dispersion (half width) as used
                           in the prediction (R)
int       iax_v;           No. of vertical axis (lab frame) 
                           1=X, 2=Y, 3=Z as used in the prediction (R)
int       iax_h;           No. of horizontal axis (lab frame) 
                           1=X, 2=Y, 3=Z  as used in the prediction (R)
int       nwmax;           Maximum no. of images to treat as a non 
                           too-wide partial as used in the 
                           prediction (R) 
float     cur_rotr;        Current rotation range for type 2 plots (must
                           be <= predicted range) (R)
float     cur_eta;         Current 'eta' value for type 2 plots (must
                           be <= value used in the prediction) (R)
float     cur_divv;        Current 'divv' value for type 2 plots (must
                           be <= value used in the prediction) (R)
float     cur_divh;        Current 'divh' value for type 2 plots (must
                           be <= value used in the prediction) (R)
float     cur_delamb;      Current 'delamb' value for type 2 plots (must
                           be <= value used in the prediction) (R)
float     cell[6];         Real cell parameters in Angstroms and degrees
                           for annotation of type 2 Postscript plots 
                           (R)
float     umat[9];         'U' matrix for annotation of type 2 Postscript 
                           plots (R)
float     delphi[3];       Missetting angles in degrees for annotation of 
                           type 2 Postscript plots (R)
float     wave;            Wavelength in Angstroms for annotation of 
                           type 2 Postscript plots (R)
int       lsys[2];         Crystal system 1-7, lattice type 1-7 for
                           annotation of type 2 Postscript plots (R)
float     ctod;            Crystal to detector distance in mm for
                           annotation of type 2 Postscript plots (R)
char      *name1;          Name of 1'st detector axis (max 4 chars long) 
                           (R)
int       len1;            Length of name (may give 0 if a null terminated 
                           string is passed) (R)
char      *name2;          Name of 2'nd detector axis (max 4 chars long)
                           (R)
int       len2;            Length of name (may give 0 if a null terminated 
                           string is passed) (R)
int       min_width;       The program will calculate the width required
                           for the view-object based on the display area
                           width, control panel width etc. If this is
                           less than min_width then min_width will be
                           used instead and the layout altered to reflect
                           this (R)
int       min_height;      minimum height cf min_width (R)


Return:  Status flag =0 OK, >0 error
         bit 0 set: Requested parent not found in the view-objects list
         bit 1 set: Unable to allocate memory for x, y pixel positions
                    arrays.

2.16.2.3 Calculate size requirements - xdl_rot_sim_getsize

The routine xdl_rot_sim_getsize (xdlf_rot_sim_getsize) is used to get the required size for a rotation pattern simulation display view-object.
 
Fortran call:
 
         CALL XDLF_ROT_SIM_GETSIZE (ITYPE, ISIZE, IWIDTH, IHEIGHT)
 
Parameters:
 
ITYPE     (R)   Simulation type =1 Colour, = 2 Monochrome with
                soft limits options etc. (see type)
ISIZE     (R)   Half width/height for displayed pattern in 
                pixels (see size)
IWIDTH    (W)   Returns the width required (see w)
IHEIGHT   (W)   Returns the height required (see h)
 
'C' call:
 
void xdl_rot_sim_getsize (type, size, w, h)
 
Parameters:
 
int       type;           /* Simulation type =1 Colour, =2 Monochrome with
                             soft limit sliders etc.*/
int       size;           /* Pattern display area half width/height in
                             pixels (R)*/
int *w;                   /* Returns the width required (W)*/
int *h;                   /* Returns the height required (W)*/

Return:  None

2.16.2.4 Display a new simulation - xdl_rot_sim_new

The routine xdl_rot_sim_new (xdlf_rot_sim_new) is used to display a new rotation pattern simulation in a rotation simulation view-object. The current simulation type (colour/interactive) and the currently selected options for the view-object are unchanged (apart from the orientation if desired). Any labels will be removed.
 
Fortran call:
 
         CALL XDLF_ROT_SIM_NEW (IVH, IORD, NAME1, LEN1, NAME2, LEN2,
        +                       MINDX, ICRYS, IMGNUM, 
        +                       FILMR, SCAX, ROTS, ROTE, ISYN, ETA, 
        +                       DIVV, DIVH, DELAMB, DELCOR, 
        +                       IAX_V, IAX_H, NWMAX, CELL, UMAT, 
        +                       DELPHI, WAVE, LSYS, CTOD, IERR)
 
Parameters:
 
IVH       (R)   View-object handle (see vh)
IORD      (R)   Order of local detector axes flag 1-8 (0 if no change in
                which case axis names will also be left unchanged)
NAME1     (R)   Character string containing the name of the 1'st
                decector axis (max 4 characters in length)
                ** Pass address using the XDLSTR function **
LEN1      (R)   Length of the name string - must be >0 
                (cf len1) (max 4 chars) 
NAME2     (R)   Character string containing the name of the 2'nd
                detector axis (max 4 characters in length)
                ** Pass address using the XDLSTR function **
LEN2      (R)   Length of the name string - must be >0 
                (cf len1) (max 4 chars) 
MINDX     (R)   Index to spot list (as returned from 
                rpff_reflist_init call)
ICRYS     (R)   Crystal number
IMGNUM    (R)   Image number
FILMR     (R)   Pattern radius in mm (see filmr)
SCAX(3)   (R)   Rotation (scan) axis vector as used in the 
                prediction 
ROTS      (R)   Rotation start for current image (degrees) as used
                in the prediction
ROTE      (R)   Rotation end for current image (>ROTS) (degrees) 
                as used in the prediction
ISYN      (R)   Flag =1 synchrotron, =0 lab source as used in the
                prediction
ETA       (R)   Mosaicity (radians) as used in the prediction
DIVV      (R)   Verical divergence (half width) (radians) as used
                in the prediction
DIVH      (R)   Horizontal divergence (half width) (radians) as
                used in the prediction
DELAMB    (R)   Delta-lambda/lambda as used in the prediction    
DELCOR    (R)   Correlated dispersion (half width) as used in
                the prediction
IAX_V     (R)   No. of vertical axis (lab frame) 1=X, 2=Y, 3=Z
                as used in the prediction
IAX_H     (R)   No. of horizontal axis (lab frame) 1=X, 2=Y, 3=Z
                as used in the prediction
NWMAX     (R)   Maximum no. of images to treat as a non too-wide
                partial as used in the prediction
CELL(6)   (R)   Real cell parameters in Angstroms and degrees
                for annotation of type 2 Postscript plots
UMAT(3,3) (R)   'U' matrix for annotation of type 2 Postscript 
                plots
DELPHI(3) (R)   Missetting angles in degrees for annotation of 
                type 2 Postscript plots
WAVE      (R)   Wavelength in Angstroms for annotation of type 2 
                Postscript plots
LSYS(2)   (R)   Crystal system 1-7, Lattice type 1-7
CTOD      (R)   Crystal to detector distance (mm)
IERR      (W)   Returns status from xdl_rot_sim_new call
 
'C' call:
 
int xdl_rot_sim_new (int vh, int iord, char * name1, int len1, 
                     char * name2, int len2, int mindx, int icrys, 
                     int imgnum, float filmr, float * scax, 
                     float rots, float rote, int isyn, float eta, 
                     float divv, float divh, float delamb, float delcor, 
                     int iax_v, int iax_h, int nwmax, float * cell, 
                     float * umat, float *delphi, float wave, int * lsys, 
                     float ctod) 
 
Parameters:
 
int       vh;              User selected view-object handle (R)
int       iord;            Order of local detector axes flag 1-8 (if
                           0 then axis order and axis names will
                           remain unchanged) (R)
char      *name1;          Name of 1'st detector axis (max 4 chars long) 
                           (R)
int       len1;            Length of name (may give 0 if a null terminated 
                           string is passed) (R)
char      *name2;          Name of 2'nd detector axis (max 4 chars long)
                           (R)
int       len2;            Length of name (may give 0 if a null terminated 
                           string is passed) (R)
int       mindx;           Reflection list index as returned from
                           prl_init (R)
int       icrys;           Crystal number (R)
int       imgnum;          Image number (R)
float     filmr;           Pattern radius in mm (R)
float     scax[3];         Rotation (scan) axis vector as used in the
                           prediction (R)
float     rots;            Rotation start for current image (degrees) as
                           used in the prediction (R)
float     rote;            Rotation end for current image (>ROTS) 
                           (degrees) as usedin the prediction (R)
int       isyn;            Flag =1 synchrotron, =0 lab source as used
                           in the prediction (R)
float     eta;             Mosaicity (radians) as used in the 
                           prediction (R)
float     divv;            Verical divergence (half width) (radians) as
                           used in the prediction (R)
float     divh;            Horizontal divergence (half width) (radians)
                           as used in the prediction (R)
float     delamb;          Delta-lambda/lambda as used in the
                           prediction (R)    
float     delcor;          Correlated dispersion (half width) as used
                           in the prediction (R)
int       iax_v;           No. of vertical axis (lab frame) 
                           1=X, 2=Y, 3=Z as used in the prediction (R)
int       iax_h;           No. of horizontal axis (lab frame) 
                           1=X, 2=Y, 3=Z  as used in the prediction (R)
int       nwmax;           Maximum no. of images to treat as a non 
                           too-wide partial as used in the 
                           prediction (R) 
float     cell[6];         Real cell parameters in Angstroms and degrees
                           for annotation of type 2 Postscript plots 
                           (R)
float     umat[9];         'U' matrix for annotation of type 2 Postscript 
                           plots (R)
float     delphi[3];       Missetting angles in degrees for annotation of 
                           type 2 Postscript plots (R)
float     wave;            Wavelength in Angstroms for annotation of 
                           type 2 Postscript plots (R)
int       lsys[2];         Crystal system 1-7, lattice type 1-7 for
                           annotation of type 2 Postscript plots (R)
float     ctod;            Crystal to detector distance in mm for
                           annotation of type 2 Postscript plots (R)

Return:  Status flag =0 OK, >0 error
         bit 0 set: View-object handle not found
         bit 1 set: View handle does not match view object
         bit 2 set: Unable to allocate required memory



John W. Campbell
CCLRC Daresbury Laboratory
Last update 4 Feb 1998