Commits

Georg Brandl committed 1cf515e

data: support merging with binsize for hkle data in other data backends

  • Participants
  • Parent commits 31e2541

Comments (0)

Files changed (3)

File ufit/data/dataset.py

             if binsize != 0:
                 if len(set(dset.meta['hkle_vary'] for dset in allsets)) != 1:
                     raise Exception('datasets have differing varying dimension')
-                print concat
+                #print concat
                 concat = array([concat[0]]*len(new_array))
                 concat[:,['h', 'k', 'l', 'E'].index(self.meta['hkle_vary'])] = new_array[:,0]
-            print concat
+            #print concat
             new_meta['hkle'] = concat
         # XXX should we merge other meta's?
         ret = self.__class__(new_meta, new_array,

File ufit/data/ill.py

         meta['environment'].append('T = %.3f K' % meta['TT'])
     if names[3] == 'EN':
         meta['hkle'] = arr[:,:4]
+        deviations = array([(cs.max()-cs.min()) for cs in arr.T[:4]])
+        meta['hkle_vary'] = ['h', 'k', 'l', 'E'][deviations.argmax()]
     if len(arr) == 0:
         raise UFitError('No data found in file %r' % filename)
     return names, arr, meta

File ufit/data/trisp.py

         raise UFitError('No data found in file %r' % filename)
     if names[0] == 'QH':
         meta['hkle'] = arr[:,:4]
+        deviations = array([(cs.max()-cs.min()) for cs in arr.T[:4]])
+        meta['hkle_vary'] = ['h', 'k', 'l', 'E'][deviations.argmax()]
     return names, arr, meta