diff --git a/eos-toys/plot-sample.py b/eos-toys/plot-sample.py index bbec625..6d4bd0c 100644 --- a/eos-toys/plot-sample.py +++ b/eos-toys/plot-sample.py @@ -2,7 +2,7 @@ # @Author: Elena Graverini # @Date: 2017-03-16 11:20:45 # @Last Modified by: Elena Graverini -# @Last Modified time: 2017-05-10 15:50:43 +# @Last Modified time: 2017-05-10 16:52:40 # import matplotlib from __future__ import division import sys, os, gc @@ -60,9 +60,13 @@ plt.savefig(pkl_file.replace('.pkl', '.pdf')) -def superimpose(files, datafiles, labels, outname): - colors = ['#0078FF', '#FF6600', '#0AAFB6', '#FF3333', '#0000FF', '#00CC00', '#BF8040', '#FF33CC', '#FF7733'] - colors.extend(colors) +def superimpose(files, datafiles, labels, outname, lepton): + # colors = ['#0078FF', '#FF6600', '#0AAFB6', '#FF3333', '#0000FF', '#00CC00', '#BF8040', '#FF33CC', '#FF7733'] + colors = ['#0078FF', '#FF6600', '#0AAFB6', '#FF3333', '#0000FF', '#00CC00', '#FF33CC'] + styles = ['-'] * len(colors) + if len(files) > len(colors): + styles.extend(['--'] * len(colors)) + colors.extend(colors) ds = [] for i, f in enumerate(files): try: @@ -70,9 +74,17 @@ except IOError: make_pickle(f, datafiles[i]) ds.append(pickle.load(open(f, 'rb'))) + ax = plt.subplot(111) for i in range(len(files)): - plt.plot(ds[i]['bin_centers'], ds[i]['bin_contents'], label=labels[i], color=colors[i], linewidth=2.0) - plt.legend(loc='best') + ax.plot(ds[i]['bin_centers'], ds[i]['bin_contents'], styles[i], label=labels[i], color=colors[i], linewidth=2.0) + ax.set_xlabel('$q^2$ (GeV)') + ax.set_ylabel(r'$d\Gamma\left(\Lambda_b\to\Lambda_c^\star\{lepton}\nu\right) / dq^2$'.format(lepton=lepton)) + # Shrink current axis by 10% + box = ax.get_position() + ax.set_position([box.x0, box.y0, box.width * 0.9, box.height]) + # plt.legend(loc='best') + # Put a legend to the right of the current axis + ax.legend(loc='center left', fancybox=True, shadow=True, bbox_to_anchor=(1, 0.5)) plt.savefig(outname) plt.close("all") @@ -224,5 +236,5 @@ r'HQT, $\rho=0.0$, $\rho_{3b}=0.05$', r'HQT, $\rho=0.05$, $\rho_{3b}=0.05$', ] - superimpose(files_mu, datafiles_mu, labels, out_mu) - superimpose(files_tau, datafiles_tau, labels, out_tau) + superimpose(files_mu, datafiles_mu, labels, out_mu, 'mu') + superimpose(files_tau, datafiles_tau, labels, out_tau, 'tau') diff --git a/eos-toys/send_to_zurich.sh b/eos-toys/send_to_zurich.sh index 568cab2..0d80687 100755 --- a/eos-toys/send_to_zurich.sh +++ b/eos-toys/send_to_zurich.sh @@ -1,11 +1,17 @@ # @Author: Elena Graverini # @Date: 2017-03-21 13:55:51 # @Last Modified by: Elena Graverini -# @Last Modified time: 2017-05-02 17:06:23 +# @Last Modified time: 2017-05-17 11:46:24 #!/bin/bash -mkdir -p /home/elena/Desktop/PhD_Work/zurich-cluster -sshfs egraveri@grid-ui.physik.uzh.ch: /home/elena/Desktop/PhD_Work/zurich-cluster +#!/bin/bash + +# Needs the following environment variables: +# - $zurich_cluster_mountpoint pointing to the desired mountpoint +# - $zurich_user with your username on the Zurich cluster + +mkdir -p $zurich_cluster_mountpoint +sshfs ${zurich_user}@grid-ui.physik.uzh.ch:/disk/data1/hep/LbLcsFF $zurich_cluster_mountpoint cd .. -rsync -rd eos-toys /home/elena/Desktop/PhD_Work/zurich-cluster/Public/eos-toys +rsync -rd eos-toys $zurich_cluster_mountpoint/eos-toys cd eos-toys -fusermount -u /home/elena/Desktop/PhD_Work/zurich-cluster || sudo umount -l /home/elena/Documents/University/PhD/UZH/zurich-cluster +fusermount -u $zurich_cluster_mountpoint || sudo umount -l $zurich_cluster_mountpoint