Skip to content
Snippets Groups Projects
Verified Commit 11878b92 authored by Paul Dechamps's avatar Paul Dechamps :speech_balloon:
Browse files

(fix) Removed unsused methods in utils.py

parent b579c340
No related branches found
No related tags found
1 merge request!1BLASTER v1.0
......@@ -204,29 +204,3 @@ def getSolution(sections, write=False, toW=['x', 'xelm', 'theta', 'H', 'deltaSta
f.close()
print('done.')
return sol
def read(filename, delim=',', skip=1):
"""Read from file and store in data array
"""
import io
import numpy as np
# read file
fl = io.open(filename, 'r')
label = fl.readline().split(',')
fl.close()
data = np.loadtxt(filename, delimiter=delim, skiprows=skip)
return data
def plot(cfg):
from matplotlib import pyplot as plt
for i in range(len(cfg['curves'])):
plt.plot(cfg['curves'][i][:,0], cfg['curves'][i][:,1], cfg['ls'][i], color=cfg['color'][i], lw=cfg['lw'][i], label=cfg['labels'][i])
if 'yreverse' in cfg and cfg['yreverse'] is True: plt.gca().invert_yaxis()
if 'xreverse' in cfg and cfg['xreverse'] is True: plt.gca().invert_xaxis()
if 'title' in cfg: plt.title(cfg['title'])
if 'xlim' in cfg: plt.xlim(cfg['xlim'])
if 'ylim' in cfg: plt.ylim(cfg['ylim'])
if 'legend' in cfg and cfg['legend'] is True: plt.legend(frameon=False)
if 'xlabel' in cfg: plt.xlabel(cfg['xlabel'])
if 'ylabel' in cfg: plt.ylabel(cfg['ylabel'])
plt.show()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment