self.variables = ['wspd_mf', 'vapor', 'cloud', 'rain'] self.startline = { 'wspd_mf': 165, 'vapor': 172, 'cloud': 179, 'rain': 186 } Verify.__init__(self, dataset) if __name__ == '__main__': """ Automated testing. """ # read 3-day averaged: ssmi = SSMIaveraged('f10_19950120v7_d3d.gz') if not ssmi.variables: sys.exit('file not found') # verify 3-day: verify = ThreedayVerify(ssmi) if verify.success: print('successful verification for 3-day') else: sys.exit('verification failed for 3-day') print('') # read weekly averaged: ssmi = SSMIaveraged('f10_19950121v7.gz') if not ssmi.variables: sys.exit('file not found') # verify weekly: verify = WeeklyVerify(ssmi) if verify.success: print('successful verification for weekly') else: sys.exit('verification failed for weekly')
] self.startline = { 'time': 64, 'sst': 71, 'windLF': 78, 'windMF': 85, 'vapor': 92, 'cloud': 99, 'rain': 106 } Verify.__init__(self, dataset) if __name__ == '__main__': """ Automated testing. """ verify_file = 'verify_amsr2_v8.txt' # read daily: amsr = AMSR2daily('f34_20121206v8.gz') if not amsr.variables: sys.exit('problem reading file') # verify daily: verify = DailyVerify(amsr, verify_file) if verify.success: print('successful verification for daily') else: sys.exit('verification failed for daily') print() print('all tests completed successfully')
class VerifyDataset(Verify): """ Contains info for verification. """ def __init__(self,dataset): self.filename = 'verify_sst_v04.txt' self.ilon1 = 770 self.ilon2 = 775 self.ilat1 = 474 self.ilat2 = 478 self.variables = ['sst'] self.startline = { 'sst' : 9 } Verify.__init__(self,dataset) if __name__ == '__main__': """ Automated testing. """ # read: sst = OISST('mw.fusion.2004.140.v04.0.gz') if not sst.variables: sys.exit('problem reading file') # verify: verify = VerifyDataset(sst) if verify.success: print 'successful verification for daily' else: sys.exit('verification failed for daily') print print 'all tests completed successfully'
self.variables = ['mingmt','sst','w-lf','w-mf','vapor', 'cloud','rain','w-aw','wdir'] self.startline = 97 self.columns = {'mingmt' : 3, 'sst' : 4, 'w-lf' : 5, 'w-mf' : 6, 'vapor' : 7, 'cloud' : 8, 'rain' : 9, 'w-aw' : 10, 'wdir' : 11 } Verify.__init__(self,dataset) if __name__ == '__main__': """ Automated testing. """ # read daily: wsat = WindSatDaily('wsat_20060409v7.0.1.gz') if not wsat.variables: sys.exit('file not found') # verify daily: verify = DailyVerify(wsat) if verify.success: print('successful verification for daily') else: sys.exit('verification failed for daily') print('') print('all tests completed successfully') print('')
class VerifyDataset(Verify): """ Contains info for verification. """ def __init__(self,dataset): self.filename = 'verify_sst_v04.txt' self.ilon1 = 970 self.ilon2 = 975 self.ilat1 = 674 self.ilat2 = 678 self.variables = ['sst'] self.startline = { 'sst' : 29 } Verify.__init__(self,dataset) if __name__ == '__main__': """ Automated testing. """ # read: sst = MWIRSST('mw_ir.fusion.2010.125.v04.0.gz') if not sst.variables: sys.exit('problem reading file') # verify: verify = VerifyDataset(sst) if verify.success: print 'successful verification for daily' else: sys.exit('verification failed for daily') print print 'all tests completed successfully'
'sst': 71, 'windLF': 78, 'windMF': 85, 'vapor': 92, 'cloud': 99, 'rain': 106 } Verify.__init__(self, dataset) if __name__ == '__main__': """ Automated testing. """ # read daily: gmi = GMIdaily('f35_20140519v8.1.gz') if not gmi.variables: sys.exit('problem reading file') # verify daily: # verify = DailyVerify(gmi) # if verify.success: print 'successful verification for daily' # else: sys.exit('verification failed for daily') # print print "time" print gmi.variables['time'][ 0, 273:278, 169:175] # RSS verify_gmi_v8.1.txt is messed up with time print "sst" print gmi.variables['sst'][0, 273:278, 169:175] print "wind speed low freq"
'windLF': 216, 'windMF': 223, 'vapor': 230, 'cloud': 237, 'rain': 244 } Verify.__init__(self, dataset) if __name__ == '__main__': """ Automated testing. """ verify_file = 'verify_amsr2_v8.txt' # read 3-day averaged: amsr = AMSR2averaged('f34_20121205v8_d3d.gz') if not amsr.variables: sys.exit('problem reading file') # verify 3-day: verify = ThreedayVerify(amsr, verify_file) if verify.success: print('successful verification for 3-day') else: sys.exit('verification failed for 3-day') print() # read weekly averaged: amsr = AMSR2averaged('f34_20121208v8.gz') if not amsr.variables: sys.exit('problem reading file') # verify weekly: verify = WeeklyVerify(amsr, verify_file) if verify.success: print('successful verification for weekly') else: sys.exit('verification failed for weekly')
'radrain': 7, 'sos': 8 } dataset = set_verify_flags(dataset, self.variables) Verify.__init__(self, dataset) def set_verify_flags(dataset, variables): for avar in variables: if avar == 'mingmt': continue dataset.variables[avar][dataset.variables['land']] = -555. return dataset if __name__ == '__main__': """ Automated testing. """ path = '../data/satel/ascat_bmaps/ascat_20070301_v02.1.gz' ascat = ASCATDaily(path, missing=-999.) if not ascat.variables: sys.exit('file not found') # # verify daily: # verify = DailyVerify(ascat) # if verify.success: # print('successful verification for daily\n') # else: # sys.exit('verification failed for daily\n') print('all tests completed successfully\n')