Esempio n. 1
0
def regionDailyTimeSeries(C, region):
	""""
	Returns a summed time series the length of axis 0 for C subet by the passed
	region name
	"""
	minLat, maxLat, minLon, maxLon, resolution  = cnm.getRegionBounds(region)
	C_PNW, ynew, xnew = cnm.mask2dims(C, longitude, latitude, 0, minLon, maxLon, minLat, maxLat)
	C_PNW_daily = np.sum(C_PNW, axis=(1,2))
	return C_PNW_daily
Esempio n. 2
0
	ValueError('Time dimensions of data array and time array do not match!')

if np.unique(np.diff(tBase)) != 24:
	ValueError('Some time jump not equal to 24 hours present!')

print 'Final merged var size: ' + str(varBase.shape)
print 'Final merged time array: ' + str(len(tBase))


#######################################################################
# Handle making the spatial subset
#######################################################################
if region  != '_':

	# Get the chosen region bounds
	minLat, maxLat, minLon, maxLon, resolution = cnm.getRegionBounds(region)

	# Subset the data based on the bounds of this region.
	varBase, latitude, longitude = cnm.mask2dims(varBase, longitude[:], latitude[:], 0,\
							                     xmin=minLon, xmax=maxLon,\
							                     ymin=minLat, ymax=maxLat)

	print 'Data subset to region ' + region



#######################################################################
# Write the merged file
#######################################################################
if ncVARType == 'era_interim':
	outputFile = outDir + ncVAR + region + \