summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOnderwaater <onderwaa@esrf.fr>2015-11-16 18:20:00 +0100
committerOnderwaater <onderwaa@esrf.fr>2015-11-16 18:20:00 +0100
commit0a6258cd353f205fa4cf7c4decc6b83465f5accc (patch)
tree3da19fe59a63e343d5e6aaf309bbc1b1b3a61bff
parentac65f460b3247ec445d487c774052068e62fff5d (diff)
parent8ce4a17ebe23ef05a48c06d89937ed6dc66b5c5a (diff)
Merge pull request #10 from dkriegner/master
backend fixes (UCCD-tagline, metadata)
-rw-r--r--BINoculars/backends/bm25.py1
-rw-r--r--BINoculars/backends/id03.py4
-rw-r--r--[-rwxr-xr-x]BINoculars/backends/id03_xu.py5
-rwxr-xr-xbinoculars.py2
-rwxr-xr-xgui.py2
-rwxr-xr-xprocessgui.py1
6 files changed, 10 insertions, 5 deletions
diff --git a/BINoculars/backends/bm25.py b/BINoculars/backends/bm25.py
index d9d2b5f..0b9b567 100644
--- a/BINoculars/backends/bm25.py
+++ b/BINoculars/backends/bm25.py
@@ -85,6 +85,7 @@ class EDFInput(backend.InputBase):
yield backend.Job(images=imgs, firstimage=s.start, lastimage=s.stop-1, weight=s.stop-s.start)
def process_job(self, job):
+ super(EDFInput, self).process_job(job)
images = self.get_images(job.images, job.firstimage, job.lastimage) # iterator!
for image in images:
diff --git a/BINoculars/backends/id03.py b/BINoculars/backends/id03.py
index abce894..dbc30df 100644
--- a/BINoculars/backends/id03.py
+++ b/BINoculars/backends/id03.py
@@ -469,7 +469,7 @@ class ID03Input(backend.InputBase):
zapscanno = int(scanheaderC[2].split(' ')[-1]) # is different from scanno should be changed in spec!
try:
uccdtagline = scanheaderC[0]
- UCCD = uccdtagline[22:].split(os.sep)
+ UCCD = os.path.split(uccdtagline.split()[-1])
except:
print 'warning: UCCD tag not found, use imagefolder for proper file specification'
UCCD = []
@@ -488,7 +488,7 @@ class ID03Input(backend.InputBase):
else:
try:
uccdtagline = scan.header('UCCD')[0]
- UCCD = os.path.dirname(uccdtagline[6:]).split(os.sep)
+ UCCD = os.path.split(os.path.dirname(uccdtagline.split()[-1]))
except:
print 'warning: UCCD tag not found, use imagefolder for proper file specification'
UCCD = []
diff --git a/BINoculars/backends/id03_xu.py b/BINoculars/backends/id03_xu.py
index 7534321..1bf5a7b 100755..100644
--- a/BINoculars/backends/id03_xu.py
+++ b/BINoculars/backends/id03_xu.py
@@ -80,6 +80,7 @@ class ID03Input(backend.InputBase):
yield backend.Job(scan=scanno, firstpoint=0, lastpoint=pointcount-1, weight=pointcount)
def process_job(self, job):
+ super(ID03Input, self).process_job(job)
scan = self.get_scan(job.scan)
scanparams = self.get_scan_params(scan) # wavelength, UB
@@ -146,7 +147,7 @@ class ID03Input(backend.InputBase):
def get_images(self, scan, first, last, dry_run=False):
try:
uccdtagline = scan.header('UCCD')[0]
- UCCD = os.path.dirname(uccdtagline[6:]).split(os.sep)
+ UCCD = os.path.split(os.path.dirname(uccdtagline.split()[-1]))
except:
print 'warning: UCCD tag not found, use imagefolder for proper file specification'
UCCD = []
@@ -169,7 +170,7 @@ class ID03Input(backend.InputBase):
except Exception as e:
raise errors.ConfigError("invalid 'imagefolder' specification '{0}': {1}".format(self.config.imagefolder, e))
else:
- imagefolder = os.path.join(UCCD[:-1])
+ imagefolder = os.path.join(*UCCD)
if not os.path.exists(imagefolder):
raise ValueError("invalid 'imagefolder' specification '{0}'. Path {1} does not exist".format(self.config.imagefolder, imagefolder))
diff --git a/binoculars.py b/binoculars.py
index 58508dd..a14a238 100755
--- a/binoculars.py
+++ b/binoculars.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
import sys
import os
diff --git a/gui.py b/gui.py
index 2025a52..fdfef91 100755
--- a/gui.py
+++ b/gui.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
import sys
import os
import glob
diff --git a/processgui.py b/processgui.py
index 48da6f8..838ba3c 100755
--- a/processgui.py
+++ b/processgui.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
"""
BINoculars gui for data processing
Created on 2015-06-04