npsp = 0 nmeas = 0 nyears = [] dbh = { 'sw': [], 'aw': [] } sph = { 'sw': [], 'aw': [], 'tot': [] } ba = { 'sw': [], 'aw': [], 'tot': [] } for plotname in plots: if plotname in ignore: continue ba_sw_year = [] ba_aw_year = [] k = ABBSW() k.measurements('kernels/abb/%s.csv' % plotname, plotname) for year in k.years: dbh['sw'].extend(k.meas['SW'][year]) dbh['aw'].extend(k.meas['AW'][year]) ba_sw = sum([ pi*(x/2000)**2 for x in k.meas['SW'][year] ]) / k.plot_size * 1e4 ba_aw = sum([ pi*(x/2000)**2 for x in k.meas['AW'][year] ]) / k.plot_size * 1e4 ba['sw'].append(ba_sw) ba['aw'].append(ba_aw) ba['tot'].append(ba_sw + ba_aw) ba_sw_year.append(ba_sw) ba_aw_year.append(ba_aw) print plotname, year, ba_sw