parameters: (E,dE)
return_statement: return E_parm,E_scaled,dE_scaled
docstring: Multiscale normalization of E
      
      
      Parameters
      ----------
      E:              Energy
      dE:             Uncertainty in Energy
      
      Returns
      -------
      E_parm:    Scale parameters
      E_scaled:       Scaled energies
      dE_scaled:      Scaled uncertainties in energies
docstring_summary: Multiscale normalization of E
      
      
      Parameters
      ----------
      E:              Energy
      dE:             Uncertainty in Energy
      
      Returns
      -------
      E_parm:    Scale parameters
      E_scaled:       Scaled energies
      dE_scaled:      Scaled uncertainties in energies
docstring_tokens: Multiscale normalization of E Parameters ---------- E : Energy dE : Uncertainty in Energy Returns ------- E_parm : Scale parameters E_scaled : Scaled energies dE_scaled : Scaled uncertainties in energies
function: def multiscale_E(E,dE):
  
      """
      Multiscale normalization of E
      
      
      Parameters
      ----------
      E:              Energy
      dE:             Uncertainty in Energy
      
      Returns
      -------
      E_parm:    Scale parameters
      E_scaled:       Scaled energies
      dE_scaled:      Scaled uncertainties in energies
      """
      
      E_parm = np.zeros(3)
      E_parm[0] = min(E)
      us_ind = np.argsort(E, axis=0)
      E_parm[1] = E[us_ind[np.int(np.round(E.shape[0]/4.0)),0],0]
      E_parm[1] = min(max(E_parm[1],E_parm[0]+100*np.mean(dE[np.argwhere(E<=E_parm[1])])),max(E))
      if E_parm[1] == E_parm[0]:
          E_parm[1] = min(E_parm[0]+1,max(E))
          
      E_scaled = (np.copy(E)-E_parm[0])/(E_parm[1]-E_parm[0])
      dE_scaled = np.copy(dE)/(E_parm[1]-E_parm[0])
      us_ind = np.argwhere(E_scaled[:,0]>1.0)
      
      if us_ind.shape[0]>0:
          dE_scaled[us_ind[:,0],:] = np.log(1+dE_scaled[us_ind[:,0],:]/E_scaled[us_ind[:,0],:])
          E_scaled[us_ind[:,0],:] = np.log(E_scaled[us_ind[:,0],:])+1
          E_parm[2] = max(E_scaled)
          E_scaled[us_ind[:,0],:] = 9.0*(E_scaled[us_ind[:,0],:]-1)/(E_parm[2]-1) +1
          dE_scaled[us_ind[:,0],:] = 9.0*dE_scaled[us_ind[:,0],:]/(E_parm[2]-1)
          dE_scaled[us_ind[:,0],:] = np.maximum(dE_scaled[us_ind[:,0],:],np.mean(dE_scaled[np.argwhere(E<=E_parm[1])]))
  
  
          
      return E_parm,E_scaled,dE_scaled
function_tokens: def multiscale_E ( E , dE ) : E_parm = np . zeros ( 3 ) E_parm [ 0 ] = min ( E ) us_ind = np . argsort ( E , axis = 0 ) E_parm [ 1 ] = E [ us_ind [ np . int ( np . round ( E . shape [ 0 ] / 4.0 ) ) , 0 ] , 0 ] E_parm [ 1 ] = min ( max ( E_parm [ 1 ] , E_parm [ 0 ] + 100 * np . mean ( dE [ np . argwhere ( E <= E_parm [ 1 ] ) ] ) ) , max ( E ) ) if E_parm [ 1 ] == E_parm [ 0 ] : E_parm [ 1 ] = min ( E_parm [ 0 ] + 1 , max ( E ) ) E_scaled = ( np . copy ( E ) - E_parm [ 0 ] ) / ( E_parm [ 1 ] - E_parm [ 0 ] ) dE_scaled = np . copy ( dE ) / ( E_parm [ 1 ] - E_parm [ 0 ] ) us_ind = np . argwhere ( E_scaled [ : , 0 ] > 1.0 ) if us_ind . shape [ 0 ] > 0 : dE_scaled [ us_ind [ : , 0 ] , : ] = np . log ( 1 + dE_scaled [ us_ind [ : , 0 ] , : ] / E_scaled [ us_ind [ : , 0 ] , : ] ) E_scaled [ us_ind [ : , 0 ] , : ] = np . log ( E_scaled [ us_ind [ : , 0 ] , : ] ) + 1 E_parm [ 2 ] = max ( E_scaled ) E_scaled [ us_ind [ : , 0 ] , : ] = 9.0 * ( E_scaled [ us_ind [ : , 0 ] , : ] - 1 ) / ( E_parm [ 2 ] - 1 ) + 1 dE_scaled [ us_ind [ : , 0 ] , : ] = 9.0 * dE_scaled [ us_ind [ : , 0 ] , : ] / ( E_parm [ 2 ] - 1 ) dE_scaled [ us_ind [ : , 0 ] , : ] = np . maximum ( dE_scaled [ us_ind [ : , 0 ] , : ] , np . mean ( dE_scaled [ np . argwhere ( E <= E_parm [ 1 ] ) ] ) ) return E_parm , E_scaled , dE_scaled