src/Level2/TrnsTable1D.cc
/* Consider the request for a time domain signal associated with a transitions
   table. If those transitions decay, their time domain signals will be zero
   after a certain amount of time, after which they need not be computed since
   they are effectively zero. The function ExpCutoffs looks at each
   transition and determines the last point to calculate, i.e. the point
   after which the transition will no longer generate any intensity to
   within a cutoff value. These indices are returned in a vector, on index 
   per transition.
 
   If k is the last point in the exponential that should be calculated, and
   cutoff is a value (<0) afterwhich the intensity is essentially zero, then
   we know that
                          k >= -ln(cutoff)/[R*tinc]

   where tinc is the time between points & R the transition decay rate.      */
Consider the request for a time domain signal associated with a transitions
table. If those transitions decay, their time domain signals will be zero
after a certain amount of time, after which they need not be computed since
they are effectively zero. The function ExpCutoffs looks at each
transition and determines the last point to calculate, i.e. the point
after which the transition will no longer generate any intensity to
within a cutoff value. These indices are returned in a vector, on index
per transition.

If k is the last point in the exponential that should be calculated, and
cutoff is a value (<0) afterwhich the intensity is essentially zero, then
we know that
k >= -ln(cutoff)/[R*tinc]


Consider the request for a time domain signal associated with a transitions table . If those transitions decay their time domain signals will be zero after a certain amount of time after which they need not be computed since they are effectively zero . The function ExpCutoffs looks at each transition and determines the last point to calculate i . e . the point after which the transition will no longer generate any intensity to within a cutoff value . These indices are returned in a vector on index per transition . If k is the last point in the exponential that should be calculated and cutoff is a value ( <0 ) afterwhich the intensity is essentially zero then we know that k > = - ln ( cutoff ) / [ R * tinc ]
vector<int> TTable1D::ExpCutoffs(double tinc, int npts, double CO) const
  {
  if(CO>1 || CO<1.e-10) CO = 1.e-4;		
  double mod = -log(CO)/tinc;			
  double Rtr;					
  int i, ntr = rows(); 				
  vector<int> ifis(ntr);			
  for(int tr=0; tr<ntr; tr++)			
    {
    Rtr = getRe(tr,0);				
    if(Rtr <= 0) ifis[tr] = npts;		
    else					
      {						
      i = int(mod/Rtr);				
      if(i>npts-1) ifis[tr] = npts;		
      else         ifis[tr] = i+1;		
      }
    }
  return ifis;
  }
vector < int > TTable1D :: ExpCutoffs ( double tinc , int npts , double CO ) const { if ( CO > 1 || CO < 1.e-10 ) CO = 1.e-4 ; double mod = - log ( CO ) / tinc ; double Rtr ; int i , ntr = rows ( ) ; vector < int > ifis ( ntr ) ; for ( int tr = 0 ; tr < ntr ; tr ++ ) { Rtr = getRe ( tr , 0 ) ; if ( Rtr <= 0 ) ifis [ tr ] = npts ; else { i = int ( mod / Rtr ) ; if ( i > npts - 1 ) ifis [ tr ] = npts ; else ifis [ tr ] = i + 1 ; } } return ifis ; }
Consider the request for a time domain signal associated with a transitions
table.
Consider the request for a time domain signal associated with a transitions table .
// Insure reasonable cutoff // Base in cutoff formula // Transition decay rate // Number of transitions // Array of final points  // Loop transiitons //   Transition decay rate //   No decay, all points O.K. //   If point does decay, find //   where intensity < CO  //   Point where cutoff is //   Insure point within range //   or adjust to next point