15 | | (filein, pathout) = tuple(args) |
---|
16 | | |
---|
17 | | if not os.path.exists(pathout): |
---|
18 | | os.makedirs(pathout, mode=0775) |
---|
19 | | |
---|
20 | | |
---|
21 | | try: |
---|
22 | | rawDataHandle = openAnything.openAnything(filein) |
---|
23 | | rawDataString = rawDataHandle.read() |
---|
24 | | rawDataHandle.close() |
---|
25 | | except: |
---|
26 | | raise IOError("Failure to read raw data.") |
---|
27 | | |
---|
28 | | rawDataObject = a.rawData.RawData(rawDataString) |
---|
29 | | formattedDataObject = a.formattedData.FormattedData(rawDataObject) |
---|
30 | | arrayDataObject = a.ArrayData(formattedDataObject) |
---|
31 | | |
---|
32 | | fig = p.figure() |
---|
33 | | p.pcolor(arrayDataObject.uComponents.T) |
---|
34 | | p.colorbar() |
---|
35 | | fig.savefig(os.path.join(pathout, 'uComponents.png')) |
---|
36 | | |
---|
37 | | fig = p.figure() |
---|
38 | | p.pcolor(arrayDataObject.vComponents.T) |
---|
39 | | p.colorbar() |
---|
40 | | fig.savefig(os.path.join(pathout, 'vComponents.png')) |
---|
41 | | |
---|
42 | | fig = p.figure() |
---|
43 | | p.pcolor(arrayDataObject.wComponents.T) |
---|
44 | | p.colorbar() |
---|
45 | | fig.savefig(os.path.join(pathout, 'wComponents.png')) |
---|
46 | | |
---|
47 | | fig = p.figure() |
---|
48 | | p.pcolor(arrayDataObject.echoStrengths.T) |
---|
49 | | p.colorbar() |
---|
50 | | fig.savefig(os.path.join(pathout, 'echoStrengths.png')) |
---|
51 | | |
---|
52 | | fig = p.figure() |
---|
53 | | p.quiver(arrayDataObject.uComponents, |
---|
54 | | arrayDataObject.vComponents, |
---|
55 | | arrayDataObject.wComponents) |
---|
56 | | p.colorbar() |
---|
57 | | xmin,xmax,ymin,ymax = p.axis() |
---|
58 | | dx,dy = xmax-xmin, ymax-ymin |
---|
59 | | p.axis([xmin-0.1*dx, xmax+0.1*dx, ymin-0.1*dy, ymax+0.1*dy]) |
---|
60 | | p.title('Horizontal wind vectors: time vs. altitude') |
---|
61 | | fig.savefig(os.path.join(pathout, 'quiver.png')) |
---|
| 15 | (source, destination) = tuple(args) |
---|
| 16 | |
---|
| 17 | walkList = findMissing.findMissing(source, destination) |
---|
| 18 | |
---|
| 19 | for filein, pathout in walkList: |
---|
| 20 | if not os.path.exists(pathout): |
---|
| 21 | os.makedirs(pathout, mode=0775) |
---|
| 22 | |
---|
| 23 | try: |
---|
| 24 | rawDataHandle = openAnything.openAnything(filein) |
---|
| 25 | rawDataString = rawDataHandle.read() |
---|
| 26 | rawDataHandle.close() |
---|
| 27 | except: |
---|
| 28 | raise IOError("Failure to read raw data.") |
---|
| 29 | |
---|
| 30 | rawDataObject = a.rawData.RawData(rawDataString) |
---|
| 31 | formattedDataObject = a.formattedData.FormattedData(rawDataObject) |
---|
| 32 | arrayDataObject = a.ArrayData(formattedDataObject) |
---|
| 33 | |
---|
| 34 | fig = p.figure() |
---|
| 35 | p.pcolor(arrayDataObject.uComponents.T) |
---|
| 36 | p.colorbar() |
---|
| 37 | fig.savefig(os.path.join(pathout, 'uComponents.png')) |
---|
| 38 | |
---|
| 39 | fig = p.figure() |
---|
| 40 | p.pcolor(arrayDataObject.vComponents.T) |
---|
| 41 | p.colorbar() |
---|
| 42 | fig.savefig(os.path.join(pathout, 'vComponents.png')) |
---|
| 43 | |
---|
| 44 | fig = p.figure() |
---|
| 45 | p.pcolor(arrayDataObject.wComponents.T) |
---|
| 46 | p.colorbar() |
---|
| 47 | fig.savefig(os.path.join(pathout, 'wComponents.png')) |
---|
| 48 | |
---|
| 49 | fig = p.figure() |
---|
| 50 | p.pcolor(arrayDataObject.echoStrengths.T) |
---|
| 51 | p.colorbar() |
---|
| 52 | fig.savefig(os.path.join(pathout, 'echoStrengths.png')) |
---|
| 53 | |
---|
| 54 | fig = p.figure() |
---|
| 55 | p.quiver(arrayDataObject.uComponents, |
---|
| 56 | arrayDataObject.vComponents, |
---|
| 57 | arrayDataObject.wComponents) |
---|
| 58 | p.colorbar() |
---|
| 59 | xmin,xmax,ymin,ymax = p.axis() |
---|
| 60 | dx,dy = xmax-xmin, ymax-ymin |
---|
| 61 | p.axis([xmin-0.1*dx, xmax+0.1*dx, ymin-0.1*dy, ymax+0.1*dy]) |
---|
| 62 | p.title('Horizontal wind vectors: time vs. altitude') |
---|
| 63 | fig.savefig(os.path.join(pathout, 'quiver.png')) |
---|