<s> import nmrglue as ng <EOL> import numpy as np <EOL> dic , data = ng . pipe . read ( "<STR_LIT>" ) <EOL> peak_list = np . recfromtxt ( "<STR_LIT>" ) <EOL> f = open ( "<STR_LIT>" , '<STR_LIT:w>' ) <EOL> f . write ( "<STR_LIT>" ) <EOL> for name , x0 , y0 , x1 , y1 in peak_list : <EOL> if x0 > x1 : <EOL> x0 , x1 = x1 , x0 <EOL> if y0 > y1 : <EOL> y0 , y1 = y1 , y0 <EOL> vol = data [ y0 : y1 + <NUM_LIT:1> , x0 : x1 + <NUM_LIT:1> ] . sum ( ) <EOL> f . write ( "<STR_LIT>" % ( name , vol ) ) <EOL> f . close ( ) </s>
