Skip to content

Commit

Permalink
Solve #10, update command-line example
Browse files Browse the repository at this point in the history
  • Loading branch information
lorisercole committed Nov 18, 2019
1 parent b5da08a commit 37fb881
Show file tree
Hide file tree
Showing 10 changed files with 33,733 additions and 33,686 deletions.
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
- id: double-quote-string-fixer
- id: end-of-file-fixer
- id: trailing-whitespace
exclude: >
(?x)^(
docs/.*|
examples/.*|
)$
# # prospector: collection of linters
# - id: prospector
Expand Down
2,859 changes: 1,430 additions & 1,429 deletions examples/example_commandline_NaCl/output_ref.cepstral.dat

Large diffs are not rendered by default.

1,653 changes: 827 additions & 826 deletions examples/example_commandline_NaCl/output_ref.cepstrumfiltered_psd.dat

Large diffs are not rendered by default.

19,998 changes: 9,999 additions & 9,999 deletions examples/example_commandline_NaCl/output_ref.cospectrum.dat

Large diffs are not rendered by default.

20,002 changes: 10,001 additions & 10,001 deletions examples/example_commandline_NaCl/output_ref.cospectrum.filt.dat

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions examples/example_commandline_NaCl/output_ref.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Command:
/home/lercole/.virtualenvs/thermotest3/bin/thermocepstrum-analysis ../data/NaCl.dat -k flux -j vcm[1] -t 5.0 -V 65013.301261 -w 0.1 --FSTAR 14.0 -r

Input file (table): ../data/NaCl.dat
Units: metal
Time step: 5.0 fs
Mean Temperature (computed): 1399.3477811999999 K +/- 19.318785820942594
Volume (input): 65013.301261 A^3
Time step (input): 5.0 fs
currents shape is (2, 20000, 3)
Number of currrents = 2
Number of components = 3
kappa_scale = 1.4604390788939313e-07
Nyquist_f = 100.0 THz
-----------------------------------------------------
RESAMPLE TIME SERIES
-----------------------------------------------------
Original Nyquist freq f_Ny = 100.00000 THz
Resampling freq f* = 14.28571 THz
Sampling time TSKIP = 7 steps
= 35.000 fs
Original n. of frequencies = 10001
Resampled n. of frequencies = 1429
PSD @cutoff (pre-filter) = 443152.37265
(post-filter) = 564877.86516
log(PSD) @cutoff (pre-filter) = 12.89638
(post-filter) = 13.05597
min(PSD) (pre-filter) = 0.31536
min(PSD) (post-filter) = 22166.11934
% of original PSD Power f<f* (pre-filter) = 96.678574
-----------------------------------------------------
-----------------------------------------------------
CEPSTRAL ANALYSIS
-----------------------------------------------------
AIC_Kmin = 3 (P* = 4, corr_factor = 1.000000)
L_0* = 15.158757 +/- 0.056227
S_0* = 6824108.702608 +/- 383697.095268
-----------------------------------------------------
kappa* = 0.498310 +/- 0.028018 W/mK
-----------------------------------------------------
Binary file modified examples/example_commandline_NaCl/output_ref.plots.pdf
Binary file not shown.
19,993 changes: 9,997 additions & 9,996 deletions examples/example_commandline_NaCl/output_ref.psd.dat

Large diffs are not rendered by default.

2,859 changes: 1,430 additions & 1,429 deletions examples/example_commandline_NaCl/output_ref.resampled_psd.dat

Large diffs are not rendered by default.

10 changes: 4 additions & 6 deletions thermocepstrum/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def main():
jdata = jfile.data
START_STEP = 0 # reset to zero, as later we will need to read all of jdata
elif (input_format == 'dict'):
jdata = np.load(inputfile,allow_pickle=True).tolist()
jdata = np.load(inputfile, allow_pickle=True).tolist()
elif (input_format == 'lammps'):
jfile = tc.i_o.LAMMPSLogFile(inputfile, run_keyword=run_keyword)
if temperature is None:
Expand Down Expand Up @@ -560,7 +560,7 @@ def plt_cepstral_conv(jf, pstar_max=None, k_SI_max=None, pstar_tick=None, kappa_
if k_SI_max is None:
k_SI_max = jf.dct.tau[jf.dct.aic_Kmin] * jf.kappa_scale

f, (ax2) = plt.subplots(1, 1, figsize=(3.8, 2.3))
f, ax2 = plt.subplots(1, 1, figsize=(3.8, 2.3))
ax2.axvline(x=jf.dct.aic_Kmin + 1, ls='--', c='k', dashes=(1.4, 0.6), zorder=-3)
ax2.fill_between(np.arange(jf.dct.logtau.shape[0]) + 1,\
(jf.dct.tau - jf.dct.tau_THEORY_std) * jf.kappa_scale * 0.5,\
Expand Down Expand Up @@ -607,8 +607,7 @@ def plt_other(jf, idx1, idx2, f_THz_max=None, k_SI_max=None, k_SI_min=None, k_ti
if k_SI_min is None:
k_SI_min = -k_SI_max

figure=plt.figure(figsize=(3.8, 2.3))
ax=figure.add_subplots()
figure, ax = plt.subplots(1, 1, figsize=(3.8, 2.3))
ax.plot(jf.freqs_THz, np.real(jf.fcospectrum[idx1][idx2]) * jf.kappa_scale * 0.5, c=c[3], lw=1.0, zorder=1)
ax.plot(jf.freqs_THz, np.imag(jf.fcospectrum[idx1][idx2]) * jf.kappa_scale * 0.5, c=c[2], lw=1.0, zorder=1)

Expand Down Expand Up @@ -653,8 +652,7 @@ def plt_psd(jf, j2=None, j2pl=None, f_THz_max=None, k_SI_max=None, k_tick=None,
k_SI_max = np.max(
jf.fpsd[:int(jf.freqs_THz.shape[0] * f_THz_max / jf.freqs_THz[-1])] * jf.kappa_scale * 0.5) * 1.3

figure=plt.figure(figsize=(3.8, 2.3))
ax=figure.add_subplot()
figure, ax = plt.subplots(1, 1, figsize=(3.8, 2.3))
ax.plot(jf.freqs_THz, jf.psd * jf.kappa_scale * 0.5, lw=0.2, c='0.8', zorder=0)
ax.plot(jf.freqs_THz, jf.fpsd * jf.kappa_scale * 0.5, c=c[0], zorder=2)
if j2 is not None:
Expand Down

0 comments on commit 37fb881

Please sign in to comment.