Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6edfca3

Browse files
committed
Numpy and Wx
1 parent 8ba36a9 commit 6edfca3

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

uscar_numpy.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
2+
from numpy import *
3+
4+
import numpy
5+
import wx
6+
import os
7+
8+
#wx Object Creation
9+
app = wx.App()
10+
11+
filename = wx.FileSelector()
12+
#import file
13+
pressureHydro = loadtxt(filename, unpack=True)
14+
#numpy calculations
15+
16+
print pressureHydro
17+
stdev = numpy.std(pressureHydro)
18+
mean = numpy.mean(pressureHydro)
19+
20+
print "MEAN", mean
21+
print "Standard Devation", stdev
22+
#MEOP for Technology
23+
MEOP = input("Enter MEOP of Inflator: ")
24+
safety_factor = (mean - (stdev *3)) / MEOP
25+
26+
if safety_factor > 1.5:
27+
print 'Safety Factor is Acceptable'
28+
else:
29+
print 'Safety Factor is not Acceptable'
30+
31+
print 'USCAR Safety Factor', safety_factor
32+
33+
fo = open('pressureout.txt','w')
34+
fo.write('"MEAN" %d,"STANDARD DEV" %d,"SAFETY FACTOR" %.2f' % (mean, stdev, safety_factor))
35+
fo.close()
36+
37+
app.MainLoop()
38+

0 commit comments

Comments
 (0)