def delayplotter(aircrafttype, ATA, begin,end,interval): # interval in months k = core.unpickle("./Data.txt") k = core.getbyType(k,aircrafttype) #getting the data ready k = core.sortata(k, 2) delay, date = core.getdelaylist([begin,end],interval,k) newdate = [] newdelay = [] years = [] final = [] mini = [] maxi = [] for i in range(len(delay)): for j in range(len(delay[i])): for l in range(len(ATA)): if delay[i][j][0] == ATA[l]: newdate.append(date[i]) newdelay.append(delay[i][j]) for x in range(len(newdate)): year = newdate[x] year = year[-4:] years.append(year) average = round(float(newdelay[x][1])/float(newdelay[x][2]),2) minimum = min(newdelay[x][5]) maximum = max(newdelay[x][5]) newdelay[x].append(average) newdelay[x].append(minimum) newdelay[x].append(maximum) # print newdelay[x] # now we create a list with [ata, total delay, delay freq., average delay, min delay, max delay] del newdelay[x][3] del newdelay[x][3] del newdelay[x][3] # print newdelay for z in range(len(newdate)): final.append(newdelay[z][3]) mini.append(newdelay[z][4]) maxi.append(newdelay[z][5]) # print final final = np.array(final) mini = np.array(mini) maxi = np.array(maxi) return years,final,mini,maxi
# -*- coding: utf-8 -*- """ Created on Thu May 24 09:48:10 2018 @author: Laurens """ import lib.core as core k = core.unpickle("./Data.txt") #getting the data ready k = core.sortata(k, 4) delay, date = core.getdelaylist([1988, 2015], 36, k) #getting the data ready till here output = core.ThreeDgraph(delay, 3, 0)
for top in [3, 5, 10]: for atalevel in range(2, 5): for beginyear in [1988, 2011, 2014]: for actype in range(1, 4): for interval in [3, 6, 12, 36]: newl = [] intl = [] if actype == 3 and beginyear < 1995: beginyear = 1995 if (beginyear == 1988 or (actype == 3 and beginyear == 1995)) and interval <= 6: continue a = core.getbyType(k, actype) a = core.sortata(a, atalevel) final, datelist = core.getfreqlist( [beginyear, 2015], interval, a, 3) # looking for Ratio cancellations over frequency for w in range(len(final)): for l in range(10): #print w, k intl.append(final[w][l][0]) intl.append(l + 1) intl.append(datelist[w]) newl.append(intl) intl = [] filename = "CancRatioTop%d_ata%d_ac%d_%d-2015_interv%d" % ( top, atalevel, actype, beginyear, interval)
""" Created on Mon Apr 23 14:17:44 2018 @author: Laurens """ #Tijd tot failure #Verwachte delay #Kans cancellation als het faalt #per aircraft values import matplotlib.pyplot as plt import lib.core as core interval = 36 k = core.unpickle("./Data.txt") #getting the data ready k = core.sortata(k, 3) final, date = core.getdelaylist([1988, 2015], interval, k) final_delay = [] final_rel_year = [] final_rel_allyears = [] temp_rel = [] temp2_rel = [] final2_rel_allyears = [] #----------------------------------------------------------------------------------------actual program starts for i in range(len(final)): #relation loop for j in range(len(final[i])): if final[i][j][2] != 0: a = int( round(float((float(interval) / 12) * 365 / final[i][j][2]), 0)) #amount of days average delay
""" # plots the time history of a compontent on an import lib.core as core import matplotlib.pyplot as plt import matplotlib as mpl #from mpl_toolkits.mplot3d import Axes3D import numpy as np fig = plt.figure() ax = fig.gca(projection='3d') mpl.rcParams['legend.fontsize'] = 10 k = core.unpickle("./Data.txt") #getting the data ready k = core.sortata(k, 2) delay, date = core.getdelaylist([1988, 2015], 36, k) #getting the data ready till here for i in range(len(delay)): #removing all the 0 delays. delay[i] = [x for x in delay[i] if x[-1] != 0] top_first_year = [27] main = [] amounttopnumbers = 2 l = [] temp = [] #l =[[]]*amounttopnumbers s = 0 i = 0
# -*- coding: utf-8 -*- """ Created on Thu Mar 29 16:33:07 2018 @author: Misa """ import lib.core as core import numpy as np import lib.numericals as numericals b = core.unpickle("./Data.txt") h = core.getbyCancelled(b, 0) k = core.sortata(h, 2) flist = [] onlydata = [] c = 1 l = [] l.append(k[0][3]) # #for i in range(1,len(k)): ##for i in range(1,20000): # if k[i][5] == k[i-1][5]: # l.append(k[i][3]) # if k[i][5] != k[i-1][5]: # j = [] # j.append(k[i-1][5]) # j.append(l)
# Inputs YR = 9 #Year range (steps) start = 1988 end = 2015 digits = 2 #ATA digits typ = 2 #Type atain = [21,27,29,30,32,34,36,73] #-------------------------------- # Filtering b = core.unpickle("./Data.txt") b = core.getbyType(b,typ) b = core.getbyCancelled(b,0) b = core.sortata(b,digits) #-------------------------------- #Random variables current = start flist = [] intlist = [] inlist = [] atacount = [] #-------------------------------- #While loop loops trough year range and returns list with ATA,frequency,total delay while current + YR <= end: data = core.getbyDate(b,[current,current+YR])