#!python """Bootstrap distribute installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from distribute_setup import use_setuptools use_setuptools() If you want to require a specific version of setuptools, set a download mirror, or use an alternate download directory, you can do so by supplying the appropriate options to ``use_setuptools()``. This file can also be run as a script to install or upgrade setuptools. """ import os import sys import time import fnmatch import tempfile import tarfile from distutils import log try: from site import USER_SITE except ImportError: USER_SITE = None try: import subprocess def _python_cmd(*args): args = (sys.executable,) + args return subprocess.call(args) == 0 except ImportError: # will be used for python 2.3 def _python_cmd(*args): args = (sys.executable,) + args # quoting arguments if windows if sys.platform == 'win32': def quote(arg): if ' ' in arg: return '"%s"' % arg return arg args = [quote(arg) for arg in args] return os.spawnl(os.P_WAIT, sys.executable, *args) == 0 DEFAULT_VERSION = "0.6.21" DEFAULT_URL = "http://pypi.python.org/packages/source/d/distribute/" SETUPTOOLS_FAKED_VERSION = "0.6c11" SETUPTOOLS_PKG_INFO = """\ Metadata-Version: 1.0 Name: setuptools Version: %s Summary: xxxx Home-page: xxx Author: xxx Author-email: xxx License: xxx Description: xxx """ % SETUPTOOLS_FAKED_VERSION def _install(tarball): # extracting the tarball tmpdir = tempfile.mkdtemp() log.warn('Extracting in %s', tmpdir) old_wd = os.getcwd() try: os.chdir(tmpdir) tar = tarfile.open(tarball) _extractall(tar) tar.close() # going in the directory subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0]) os.chdir(subdir) log.warn('Now working in %s', subdir) # installing log.warn('Installing Distribute') if not _python_cmd('setup.py', 'install'): log.warn('Something went wrong during the installation.') log.warn('See the error message above.') finally: os.chdir(old_wd) def _build_egg(egg, tarball, to_dir): # extracting the tarball tmpdir = tempfile.mkdtemp() log.warn('Extracting in %s', tmpdir) old_wd = os.getcwd() try: os.chdir(tmpdir) tar = tarfile.open(tarball) _extractall(tar) tar.close() # going in the directory subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0]) os.chdir(subdir) log.warn('Now working in %s', subdir) # building an egg log.warn('Building a Distribute egg in %s', to_dir) _python_cmd('setup.py', '-q', 'bdist_egg', '--dist-dir', to_dir) finally: os.chdir(old_wd) # returning the result log.warn(egg) if not os.path.exists(egg): raise IOError('Could not build the egg.') def _do_download(version, download_base, to_dir, download_delay): egg = os.path.join(to_dir, 'distribute-%s-py%d.%d.egg' % (version, sys.version_info[0], sys.version_info[1])) if not os.path.exists(egg): tarball = download_setuptools(version, download_base, to_dir, download_delay) _build_egg(egg, tarball, to_dir) sys.path.insert(0, egg) import setuptools setuptools.bootstrap_install_from = egg def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, download_delay=15, no_fake=True): # making sure we use the absolute path to_dir = os.path.abspath(to_dir) was_imported = 'pkg_resources' in sys.modules or \ 'setuptools' in sys.modules try: try: import pkg_resources if not hasattr(pkg_resources, '_distribute'): if not no_fake: _fake_setuptools() raise ImportError except ImportError: return _do_download(version, download_base, to_dir, download_delay) try: pkg_resources.require("distribute>="+version) return except pkg_resources.VersionConflict: e = sys.exc_info()[1] if was_imported: sys.stderr.write( "The required version of distribute (>=%s) is not available,\n" "and can't be installed while this script is running. Please\n" "install a more recent version first, using\n" "'easy_install -U distribute'." "\n\n(Currently using %r)\n" % (version, e.args[0])) sys.exit(2) else: del pkg_resources, sys.modules['pkg_resources'] # reload ok return _do_download(version, download_base, to_dir, download_delay) except pkg_resources.DistributionNotFound: return _do_download(version, download_base, to_dir, download_delay) finally: if not no_fake: _create_fake_setuptools_pkg_info(to_dir) def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, delay=15): """Download distribute from a specified location and return its filename `version` should be a valid distribute version number that is available as an egg for download under the `download_base` URL (which should end with a '/'). `to_dir` is the directory where the egg will be downloaded. `delay` is the number of seconds to pause before an actual download attempt. """ # making sure we use the absolute path to_dir = os.path.abspath(to_dir) try: from urllib.request import urlopen except ImportError: from urllib2 import urlopen tgz_name = "distribute-%s.tar.gz" % version url = download_base + tgz_name saveto = os.path.join(to_dir, tgz_name) src = dst = None if not os.path.exists(saveto): # Avoid repeated downloads try: log.warn("Downloading %s", url) src = urlopen(url) # Read/write all in one block, so we don't create a corrupt file # if the download is interrupted. data = src.read() dst = open(saveto, "wb") dst.write(data) finally: if src: src.close() if dst: dst.close() return os.path.realpath(saveto) def _no_sandbox(function): def __no_sandbox(*args, **kw): try: from setuptools.sandbox import DirectorySandbox if not hasattr(DirectorySandbox, '_old'): def violation(*args): pass DirectorySandbox._old = DirectorySandbox._violation DirectorySandbox._violation = violation patched = True else: patched = False except ImportError: patched = Fals
PSTAR: Stopping Powers and Range Tables for Protons
WATER, LIQUID
Kinetic Electron. Nuclear Total CSDA Projected Detour
Energy Stp. Pow. Stp. Pow. Stp. Pow. Range Range Factor
MeV MeV cm2/g MeV cm2/g MeV cm2/g g/cm2 g/cm2
1.000E-03 1.337E+02 4.315E+01 1.769E+02 6.319E-06 2.878E-06 0.4555
1.500E-03 1.638E+02 3.460E+01 1.984E+02 8.969E-06 4.400E-06 0.4906
2.000E-03 1.891E+02 2.927E+01 2.184E+02 1.137E-05 5.909E-06 0.5197
2.500E-03 2.114E+02 2.557E+01 2.370E+02 1.357E-05 7.380E-06 0.5440
3.000E-03 2.316E+02 2.281E+01 2.544E+02 1.560E-05 8.811E-06 0.5647
4.000E-03 2.675E+02 1.894E+01 2.864E+02 1.930E-05 1.155E-05 0.5986
5.000E-03 2.990E+02 1.631E+01 3.153E+02 2.262E-05 1.415E-05 0.6254
6.000E-03 3.276E+02 1.439E+01 3.420E+02 2.567E-05 1.661E-05 0.6473
7.000E-03 3.538E+02 1.292E+01 3.667E+02 2.849E-05 1.896E-05 0.6656
8.000E-03 3.782E+02 1.175E+01 3.900E+02 3.113E-05 2.121E-05 0.6813
9.000E-03 4.012E+02 1.080E+01 4.120E+02 3.363E-05 2.337E-05 0.6950
1.000E-02 4.229E+02 1.000E+01 4.329E+02 3.599E-05 2.545E-05 0.7070
1.250E-02 4.660E+02 8.485E+00 4.745E+02 4.150E-05 3.037E-05 0.7318
1.500E-02 5.036E+02 7.400E+00 5.110E+02 4.657E-05 3.499E-05 0.7514
1.750E-02 5.372E+02 6.581E+00 5.437E+02 5.131E-05 3.938E-05 0.7674
2.000E-02 5.673E+02 5.939E+00 5.733E+02 5.578E-05 4.356E-05 0.7808
2.250E-02 5.946E+02 5.421E+00 6.001E+02 6.005E-05 4.757E-05 0.7923
2.500E-02 6.195E+02 4.993E+00 6.245E+02 6.413E-05 5.144E-05 0.8022
2.750E-02 6.421E+02 4.633E+00 6.467E+02 6.806E-05 5.519E-05 0.8109
3.000E-02 6.628E+02 4.325E+00 6.671E+02 7.187E-05 5.883E-05 0.8187
3.500E-02 6.989E+02 3.826E+00 7.028E+02 7.916E-05 6.585E-05 0.8319
4.000E-02 7.290E+02 3.437E+00 7.324E+02 8.613E-05 7.259E-05 0.8429
4.500E-02 7.538E+02 3.126E+00 7.569E+02 9.284E-05 7.911E-05 0.8522
5.000E-02 7.740E+02 2.870E+00 7.768E+02 9.935E-05 8.547E-05 0.8602
5.500E-02 7.901E+02 2.655E+00 7.927E+02 1.057E-04 9.169E-05 0.8673
6.000E-02 8.026E+02 2.473E+00 8.050E+02 1.120E-04 9.782E-05 0.8735
6.500E-02 8.119E+02 2.316E+00 8.142E+02 1.182E-04 1.039E-04 0.8791
7.000E-02 8.183E+02 2.178E+00 8.205E+02 1.243E-04 1.099E-04 0.8842
7.500E-02 8.223E+02 2.058E+00 8.243E+02 1.303E-04 1.159E-04 0.8889
8.000E-02 8.241E+02 1.951E+00 8.260E+02 1.364E-04 1.218E-04 0.8931
8.500E-02 8.239E+02 1.855E+00 8.258E+02 1.425E-04 1.278E-04 0.8971
9.000E-02 8.222E+02 1.769E+00 8.239E+02 1.485E-04 1.338E-04 0.9007
9.500E-02 8.190E+02 1.691E+00 8.206E+02 1.546E-04 1.398E-04 0.9041
1.000E-01 8.145E+02 1.620E+00 8.161E+02 1.607E-04 1.458E-04 0.9073
1.250E-01 7.801E+02 1.343E+00 7.814E+02 1.920E-04 1.767E-04 0.9207
1.500E-01 7.360E+02 1.152E+00 7.371E+02 2.249E-04 2.094E-04 0.9310
1.750E-01 6.959E+02 1.010E+00 6.969E+02 2.598E-04 2.440E-04 0.9393
2.000E-01 6.604E+02 9.016E-01 6.613E+02 2.966E-04 2.806E-04 0.9460
2.250E-01 6.286E+02 8.152E-01 6.294E+02 3.354E-04 3.191E-04 0.9515
2.500E-01 5.999E+02 7.447E-01 6.006E+02 3.761E-04 3.596E-04 0.9562
2.750E-01 5.737E+02 6.855E-01 5.744E+02 4.186E-04 4.019E-04 0.9601
3.000E-01 5.497E+02 6.351E-01 5.504E+02 4.631E-04 4.462E-04 0.9635
3.500E-01 5.075E+02 5.545E-01 5.080E+02 5.577E-04 5.404E-04 0.9689
4.000E-01 4.714E+02 4.928E-01 4.719E+02 6.599E-04 6.422E-04 0.9731
4.500E-01 4.401E+02 4.439E-01 4.406E+02 7.697E-04 7.515E-04 0.9764
5.000E-01 4.128E+02 4.043E-01 4.132E+02 8.869E-04 8.683E-04 0.9790
5.500E-01 3.888E+02 3.715E-01 3.891E+02 1.012E-03 9.926E-04 0.9811
6.000E-01 3.676E+02 3.438E-01 3.680E+02 1.144E-03 1.124E-03 0.9829
6.500E-01 3.489E+02 3.201E-01 3.492E+02 1.283E-03 1.263E-03 0.9844
7.000E-01 3.322E+02 2.996E-01 3.325E+02 1.430E-03 1.410E-03 0.9857
7.500E-01 3.172E+02 2.817E-01 3.175E+02 1.584E-03 1.563E-03 0.9868
8.000E-01 3.037E+02 2.658E-01 3.039E+02 1.745E-03 1.724E-03 0.9877
8.500E-01 2.914E+02 2.516E-01 2.917E+02 1.913E-03 1.891E-03 0.9886
9.000E-01 2.803E+02 2.390E-01 2.805E+02 2.088E-03 2.066E-03 0.9893
9.500E-01 2.700E+02 2.276E-01 2.702E+02 2.270E-03 2.247E-03 0.9899
1.000E+00 2.606E+02 2.173E-01 2.608E+02 2.458E-03 2.435E-03 0.9905
1.250E+00 2.228E+02 1.775E-01 2.229E+02 3.499E-03 3.472E-03 0.9925
1.500E+00 1.955E+02 1.504E-01 1.957E+02 4.698E-03 4.669E-03 0.9938
1.750E+00 1.748E+02 1.307E-01 1.749E+02 6.052E-03 6.020E-03 0.9946
2.000E+00 1.585E+02 1.157E-01 1.586E+02 7.555E-03 7.519E-03 0.9952
2.250E+00 1.453E+02 1.038E-01 1.454E+02 9.203E-03 9.164E-03 0.9957
2.500E+00 1.343E+02 9.428E-02 1.344E+02 1.099E-02 1.095E-02 0.9960
2.750E+00 1.250E+02 8.637E-02 1.251E+02 1.292E-02 1.288E-02 0.9963
3.000E+00 1.171E+02 7.972E-02 1.172E+02 1.499E-02 1.494E-02 0.9965
3.500E+00 1.041E+02 6.916E-02 1.042E+02 1.952E-02 1.946E-02 0.9968
4.000E+00 9.398E+01 6.113E-02 9.404E+01 2.458E-02 2.451E-02 0.9971
4.500E+00 8.580E+01 5.481E-02 8.586E+01 3.015E-02 3.007E-02 0.9973
5.000E+00 7.906E+01 4.970E-02 7.911E+01 3.623E-02 3.613E-02 0.9974
5.500E+00 7.339E+01 4.549E-02 7.343E+01 4.279E-02 4.268E-02 0.9975
6.000E+00 6.854E+01 4.195E-02 6.858E+01 4.984E-02 4.972E-02 0.9976
6.500E+00 6.434E+01 3.894E-02 6.438E+01 5.737E-02 5.724E-02 0.9977
7.000E+00 6.068E+01 3.634E-02 6.071E+01 6.537E-02 6.522E-02 0.9977
7.500E+00 5.744E+01 3.407E-02 5.747E+01 7.384E-02 7.368E-02 0.9978
8.000E+00 5.456E+01 3.208E-02 5.460E+01 8.277E-02 8.259E-02 0.9978
8.500E+00 5.199E+01 3.031E-02 5.202E+01 9.215E-02 9.196E-02 0.9979
9.000E+00 4.966E+01 2.873E-02 4.969E+01 1.020E-01 1.018E-01 0.9979
9.500E+00 4.756E+01 2.731E-02 4.759E+01 1.123E-01 1.120E-01 0.9979
1.000E+01 4.564E+01 2.603E-02 4.567E+01 1.230E-01 1.228E-01 0.9980
1.250E+01 3.813E+01 2.111E-02 3.815E+01 1.832E-01 1.828E-01 0.9981
1.500E+01 3.290E+01 1.778E-02 3.292E+01 2.539E-01 2.535E-01 0.9982
1.750E+01 2.904E+01 1.538E-02 2.905E+01 3.350E-01 3.344E-01 0.9982
2.000E+01 2.605E+01 1.356E-02 2.607E+01 4.260E-01 4.252E-01 0.9983
2.500E+01 2.174E+01 1.098E-02 2.175E+01 6.370E-01 6.359E-01 0.9983
2.750E+01 2.012E+01 1.003E-02 2.013E+01 7.566E-01 7.553E-01 0.9984
3.000E+01 1.875E+01 9.239E-03 1.876E+01 8.853E-01 8.839E-01 0.9984
3.500E+01 1.656E+01 7.983E-03 1.656E+01 1.170E+00 1.168E+00 0.9984
4.000E+01 1.487E+01 7.034E-03 1.488E+01 1.489E+00 1.486E+00 0.9985
4.500E+01 1.353E+01 6.290E-03 1.354E+01 1.841E+00 1.839E+00 0.9985
5.000E+01 1.244E+01 5.691E-03 1.245E+01 2.227E+00 2.224E+00 0.9985
5.500E+01 1.154E+01 5.199E-03 1.154E+01 2.644E+00 2.641E+00 0.9985
6.000E+01 1.078E+01 4.786E-03 1.078E+01 3.093E+00 3.089E+00 0.9986
6.500E+01 1.012E+01 4.435E-03 1.013E+01 3.572E+00 3.567E+00 0.9986
7.000E+01 9.555E+00 4.134E-03 9.559E+00 4.080E+00 4.075E+00 0.9986
7.500E+01 9.059E+00 3.871E-03 9.063E+00 4.618E+00 4.611E+00 0.9986
8.000E+01 8.622E+00 3.641E-03 8.625E+00 5.184E+00 5.176E+00 0.9986
8.500E+01 8.233E+00 3.437E-03 8.236E+00 5.777E+00 5.769E+00 0.9986
9.000E+01 7.884E+00 3.255E-03 7.888E+00 6.398E+00 6.389E+00 0.9986
9.500E+01 7.570E+00 3.092E-03 7.573E+00 7.045E+00 7.035E+00 0.9986
1.000E+02 7.286E+00 2.944E-03 7.289E+00 7.718E+00 7.707E+00 0.9987
1.250E+02 6.190E+00 2.381E-03 6.192E+00 1.146E+01 1.144E+01 0.9987
1.500E+02 5.443E+00 2.001E-03 5.445E+00 1.577E+01 1.576E+01 0.9987
1.750E+02 4.901E+00 1.728E-03 4.903E+00 2.062E+01 2.060E+01 0.9988
2.000E+02 4.491E+00 1.522E-03 4.492E+00 2.596E+01 2.593E+01 0.9988
2.250E+02 4.169E+00 1.361E-03 4.170E+00 3.174E+01 3.171E+01 0.9988
2.500E+02 3.910E+00 1.231E-03 3.911E+00 3.794E+01 3.790E+01 0.9989
2.750E+02 3.697E+00 1.124E-03 3.698E+00 4.452E+01 4.447E+01 0.9989
3.000E+02 3.519E+00 1.035E-03 3.520E+00 5.145E+01 5.139E+01 0.9989
3.500E+02 3.240E+00 8.936E-04 3.241E+00 6.628E+01 6.621E+01 0.9989
4.000E+02 3.031E+00 7.870E-04 3.032E+00 8.225E+01 8.217E+01 0.9990
4.500E+02 2.870E+00 7.037E-04 2.871E+00 9.921E+01 9.912E+01 0.9990
5.000E+02 2.743E+00 6.367E-04 2.743E+00 1.170E+02 1.169E+02 0.9990
5.500E+02 2.640E+00 5.816E-04 2.640E+00 1.356E+02 1.355E+02 0.9991
6.000E+02 2.555E+00 5.355E-04 2.556E+00 1.549E+02 1.547E+02 0.9991
6.500E+02 2.485E+00 4.963E-04 2.485E+00 1.747E+02 1.746E+02 0.9991
7.000E+02 2.426E+00 4.626E-04 2.426E+00 1.951E+02 1.949E+02 0.9991
7.500E+02 2.375E+00 4.333E-04 2.376E+00 2.159E+02 2.158E+02 0.9991
8.000E+02 2.333E+00 4.076E-04 2.333E+00 2.372E+02 2.370E+02 0.9992
8.500E+02 2.296E+00 3.849E-04 2.296E+00 2.588E+02 2.586E+02 0.9992
9.000E+02 2.264E+00 3.646E-04 2.264E+00 2.807E+02 2.805E+02 0.9992
9.500E+02 2.236E+00 3.464E-04 2.236E+00 3.029E+02 3.027E+02 0.9992
1.000E+03 2.211E+00 3.300E-04 2.211E+00 3.254E+02 3.252E+02 0.9992
1.500E+03 2.070E+00 2.249E-04 2.070E+00 5.605E+02 5.601E+02 0.9993
2.000E+03 2.021E+00 1.715E-04 2.021E+00 8.054E+02 8.049E+02 0.9994
2.500E+03 2.004E+00 1.390E-04 2.004E+00 1.054E+03 1.053E+03 0.9995
3.000E+03 2.001E+00 1.171E-04 2.001E+00 1.304E+03 1.303E+03 0.9995
4.000E+03 2.012E+00 8.939E-05 2.012E+00 1.802E+03 1.802E+03 0.9996
5.000E+03 2.031E+00 7.251E-05 2.031E+00 2.297E+03 2.296E+03 0.9996
6.000E+03 2.052E+00 6.112E-05 2.052E+00 2.787E+03 2.786E+03 0.9997
7.000E+03 2.072E+00 5.291E-05 2.072E+00 3.272E+03 3.271E+03 0.9997
8.000E+03 2.091E+00 4.669E-05 2.091E+00 3.752E+03 3.751E+03 0.9997
9.000E+03 2.109E+00 4.181E-05 2.109E+00 4.228E+03 4.227E+03 0.9997
1.000E+04 2.126E+00 3.788E-05 2.126E+00 4.700E+03 4.699E+03 0.9998