Hi All,
I need to run a process in python on a huge array but I first need to create a mask using a shapefile.
Does anyone know how I could do this or any examples I could follow?

Once I have created the mask this is what I would like to do
temparray=numpyarraycoveringtemperatureofwholestate
shapefile=forestedregions.shp
forestedregionsasarray=convert shapefile to array of 0's and 1's??

newarray=ma.masked_values(temparray,forestregionsasarray)
meantemperatureofforestedregions=MA.mean(newarray)
print meantemperatureofforestedregions


Any ideas of functions I could use, examples I could follow?
Thanks