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
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
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