From 3b3645292d6f865e84b1cb3af118ff779275fa46 Mon Sep 17 00:00:00 2001
From: Yngve Inntjore Levinsen <Yngve.Levinsen@esss.se>
Date: Fri, 23 Sep 2016 08:00:00 +0200
Subject: [PATCH] added some documentation for ess.TraceWin

---
 README.md | 29 +++++++++++++++++++++++++++--
 1 file changed, 27 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index c13bebe..966e2fe 100644
--- a/README.md
+++ b/README.md
@@ -89,9 +89,34 @@ loss_den_from_ptrn=ptrn.loss_den(file_name_dt,dtl_dt=5e-6)
 
 There is another larger example of how you may modify the lattice in the examples folder, see [manipulate_lattice.py](examples/manipulate_lattice/manipulate_lattice.py).
 
-### Library
+### ess.TraceWin module
+
+This module was developed in parallell with lib_tw, and contains some overlapping functionality. The module allows you to read (and sometimes write) the various binary files from TraceWin into a pythonized object. Some example usecases follows below.
+For more documentation, also check the built-in help ``help(ess.TraceWin)``
+
+```
+# Example: read in plt file, write dst file for each location
+from ess import TraceWin
+
+data=TraceWin.plt('dtl1.plt')
+for i in data.Nelp:
+    data.save_dst(i,'distribution_{}.dst'.format(i))
+
+# Example: read in many Density files from a folder, put data into one HDF5 file
+
+from ess import TraceWin
+import os
+
+for f in os.listdir('calc'):
+    if f[:7]=='Density' and f[-3:]=='dat':
+        fpath=os.path.join('calc',f)
+        group_name=f[8:-4]
+        data=TraceWin.density_file(fpath)
+        data.savetohdf('Density.h5',group_name)
+
+
+```
 
-To be done..
 
 ### Error study script
 
-- 
GitLab