def readOutput(self, args):
        droughtvars = ["spi1", "spi3", "spi6",
                       "spi12", "severity", "dryspells"]
        layervars = ["soil_moist", "soil_temp", "smliqfrac", "smfrozfrac"]
        outvars = self.getOutputStruct(self.model_path + "/global.txt")
        outdata = {}
        if len(self.lat) > 0 and len(self.lon) > 0:
            nrows = np.round((max(self.lat) - min(self.lat)) / self.res) + 1
            ncols = np.round((max(self.lon) - min(self.lon)) / self.res) + 1
            nt = (date(self.endyear, self.endmonth, self.endday) -
                  date(self.startyear + self.skipyear, self.startmonth, self.startday)).days + 1
            args = vicoutput.variableGroup(args)
            if len(args) > 0:
                for var in args:
                    if var in outvars or var in droughtvars:
                        if var in layervars:
                            outdata[var] = numpy.zeros(
                                (nt, self.nlayers, nrows, ncols)) + self.nodata
                        else:
                            outdata[var] = numpy.zeros(
                                (nt, 1, nrows, ncols)) + self.nodata
                    else:
                        print "WARNING: Variable {0} not found in output files. Skipping import.".format(var)
                prefix = set([outvars[v][0]
                              for v in outdata.keys() if v not in droughtvars])
                for c in range(len(self.lat)):
                    pdata = {}
                    for p in prefix:
                        filename = "{0}/{1}_{2:.{4}f}_{3:.{4}f}".format(
                            self.model_path, p, self.lat[c], self.lon[c], self.grid_decimal)
                        # pdata[p] = numpy.loadtxt(filename)
                        pdata[p] = pandas.read_csv(
                            filename, delim_whitespace=True, header=None).values
                    i = int((max(self.lat) + self.res /
                             2.0 - self.lat[c]) / self.res)
                    j = int((self.lon[c] - min(self.lon) +
                             self.res / 2.0) / self.res)
                    for v in outdata:
                        if v in layervars:
                            for lyr in range(self.nlayers):
                                outdata[v][:, lyr, i, j] = pdata[
                                    outvars[v][0]][:, outvars[v][1] + lyr]
                        elif v in droughtvars:
                            outdata[v][:, 0, i, j] = drought.calc(
                                v, self, int(self.gid.keys()[c]))
                        else:
                            outdata[v][:, 0, i, j] = pdata[
                                outvars[v][0]][:, outvars[v][1]]
                    print "Read output for {0}|{1}".format(self.lat[c], self.lon[c])
                year = pdata[list(prefix)[0]][:, 0]
                month = pdata[list(prefix)[0]][:, 1]
                day = pdata[list(prefix)[0]][:, 2]
                outdata["date"] = numpy.array(
                    [datetime(int(year[t]), int(month[t]), int(day[t])) for t in range(len(year))])
        else:
            print("WARNING! No pixels simulated, not saving any output!")
        return outdata
Reads VIC output for selected variables.
dataset/ETHPy150Open nasa/RHEAS/src/vic/vic.py/VIC.readOutput