src/Solids/Powder.cc
/* As is done above, this function also generates a simplest powder using
   linear angle increments over the entire sphere. There will be Nbeta beta
   angles taken down from the +z axis spanning the range of (0, PI) or from
   (0, PI/2]. At each of these angles there will be sin(beta)*Nalpha alpha
   angles taken over from the +x axis. These second angles span the range 
   of [0, 2PI). Since the probablity of having the orientation with 
   beta = 0 and beta = PI is zero, these angles will NOT be included in the
   powder array of Euler angles. The flag uhonly dictates if the beta range
   stays in the upper-hemisphere or not, the former allowed only if the
   number of alpha angles is set to 1. Having Nalpha=1 and uhonly=true should
   only be used when there is no asymmetry in the powder. Lastly, since the
   number of alpha angles is adjusted depending upon the angle beta, the
   scaling factor of sin(beta) is automatically included. Hence each 
   orientation will have the same probability.                              */
As is done above, this function also generates a simplest powder using
linear angle increments over the entire sphere. There will be Nbeta beta
angles taken down from the +z axis spanning the range of (0, PI) or from
(0, PI/2]. At each of these angles there will be sin(beta)*Nalpha alpha
angles taken over from the +x axis. These second angles span the range
of [0, 2PI). Since the probablity of having the orientation with
beta = 0 and beta = PI is zero, these angles will NOT be included in the
powder array of Euler angles. The flag uhonly dictates if the beta range
stays in the upper-hemisphere or not, the former allowed only if the
number of alpha angles is set to 1. Having Nalpha=1 and uhonly=true should
only be used when there is no asymmetry in the powder. Lastly, since the
number of alpha angles is adjusted depending upon the angle beta, the
scaling factor of sin(beta) is automatically included. Hence each
orientation will have the same probability.
As is done above this function also generates a simplest powder using linear angle increments over the entire sphere . There will be Nbeta beta angles taken down from the + z axis spanning the range of ( 0 PI ) or from ( 0 PI / 2 ] . At each of these angles there will be sin ( beta ) * Nalpha alpha angles taken over from the + x axis . These second angles span the range of [ 0 2PI ) . Since the probablity of having the orientation with beta = 0 and beta = PI is zero these angles will NOT be included in the powder array of Euler angles . The flag uhonly dictates if the beta range stays in the upper - hemisphere or not the former allowed only if the number of alpha angles is set to 1 . Having Nalpha = 1 and uhonly = true should only be used when there is no asymmetry in the powder . Lastly since the number of alpha angles is adjusted depending upon the angle beta the scaling factor of sin ( beta ) is automatically included . Hence each orientation will have the same probability .
void Powder::Spherical2(int Nbeta, int Nalpha, bool uhonly)
  {
  _EAs.clear();					
  _Ps.clear();					
  _PN = string("Spherical2");			
  _A3 =false;					
  if(Nalpha) uhonly = false;			
  double bmax   = uhonly?90.0:180.0;		
  int    nbspan = uhonly?Nbeta:Nbeta+1;		
  double binc   = bmax/double(nbspan); 		
  double beta   = binc;				
  double sf     = 1.0;				
  double ainc;  				
  double alph, beta;				
  double asteps;				
  for(int j=1, i=0; j<=Nbeta; j++)		
    {
    beta = double(j)*binc;			
    if(uhonly && beta==90.0) sf/=2.0;	        
    asteps = NAlpha*sin(beta*DEG2RAD);		
    ainc   = double(360.0)/double(asteps);	
    for(i=0; i<asteps; i++)			
      {
      alph = ainc*double(i);			
      _EAs.push_back(EAngles(alph,beta,0,true));
      _Ps.push_back(sf);			
      }
    }
  }
void Powder :: Spherical2 ( int Nbeta , int Nalpha , bool uhonly ) { _EAs . clear ( ) ; _Ps . clear ( ) ; _PN = string ( " " ) ; _A3 = false ; if ( Nalpha ) uhonly = false ; double bmax = uhonly ? 90.0 : 180.0 ; int nbspan = uhonly ? Nbeta : Nbeta + 1 ; double binc = bmax / double ( nbspan ) ; double beta = binc ; double sf = 1.0 ; double ainc ; double alph , beta ; double asteps ; for ( int j = 1 , i = 0 ; j <= Nbeta ; j ++ ) { beta = double ( j ) * binc ; if ( uhonly && beta == 90.0 ) sf /= 2.0 ; asteps = NAlpha * sin ( beta * DEG2RAD ) ; ainc = double ( 360.0 ) / double ( asteps ) ; for ( i = 0 ; i < asteps ; i ++ ) { alph = ainc * double ( i ) ; _EAs . push_back ( EAngles ( alph , beta , 0 , true ) ) ; _Ps . push_back ( sf ) ; } } }
As is done above, this function also generates a simplest powder using
linear angle increments over the entire sphere.
As is done above this function also generates a simplest powder using linear angle increments over the entire sphere .
// Remove existing angles // Remove existing probabilties // Name powder spherical // It is two angle powder // Alpha average full sphere // Maximum beta to compute // Number beta points to span  // Beta angle increment // Start at first beta (not 0) // Orientation scaling // Alpha angle increment // Orientation Euler angles // Alpha angles at beta // Loop over beta angles //   Set beta angle (deg) //   Half @ 90 & half-sphere //   # alpha angles this beta //   Alpha angle increment (deg) //   Loop over alpha angles //     The angle alpha //     Store these angles //     Store this  probability