예제 #1
0
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)
예제 #2
0
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)
예제 #3
0
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)
예제 #4
0
 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)