Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
# -*- 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)
Ejemplo n.º 3
0
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 22 14:15:10 2018

@author: Till
"""

import lib.core as core
import csv
import os

# generate lots of csv
k = core.unpickle("./Data.txt")

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(