source: trunk/UTIL/PYTHON/powerlaw/dropsize.py @ 1062

Last change on this file since 1062 was 1053, checked in by aslmd, 11 years ago

UTIL PYTHON. tools to study dust devils in LES.

  • Property svn:executable set to *
File size: 1.3 KB
Line 
1#! /usr/bin/env python
2import matplotlib.pyplot as mpl
3import ppplot
4import numpy as np
5
6##########################################################
7namefile = "/home/aymeric/Big_Data/LES_dd/psfc_f18.ncm1_1.txt"
8namefile = "/home/aymeric/Big_Data/LES_dd/psfc_f18.ncm2_1.txt"
9#namefile = "/home/aymeric/Big_Data/LES_dd/psfc.LMD_LES_MARS.160564.ncm1_1.txt"
10#namefile = "/home/aymeric/Big_Data/LES_dd/psfc.LMD_LES_MARS.160564.ncm2_1.txt"
11#namefile = "/home/aymeric/Big_Data/LES_dd/press_ustm_exomars.nc1.txt"
12#namefile = "/home/aymeric/Big_Data/LES_dd/psfc_oldinsight100m.ncm1_1.txt"
13##########################################################
14
15# read data np.loadtxt?
16## import pylab as plb data = plb.loadtxt('data.dat') x = data[:,0] y= data[:,1]
17f = open(namefile,'r')
18t = [] ; s = [] ; d = [] ; i = [] ; j = []
19for line in f:
20    ct,cs,cd,ci,cj = line.strip().split(';')
21    t.append(float(ct))
22    s.append(float(cs)) ; d.append(float(cd))
23    i.append(int(ci)) ; j.append(int(cj))
24f.close()
25# ensure numpy array
26t = np.array(t) ; s = np.array(s) ; d = np.array(d) ; i = np.array(i) ; j = np.array(j)
27
28drop = ppplot.plot1d() ; drop.field = d ; drop.absc = s
29drop.lstyle = '' ; drop.marker = '.' ; drop.color = 'r' ; drop.fmt = "%.1f"
30drop.xlabel = "Vortex size (m)" ; drop.ylabel = "Pressure drop (Pa)"
31drop.make() ; ppplot.save()
32
Note: See TracBrowser for help on using the repository browser.