Skip to content

Commit 7bd62ac

Browse files
committed
Merge branch 'develop' of llrgit.in2p3.fr:smilei/smilei into develop
2 parents 02b9bd8 + d49ab54 commit 7bd62ac

File tree

5 files changed

+38
-21
lines changed

5 files changed

+38
-21
lines changed

doc/Sphinx/tables.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ We have computed some tables with several levels of discretizations that you can
121121

122122
This table size is a good compromise between accuracy and memory cost.
123123
2D tables can fit in L2 cache although the pressure on the cache will be high.
124+
This set of tables is the one included by default in the sources of :program:`Smilei`
124125

125126
.. code-block:: bash
126127
@@ -134,8 +135,6 @@ This table size is a good compromise between accuracy and memory cost.
134135
135136
`multiphoton_breit_wheeler_tables.h5 <http://mdls-internet.extra.cea.fr/projects/Smilei/uploads/tables_256/multiphoton_breit_wheeler_tables.h5>`_
136137

137-
This set of tables is included by default in the sources of :program:`Smilei`
138-
139138
512 points
140139
"""""""""""
141140

tools/tables/dump_multiphoton_Breit_Wheeler.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@
55

66
import h5py as h5py
77
import numpy as np
8+
import sys
9+
10+
# ______________________________________________________________________________
11+
# Checks
12+
13+
try:
14+
path = sys.argv[1]
15+
except:
16+
print("\n Please, provide a path to the tables.\n")
17+
raise
818

919
# ______________________________________________________________________________
1020
# Functions
@@ -17,15 +27,15 @@ def if_file_exist(filename):
1727
file = open(filename)
1828
except IOError:
1929
flag = False
20-
print ' No file : ', filename
30+
print(' No file: {}'.format(filename))
2131
return flag
2232

2333
# ______________________________________________________________________________
2434
# Read the table integration_dt_dchi
2535

26-
if if_file_exist('./multiphoton_Breit_Wheeler_tables.h5'):
36+
if if_file_exist(path):
2737

28-
f = h5py.File('./multiphoton_Breit_Wheeler_tables.h5', "r")
38+
f = h5py.File(path, "r")
2939

3040
if 'integration_dt_dchi' in f:
3141

@@ -48,9 +58,9 @@ def if_file_exist(filename):
4858
# ______________________________________________________________________________
4959
# Read the table min particle chi for xi
5060

51-
if if_file_exist('./multiphoton_Breit_Wheeler_tables.h5'):
61+
if if_file_exist(path):
5262

53-
f = h5py.File('./multiphoton_Breit_Wheeler_tables.h5', "r")
63+
f = h5py.File(path, "r")
5464

5565
if 'min_particle_chi_for_xi' in f:
5666

@@ -73,9 +83,9 @@ def if_file_exist(filename):
7383
# ______________________________________________________________________________
7484
# Read the table xi
7585

76-
if if_file_exist('./multiphoton_Breit_Wheeler_tables.h5'):
86+
if if_file_exist(path):
7787

78-
f = h5py.File('./multiphoton_Breit_Wheeler_tables.h5', "r")
88+
f = h5py.File(path, "r")
7989

8090
if 'xi' in f:
8191

tools/tables/dump_nonlinear_inverse_Compton_scattering.py

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55

66
import h5py as h5py
77
import numpy as np
8+
import sys
9+
# ______________________________________________________________________________
10+
# Checks
11+
12+
try:
13+
path = sys.argv[1]
14+
except:
15+
print("\n Please, provide a path to the tables.\n")
16+
raise
817

918
# ______________________________________________________________________________
1019
# Functions
@@ -17,15 +26,15 @@ def if_file_exist(filename):
1726
file = open(filename)
1827
except IOError:
1928
flag = False
20-
print ' No file : ', filename
29+
print(' No file: {}'.format(filename))
2130
return flag
2231

2332
# ______________________________________________________________________________
2433
# Dump the table integfochi
2534

26-
if if_file_exist('./radiation_tables.h5'):
35+
if if_file_exist(path):
2736

28-
f = h5py.File('./radiation_tables.h5', "r")
37+
f = h5py.File(path, "r")
2938

3039
if 'integfochi' in f:
3140

@@ -48,9 +57,9 @@ def if_file_exist(filename):
4857
# ______________________________________________________________________________
4958
# Read the table h
5059

51-
if if_file_exist('./radiation_tables.h5'):
60+
if if_file_exist(path):
5261

53-
f = h5py.File('./radiation_tables.h5', "r")
62+
f = h5py.File(path, "r")
5463

5564
if 'h' in f:
5665

@@ -73,9 +82,9 @@ def if_file_exist(filename):
7382
# ______________________________________________________________________________
7483
# Read the table min photon chi for xi
7584

76-
if if_file_exist('./radiation_tables.h5'):
85+
if if_file_exist(path):
7786

78-
f = h5py.File('./radiation_tables.h5', "r")
87+
f = h5py.File(path, "r")
7988

8089
if 'min_photon_chi_for_xi' in f:
8190

@@ -98,9 +107,9 @@ def if_file_exist(filename):
98107
# ______________________________________________________________________________
99108
# Read the table xip
100109

101-
if if_file_exist('./radiation_tables.h5'):
110+
if if_file_exist(path):
102111

103-
f = h5py.File('./radiation_tables.h5', "r")
112+
f = h5py.File(path, "r")
104113

105114
if 'xi' in f:
106115

tools/tables/show_multiphoton_Breit_Wheeler.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
print("\n Please, provide a path to the tables.\n")
4646
raise
4747

48-
4948
# ______________________________________________________________________________
5049
# Functions
5150

@@ -57,7 +56,7 @@ def if_file_exist(filename):
5756
file = open(filename)
5857
except IOError:
5958
flag = False
60-
print ' No file : ', filename
59+
print(' No file: {}'.format(filename))
6160
return flag
6261

6362

tools/tables/show_nonlinear_inverse_Compton_scattering.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def if_file_exist(filename):
5757
file = open(filename)
5858
except IOError:
5959
flag = False
60-
print ' No file : ', filename
60+
print(' No file: {}'.format(filename))
6161
return flag
6262

6363
# ______________________________________________________________________________

0 commit comments

Comments
 (0)