예제 #1
0
def make_stations(properties, station_type, data_types):
    """ Returns station objects defined in model.station for a given station type
    and all the data types associated with that station.
    """
    station_tuples = file_dao.get_unique_records(properties, data_types=data_types)
    station_maker = station_model.named_tuple_to_station_closure(station_type)
    stations = map(station_maker, station_tuples)
    return stations
예제 #2
0
def make_yearly_data_records(station_type, data_type):
    """ Takes a given station type (ex, global) and a data type (ex, tmax)
    and returns a collection of named tuples with the appropriate properties for
    those keys.
    """
    properties = file_dao.get_properties_from_file(property_type=station_type,
                                                   file_type="records")
    records = file_dao.get_unique_records(properties, data_types=[data_type],
                                          read_type='directory')
    return records
예제 #3
0
def get_records_from_filesystem(property_type, file_type, profile=None):
    dictionary = get_dictionary_from_filesystem(property_type, file_type, profile=profile)
    tuples = file_dao.get_unique_records(dictionary)
    return tuples