You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

plot_dsf_k_range.py 698B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #! /usr/bin/env python
  2. """
  3. Plot DSF.
  4. Usage: python plot_dsf_k_range.py [k file] [omega file] [dsf file]
  5. """
  6. import matplotlib.pyplot as plt
  7. import numpy as np
  8. import sys
  9. kfile = str(sys.argv[1])
  10. omegafile = str(sys.argv[2])
  11. dsffile = str(sys.argv[3])
  12. k = np.loadtxt(kfile)
  13. omega = np.loadtxt(omegafile)
  14. dsf = np.loadtxt(dsffile)
  15. dsfsmax = 0.5
  16. plt.pcolormesh(k, omega, dsf, vmax=dsfsmax)
  17. plt.colorbar()
  18. plt.xlabel('$k$')
  19. plt.ylabel('$\omega$')
  20. elements = dsffile.split('_')
  21. c_int = elements[3]
  22. L = elements[5]
  23. N = elements[7]
  24. width = elements[22].partition('.')[0]
  25. rho = int(N)/int(L)
  26. plt.title(f'c={c_int}, rho={rho} (N={N}), w={width}')
  27. plt.savefig(dsffile.replace('.', '_') + '.png')