-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuscar_numpy.py
More file actions
38 lines (27 loc) · 759 Bytes
/
Copy pathuscar_numpy.py
File metadata and controls
38 lines (27 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from numpy import *
import numpy
import wx
import os
#wx Object Creation
app = wx.App()
filename = wx.FileSelector()
#import file
pressureHydro = loadtxt(filename, unpack=True)
#numpy calculations
print pressureHydro
stdev = numpy.std(pressureHydro)
mean = numpy.mean(pressureHydro)
print "MEAN", mean
print "Standard Devation", stdev
#MEOP for Technology
MEOP = input("Enter MEOP of Inflator: ")
safety_factor = (mean - (stdev *3)) / MEOP
if safety_factor > 1.5:
print 'Safety Factor is Acceptable'
else:
print 'Safety Factor is not Acceptable'
print 'USCAR Safety Factor', safety_factor
fo = open('pressureout.txt','w')
fo.write('"MEAN" %d,"STANDARD DEV" %d,"SAFETY FACTOR" %.2f' % (mean, stdev, safety_factor))
fo.close()
app.MainLoop()