Beispiel #1
0
 def testCombineRB5FromTarball(self):
     rb52odim.combineRB5FromTarball(self.RB5_TARBALL_DOPVOL1B, self.NEW_H5_TARBALL_DOPVOL1B)
     new_rio = _raveio.open(self.NEW_H5_TARBALL_DOPVOL1B)
     ref_rio = _raveio.open(self.REF_H5_TARBALL_DOPVOL1B)
     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_TARBALL_DOPVOL1B)
Beispiel #2
0
 def testCombineRB5FromTarballReturnRIO(self):
     new_rio = rb52odim.combineRB5FromTarball(self.RB5_TARBALL_DOPVOL1B, None, return_rio=True)
     ref_rio = _raveio.open(self.REF_H5_TARBALL_DOPVOL1B)
     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)
Beispiel #3
0
def validateMergedPvol(self, new_pvol, iSCAN, ref_RB5_TARBALL):
    new_scan = new_pvol.getScan(iSCAN)
    # Aha, scan.time NE scan.starttime; getScan() uses parent pvol for time!
    new_scan.time=new_scan.starttime

    ref_rio = rb52odim.combineRB5FromTarball(ref_RB5_TARBALL, None, return_rio=True)
    self.assertTrue(ref_rio.objectType is _rave.Rave_ObjectType_SCAN)
    ref_scan = ref_rio.object

    # Note: ref_scan only has 1 param to loop upon
    validateTopLevel(self, new_scan, ref_scan)
    validateScan(self, new_scan, ref_scan)
    def testMergeOdimScans2Pvol(self):
        rb52odim.combineRB5FromTarball(self.RB5_TARBALL_DOPVOL1A,
                                       self.NEW_H5_TARBALL_DOPVOL1A)
        rb52odim.combineRB5FromTarball(self.RB5_TARBALL_DOPVOL1B,
                                       self.NEW_H5_TARBALL_DOPVOL1B)
        rb52odim.combineRB5FromTarball(self.RB5_TARBALL_DOPVOL1C,
                                       self.NEW_H5_TARBALL_DOPVOL1C)
        FILELIST_H5_TARBALL=[\
            self.NEW_H5_TARBALL_DOPVOL1A,\
            self.NEW_H5_TARBALL_DOPVOL1B,\
            self.NEW_H5_TARBALL_DOPVOL1C,\
            ]
        rio_arr = [_raveio.open(x) for x in FILELIST_H5_TARBALL]
        rb52odim.mergeOdimScans2Pvol(rio_arr,
                                     self.NEW_H5_MERGED_PVOL,
                                     interval=5,
                                     taskname='DOPVOL')
        new_rio = _raveio.open(self.NEW_H5_MERGED_PVOL)
        self.assertTrue(new_rio.objectType is _rave.Rave_ObjectType_PVOL)
        new_pvol = new_rio.object
        self.assertEqual(new_pvol.getNumberOfScans(), 3)
        validateMergedPvol(self, new_pvol, 0, self.RB5_TARBALL_DOPVOL1A)
        validateMergedPvol(self, new_pvol, 1, self.RB5_TARBALL_DOPVOL1B)
        validateMergedPvol(self, new_pvol, 2, self.RB5_TARBALL_DOPVOL1C)

        os.remove(self.NEW_H5_TARBALL_DOPVOL1A)
        os.remove(self.NEW_H5_TARBALL_DOPVOL1B)
        os.remove(self.NEW_H5_TARBALL_DOPVOL1C)
        os.remove(self.NEW_H5_MERGED_PVOL)