Exemplo n.º 1
0
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()
	
	for lind in range(len(rightFullLvls)):
		ARLDI.levels.add(lvDict[lind])
		ARLDI.LevelVarList.add(lvVarDict[lvDict[lind]])
		
	ARLDI.createDataFile(fileOut)

	while tind <= len(mns) and mns[tind-1] == mn:
		dataHead = ARLDI.getDataHead(proj, 'NRCP', 2)
		ARLDI.writeIndexRecord(ts[tind], dataHead)
		for hg in rightFullLvls:
			for arlV in lvVarDict[hg]:
				arlV = str(arlV)
				ncV = arl2ncDict[arlV]
				
Exemplo n.º 2
0
avars = ['PRSS','T02M','U10M','V10M','HGTS','TEMP','UWND','VWND','WWND','RELH']
levels = [0,1000,975,950,925,900,875,850,825,800,775,750,700,\
	650,600,550,500,450,400,350,300,250,225,200,175,150,\
	125,100,70,50,30,20,10,7,5,3,2,1]
for l in levels:
	arlDI.levels.add(l)
	if l == 0:
		arlDI.LevelVarList.add(['PRSS','T02M','U10M','V10M'])
	else:
		arlDI.LevelVarList.add(['HGTS','TEMP','UWND','VWND','WWND','RELH'])

#---- Write ARL data file
dataInfo = mydata.getDataInfo()
arlDI.createDataFile(outFile)
arlDI.X = dataInfo.getXDimension().getValues()
arlDI.Y = dataInfo.getYDimension().getValues()
variables = dataInfo.getVariables()
tNum = dataInfo.getTimeNum()
for t in range(0, tNum):
	mydata.setTimeIndex(t)
	atime = dataInfo.getTimes().get(t)
	aDH = arlDI.getDataHead(mydata.getProjectionInfo(), 'FNL1', 2)
	arlDI.writeIndexRecord(atime, aDH)
	lidx = 0
	for l in arlDI.levels:
		print l
		for v in arlDI.LevelVarList[lidx]:
			vName = gvars[avars.index(v)]
			print vName
			if lidx == 0:
				mydata.setLevelIndex(lidx)
Exemplo n.º 3
0
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()

    for lind in range(len(rightFullLvls)):
        ARLDI.levels.add(lvDict[lind])
        ARLDI.LevelVarList.add(lvVarDict[lvDict[lind]])

    ARLDI.createDataFile(fileOut)

    while tind <= len(mns) and mns[tind - 1] == mn:
        dataHead = ARLDI.getDataHead(proj, 'NRCP', 2)
        ARLDI.writeIndexRecord(ts[tind], dataHead)
        for hg in rightFullLvls:
            for arlV in lvVarDict[hg]:
                arlV = str(arlV)
                ncV = arl2ncDict[arlV]
Exemplo n.º 4
0
levels = [0,1000,975,950,925,900,875,850,825,800,775,750,700,\
 650,600,550,500,450,400,350,300,250,225,200,175,150,\
 125,100,70,50,30,20,10,7,5,3,2,1]
for l in levels:
    arlDI.levels.add(l)
    if l == 0:
        arlDI.LevelVarList.add(['PRSS', 'T02M', 'U10M', 'V10M'])
    else:
        arlDI.LevelVarList.add(
            ['HGTS', 'TEMP', 'UWND', 'VWND', 'WWND', 'RELH'])

#---- Write ARL data file
dataInfo = mydata.getDataInfo()
arlDI.createDataFile(outFile)
arlDI.X = dataInfo.getXDimension().getValues()
arlDI.Y = dataInfo.getYDimension().getValues()
variables = dataInfo.getVariables()
tNum = dataInfo.getTimeNum()
for t in range(0, tNum):
    mydata.setTimeIndex(t)
    atime = dataInfo.getTimes().get(t)
    aDH = arlDI.getDataHead(mydata.getProjectionInfo(), 'FNL1', 2)
    arlDI.writeIndexRecord(atime, aDH)
    lidx = 0
    for l in arlDI.levels:
        print l
        for v in arlDI.LevelVarList[lidx]:
            vName = gvars[avars.index(v)]
            print vName
            if lidx == 0:
                mydata.setLevelIndex(lidx)