コード例 #1
0
		if lpw.checkExtention(myext, file):
			paths.append(file)


	for i in range(50,len(paths)):
		
		
		timer.start()
		md5 = getMD5(paths[i])
		timer.stop()

		print i, ") md5 for ",pathLeaf(paths[i],ext=True), " computed in: ", timer.formatted()
		
		src = ncOpen(paths[i], mode='r')
		
		bb  = ncg.getBoundingBox(src['lat'],src['lon'])
		z 	= ncg.getZoomLevel(src['lat'],src['lon'])

		ncs = NetcdfSlicer(src)

		timer.reset()

		timer.start()
		ndiles = ncs.createDiles("/sdiles/ubuntu/diles/"+md5+"/"+pathLeaf(paths[i],ext=False),bb,int(z))
		timer.stop()
		print ndiles, " created. task completed in: ", timer.formatted()
		src.close()

		

コード例 #2
0
	ng    = NetcdfGeometry()
	df    = DileFactory()
	timer = Chrono()

	path  = "/sdiles/ubuntu/sdiles/sdile_tasmax_2_0_1.nc"
	fname = pathLeaf(path,False)
	

	print "computing md5 for ", fname, "..."
	timer.start()
	md5   = getMD5(path)
	timer.stop()
	print "md5 computed in: ", timer.formatted()
	
	rgrp  = ncOpen(path, mode='r')
	bb 	  = ng.getBoundingBox(rgrp['lat'],rgrp['lon'])
	zoom  = ng.getZoomLevel(rgrp['lat'], rgrp['lon'])

	mim = MetaIngesterMongo(rgrp)

	url   = " http://s3.amazonaws.com/edu-uchicago-rdcep-diles/"
	url   += str(md5)+'/'+str(fname)+'/'

	mim.onConnect('test', 'diles')

	timer.reset()

	print "ingesting metadata..."
	timer.start()
	ndocs = mim.onIngest(path, url, bb, zoom)
	timer.stop()