Beispiel #1
0
 def testReadParameters(self):
     scan = rb52odim.readParameterFiles([self.CASRA_AZI_dBZ])[0]
     ref = _raveio.open(self.CASRA_H5_SCAN).object
     for pname in ref.getParameterNames():
         if pname != 'DBZH':
             ref.removeParameter(pname)
     validateScan(self, scan, ref)
Beispiel #2
0
 def testCompileVolumeFromVolumes(self):
     volumes = rb52odim.readParameterFiles(glob.glob(self.CASRA_VOL))
     ovolume = rb52odim.compileVolumeFromVolumes(volumes)
     ref = _raveio.open(self.CASRA_H5_PVOL).object
     validateTopLevel(self, ovolume, ref)
     for i in range(ovolume.getNumberOfScans()):
         oscan = ovolume.getScan(i)
         rscan = ref.getScan(i)
         oscan.date, oscan.time = rscan.date, rscan.time # times are not aligned until the pvol is written to disk, so this is a workaround
         validateScan(self, oscan, rscan)
Beispiel #3
0
 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)
 def testReadParameters(self):
     scan = rb52odim.readParameterFiles([self.CASRA_AZI_dBZ])[0]
     ref = _raveio.open(self.REF_CASRA_H5_SCAN).object
     #CASRA_AZI_dBZ only processed by singleRB5()
     #there are no expand_txpower_by_pol() attribs
     #as REF_CASRA_H5_SCAN via compile_big_scan()
     #add extra dual-/single-pol attribs, unfortunately cannot scan.removeAttribute()
     for attrib in ref.getAttributeNames():
         if any(substr in attrib
                for substr in ['single-pol_', 'dual-pol_']):
             scan.addAttribute(attrib, ref.getAttribute(attrib))
     for pname in ref.getParameterNames():
         if pname != 'DBZH':
             ref.removeParameter(pname)
     validateScan(self, scan, ref)
Beispiel #5
0
 def testCompileScanParameters(self):
     scans = rb52odim.readParameterFiles(glob.glob(self.CASRA_AZI))
     oscan = rb52odim.compileScanParameters(scans)
     ref = _raveio.open(self.CASRA_H5_SCAN).object
     validateScan(self, oscan, ref)