src/Pulses/PulSinc.cc
// ____________________________________________________________________________
// F                       Sinc Pulse ASCII Input Functions
// ____________________________________________________________________________
F                       Sinc Pulse ASCII Input Functions
F Sinc Pulse ASCII Input Functions
row_vector SincHistogram(double gamB1, double tau, int N, int node)
   {
double den, Z;				
SincPrep(N, node, den, Z);			
   double tdiv = tau/double(N);                 
   int M = N+1;
   row_vector SincShape(2*N+M);			
   double lastv, lastt;
   int I = 0;
   row_vector Sinc = SincVect(gamB1,N,node);	
   double time = 0.0;				
   complex z;
   for(int i=0; i<N; i++)			
     {
     if(i)
       {
       z = complex(time,Sinc.getRe(i-1));	
       SincShape.put(z, I++);			
       if(M) SincShape.put(complex(time),I++);	
       }
     else if(M)
       SincShape.put(complex(time,0),I++);	
     z = complex(time,Sinc.getRe(i));		
     SincShape.put(z,I++);			
     lastv = Sinc.getRe(i);			
     lastt = double(i);				
     if(i==N-1)					
       {
       time += tdiv;				
       z = complex(time,Sinc.getRe(i));		
       SincShape.put(z, I++);			
       if(M) SincShape.put(time, I++);		
       }
     time += tdiv;				
     }						
   return SincShape;
   }
row_vector SincHistogram ( double gamB1 , double tau , int N , int node ) { double den , Z ; SincPrep ( N , node , den , Z ) ; double tdiv = tau / double ( N ) ; int M = N + 1 ; row_vector SincShape ( 2 * N + M ) ; double lastv , lastt ; int I = 0 ; row_vector Sinc = SincVect ( gamB1 , N , node ) ; double time = 0.0 ; complex z ; for ( int i = 0 ; i < N ; i ++ ) { if ( i ) { z = complex ( time , Sinc . getRe ( i - 1 ) ) ; SincShape . put ( z , I ++ ) ; if ( M ) SincShape . put ( complex ( time ) , I ++ ) ; } else if ( M ) SincShape . put ( complex ( time , 0 ) , I ++ ) ; z = complex ( time , Sinc . getRe ( i ) ) ; SincShape . put ( z , I ++ ) ; lastv = Sinc . getRe ( i ) ; lastt = double ( i ) ; if ( i == N - 1 ) { time += tdiv ; z = complex ( time , Sinc . getRe ( i ) ) ; SincShape . put ( z , I ++ ) ; if ( M ) SincShape . put ( time , I ++ ) ; } time += tdiv ; } return SincShape ; }
____________________________________________________________________________
F                       Sinc Pulse ASCII Input Functions
____________________________________________________________________________
____________________________________________________________________________ F Sinc Pulse ASCII Input Functions ____________________________________________________________________________
// Input        gamB1   : The rf-field strength (Hz) //              tau     : Sinc pulse length (sec) //              N       : Number of Sinc steps //		node    : Cutoff node [1,2,3,...] //			  defaults to 3 // Output       Sshape  : Vector of point for plot of Sinc //			  as a histogram. // Denominator & numerator // Prep. Sinc values // Incremental time // Vector of Sinc points // Sinc intensities // Time in pulse // Loop over Sinc steps // Sinc function point (x,y) // For horizontals in hist. // For verticals in hist. // First vertical in hist. // Sinc function point (x,y) // Sinc intensity // Store the previous intensity // Store the previous point // For the last point // Increase time increment // Sinc function point (x,y) // For last horizontal in hist. // For last vertical in hist. // Increment to next time // (for  horizontal axis)