def clcindex(data): # 计算出交通风险等级并写入 indexpath = Writefile.readxml(glovar.trafficpath, 6)[-1] trafficindex = [np.max(data[i], axis=0) for i in range(56)] fname = ['%03d' % i for i in range(3, 169, 3)] filetime = Znwg.znwgtime() Writefile.write_to_csv(indexpath, trafficindex, 'TrafficIndex', fname, filetime)
def clcindex(data, path): indexpath = Writefile.readxml(path, 0) trafficindex = [np.max(data[i], axis=0) for i in range(56)] fname = ['%03d' % i for i in range(3, 169, 3)] filetime = Znwg.znwgtime() Writefile.write_to_csv(indexpath, trafficindex, 'TrafficIndex', fname, filetime)
def write(path, data, name, lat=None, lon=None, type=0): filetime = ecmwf.ecreptime() fh = range(3, 169, 3) fnames = ['_%03d' % i for i in fh] if type == 0: Writefile.write_to_nc(path, data, lat, lon, name, fnames, filetime) else: Writefile.write_to_csv(path, data, name, fnames, filetime)
def write(self, data, lat=None, lon=None, type=0): filetime = ecmwf.ecreptime() fh = range(3, 169, 3) fnames = ['_%03d' % i for i in fh] name = 'Snow' if type == 0: Writefile.write_to_nc(self.savepath, data, lat, lon, name, fnames, filetime) else: Writefile.write_to_csv(self.indexpath, data, 'SnowIndex', fnames, filetime)