if(ts.get(spl).getYear() + 1900 == yrWant): realTs += [ts.get(spl)] endIndYr = spl if stIndYr is None: stIndYr = spl spl += 1 ts = realTs tDims = tDims.extract(stIndYr, endIndYr, 1) mns = [x.getMonth() + 1 for x in ts[1:]] tDim = Dimension(tDims.getDimType(), 1, 1, tDims.getDimLength()) tDim.setDimName("time") tDim.setDimId(3) tDim.setValues(range(1, tDims.getDimLength()+1)) tind = 1 for mn in range(1, 13): print mn fileOut = dirOut + "/" + "narccap." + month_abbr[mn].lower() + "66" if os.path.isfile(fileOut): os.remove(fileOut) while not mns[tind-1] == mn: tind += 1 startInd = tind ARLDI = ARLDataInfo() ARLDI.X = xs.getValues()
ymin = -50.0 xnum = 1440 ynum = 400 xdelt = 0.25 ydelt = 0.25 xlist = [] ylist = [] for i in range(0, xnum): xlist.append(xmin + xdelt * i) for i in range(0, ynum): ylist.append(ymin + ydelt * i) X = jarray.array(xlist, 'd') Y = jarray.array(ylist, 'd') xDim = Dimension(DimensionType.X) xDim.setValues(X) dataInfo.setXDimension(xDim) yDim = Dimension(DimensionType.Y) yDim.setValues(Y) dataInfo.setYDimension(yDim) var = dataInfo.getVariable('precipitation') print var.getName() dimList = [xDim, yDim] var.setDimensions(dimList) gData = mdi.getGridData(var.getName()) aLS = LegendManage.createLegendSchemeFromGridData( gData, LegendType.GraduatedColor, ShapeTypes.Polygon) aLayer = DrawMeteoData.createRasterLayer(gData, "Test_HDF", aLS) mf = miapp.getMapDocument().getActiveMapFrame() mf.addLayer(aLayer) mf.moveLayer(aLayer, 0)
if (ts.get(spl).getYear() + 1900 == yrWant): realTs += [ts.get(spl)] endIndYr = spl if stIndYr is None: stIndYr = spl spl += 1 ts = realTs tDims = tDims.extract(stIndYr, endIndYr, 1) mns = [x.getMonth() + 1 for x in ts[1:]] tDim = Dimension(tDims.getDimType(), 1, 1, tDims.getDimLength()) tDim.setDimName("time") tDim.setDimId(3) tDim.setValues(range(1, tDims.getDimLength() + 1)) tind = 1 for mn in range(1, 13): print mn fileOut = dirOut + "/" + "narccap." + month_abbr[mn].lower() + "66" if os.path.isfile(fileOut): os.remove(fileOut) while not mns[tind - 1] == mn: tind += 1 startInd = tind ARLDI = ARLDataInfo() ARLDI.X = xs.getValues() ARLDI.Y = ys.getValues()
ymin = -50.0 xnum = 1440 ynum = 400 xdelt = 0.25 ydelt = 0.25 xlist = [] ylist = [] for i in range(0,xnum): xlist.append(xmin + xdelt * i) for i in range(0,ynum): ylist.append(ymin + ydelt * i) X = jarray.array(xlist, 'd') Y = jarray.array(ylist, 'd') xDim = Dimension(DimensionType.X) xDim.setValues(X) dataInfo.setXDimension(xDim) yDim = Dimension(DimensionType.Y) yDim.setValues(Y) dataInfo.setYDimension(yDim) var = dataInfo.getVariable('precipitation') print var.getName() dimList = [xDim, yDim] var.setDimensions(dimList) gData = mdi.getGridData(var.getName()) aLS = LegendManage.createLegendSchemeFromGridData(gData, LegendType.GraduatedColor, ShapeTypes.Polygon) aLayer = DrawMeteoData.createRasterLayer(gData, "Test_HDF", aLS) mf = miapp.getMapDocument().getActiveMapFrame() mf.addLayer(aLayer) mf.moveLayer(aLayer, 0)