Example #1
0
def kind_of_data(list_file_names):
    """ Find out what kind of data is in a downloaded data file

    'list_file_names' is simply a list of filename strings

    """
    shower_data_present_in_table = []
    weather_data_present_in_table = []

    for i in list_file_names:
        user_hisparc_station_id = get_station_ID_from_filename(i)
        data = tables.openFile(i, 'r')
        group =  'data.root.s%s' % user_hisparc_station_id

        if 'events' in eval(group):
            shower_data_present_in_table.append(True)
        else:
            shower_data_present_in_table.append(False)

        if 'weather' in eval(group):
            weather_data_present_in_table.append(True)
        else:
            weather_data_present_in_table.append(False)

        data.close()

    kind_of_data_in_table = zip(list_file_names, shower_data_present_in_table, weather_data_present_in_table)

    return kind_of_data_in_table
Example #2
0
def check_if_weather(data, filename):

    user_hisparc_station_id = get_station_ID_from_filename(filename)
    table = 'data.root.'
    folder = 's' + user_hisparc_station_id
    group = table + folder

    if 'weather' in eval(group):
        weather_data_present_in_table = True
    else:
        weather_data_present_in_table = False

    return weather_data_present_in_table
Example #3
0
    list_files = []
    stations = []

    print ''
    station_ID = question.digit("Enter the station ID that you want to use in your analysis ( e.g. 501 ) ")
    stations.append(station_ID)
    print ''
    number_of_files = question.digit("Enter the NUMBER of FILENAMES for station %s that you want to use in your analysis ( e.g. 6 ): " % station_ID)
    print ''
    print "You are going to enter filenames ( e.g. data_s501_2011,7,21_2011,7,22.h5 )"
    print 'Enter the filenames in CHRONOLOGICAL ORDER. '
    print ''
    for j in range(1, int(number_of_files) + 1):
        while True:
            filename = raw_input('For station %s enter filename number %d: ' % (station_ID, j))
            ID = get_station_ID_from_filename(filename)
            if ID in stations:
                list_files.append(filename) # pas 'kind of data' aan zodat kijkt of hetzelfde station
                break
            else:
                print "Oops! The filename you entered does not match the station ID you entered earlier. Try again..."

    kind_of_data_in_table = kind_of_data(list_files) # e.g.  [('data_s501_2011,6,30_2011,6,30.h5', True, True), ('data_s502_2011,6,30_2011,6,30.h5', True, False)]
    plot_variable1 = choose_one_variable(kind_of_data_in_table, stations) #e.g. plot_variable = [('event_rate','data_s501_2011,12,7_2011,12,8.h5','501','events','')]
    values1, times, returntype = plot_data(plot_variable1)

print ''
correlate_question = query_yes_no('Do you want to CORRELATE data?')

use_plotted_files = False