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 |
---|
2 | import matplotlib.pyplot as mpl |
---|
3 | import ppplot |
---|
4 | import numpy as np |
---|
5 | |
---|
6 | ########################################################## |
---|
7 | namefile = "/home/aymeric/Big_Data/LES_dd/psfc_f18.ncm1_1.txt" |
---|
8 | namefile = "/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] |
---|
17 | f = open(namefile,'r') |
---|
18 | t = [] ; s = [] ; d = [] ; i = [] ; j = [] |
---|
19 | for 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)) |
---|
24 | f.close() |
---|
25 | # ensure numpy array |
---|
26 | t = np.array(t) ; s = np.array(s) ; d = np.array(d) ; i = np.array(i) ; j = np.array(j) |
---|
27 | |
---|
28 | drop = ppplot.plot1d() ; drop.field = d ; drop.absc = s |
---|
29 | drop.lstyle = '' ; drop.marker = '.' ; drop.color = 'r' ; drop.fmt = "%.1f" |
---|
30 | drop.xlabel = "Vortex size (m)" ; drop.ylabel = "Pressure drop (Pa)" |
---|
31 | drop.make() ; ppplot.save() |
---|
32 | |
---|
Note: See
TracBrowser
for help on using the repository browser.