def read_sources(table_path, delimiter): table = DataTable() table.read(table_path, delimiter=delimiter) sources = {} for ind, row in enumerate(table.data): if row[table.colIndex['Sourcetype']] == 'Grid': continue src = Source( NAME=row[table.colIndex['Sourcename']], INFO=row[table.colIndex['SourceID']], X1=int(row[table.colIndex['ExtentWest']]), Y1=int(row[table.colIndex['ExtentSouth']]), CHIMNEY_HEIGHT=int( row[table.colIndex['Release Height (stack)']]), CHIMNEY_OUT=float( row[table.colIndex['StackOuterDim']]), CHIMNEY_IN=float( row[table.colIndex['StackInnerDim']]), GAS_FLOW=float( row[table.colIndex['GasSpeed']]), GASTEMPERATURE=int( row[table.colIndex['GasTemp']]) ) src.ALOB['HourlyID'] = row[table.colIndex['HourlyID']] src.ALOB['MonthlyID'] = row[table.colIndex['MonthlyID']] src.ALOB['Consumption'] = row[table.colIndex['Consumption']] src.ALOB['ProcessID'] = row[table.colIndex['ProcessID']] if int(row[table.colIndex['ExtentEast']]) != src.X1 and \ int(row[table.colIndex['ExtentNorth']]) != src.Y1: src.X2 = int(row[table.colIndex['ExtentEast']]) src.Y2 = int(row[table.colIndex['ExtentNorth']]) sources[src.INFO] = src return sources