def testCombineRB5Files(self): rb52odim.combineRB5(self.FILELIST_RB5, out_fullfile=self.NEW_H5_FILELIST) new_rio = _raveio.open(self.NEW_H5_FILELIST) ref_rio = _raveio.open(self.REF_H5_FILELIST) self.assertTrue(new_rio.objectType is _rave.Rave_ObjectType_SCAN) new_scan, ref_scan = new_rio.object, ref_rio.object validateTopLevel(self, new_scan, ref_scan) validateScan(self, new_scan, ref_scan) os.remove(self.NEW_H5_FILELIST)
def testCombineRB5FilesReturnRIO(self): new_rio = rb52odim.combineRB5(self.FILELIST_RB5, return_rio=True) ref_rio = _raveio.open(self.REF_H5_FILELIST) self.assertTrue(new_rio.objectType is _rave.Rave_ObjectType_SCAN) new_scan, ref_scan = new_rio.object, ref_rio.object validateTopLevel(self, new_scan, ref_scan) validateScan(self, new_scan, ref_scan)
def testCompileVolumeFromVolumes_vs_CombineRB5FilesReturnRIO(self): files = glob.glob(self.CASRA_VOL) #unsorted ifiles = sorted(files, key=lambda s: s.lower()) # case-insensitive sort #Note: compiled/combined scan's Attribute('how/peakpwr') is set by first param encountered! #need files sorted as rb52odim.readParameterFiles() contains file sorting! volumes = rb52odim.readParameterFiles(ifiles) compile_pvol = rb52odim.compileVolumeFromVolumes(volumes, adjustTime=False) combine_rio = rb52odim.combineRB5(ifiles, return_rio=True) #no adjustTime() functionality combine_pvol = combine_rio.object validateTopLevel(self, compile_pvol, combine_pvol) for i in range(compile_pvol.getNumberOfScans()): compile_scan = compile_pvol.getScan(i) combine_scan = combine_pvol.getScan(i) validateScan(self, compile_scan, combine_scan)