<commit_before>"""
  Common parameter conversions in the electron microscope
     
  Copyright (c) 2013, rhambach. 
    This file is part of the TEM-AREELS package and released
    under the MIT-Licence. See LICENCE file for details.
"""

import numpy as np;

# constants in atomic units, e=hbar=m=1/(4pi eps0)=1
c       = 137.0;           # a.u.
bohr    = 0.52917720859;   # Angstrom
Hartree = 27.211396;       # eV
E0 	= 510.9989;	   # rest mass of electron in keV

# conversion routines
def gamma(V):
  """  gamma = 1 / sqrt( 1-beta^2 ) """
  return 1./np.sqrt(1.-beta(V)**2);

def beta(V):
  """Calculates beta from acceleration voltage V [kV]
       beta^2 =  1 - ( E0/(eV+E0) )^2; E0=mc^2
  """
  return np.sqrt( 1- E0**2/(V+E0)**2 );
<commit_msg>more accurate constant for speed of light in conversion.py<commit_after>"""
  Common parameter conversions in the electron microscope
     
  Copyright (c) 2013, rhambach. 
    This file is part of the TEM-AREELS package and released
    under the MIT-Licence. See LICENCE file for details.
"""

import numpy as np;

# constants in atomic units, e=hbar=m=1/(4pi eps0)=1
c       = 137.035999074;   # a.u.
bohr    = 0.52917720859;   # Angstrom
Hartree = 27.211396;       # eV
E0      = 510.9989;	       # rest mass of electron in keV

# conversion routines
def gamma(V):
  """  gamma = 1 / sqrt( 1-beta^2 ) """
  return 1./np.sqrt(1.-beta(V)**2);

def beta(V):
  """Calculates beta from acceleration voltage V [kV]
       beta^2 =  1 - ( E0/(eV+E0) )^2; E0=mc^2
  """
  return np.sqrt( 1- E0**2/(V+E0)**2 );

{'fraction_non_alphanumeric': 0.14175753688261705, 'fraction_numerical': 0.07953816549069917, 'mean_word_length': 2.75, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7278388', 'n_tokens_mistral': 668, 'n_tokens_neox': 572, 'n_words': 178}