def scan(self, time):
scan_time,mz,scan_name,st,scan_mode = min(self.scans(), key=lambda si: abs(time - si[0]))
self.crl.setopt(pycurl.HTTPGET, True)
self.crl.setopt(pycurl.URL, str(scan_name + '.txt'))
response = cStringIO.StringIO()
self.crl.setopt(pycurl.WRITEFUNCTION, response.write)
for i in range(5):
#print 'scan %d' % i
self.crl.perform()
if response.getvalue():
break
scan = response.getvalue().splitlines()
# how to get charge for an mzURL scan?
return mzScan([tuple(float(v) for v in s.split()) for s in scan],
scan_time, mode=scan_mode, mz=mz)
评论列表
文章目录