1) Find the extents of the polygon using the ogr library in Python
source_ds = ogr.Open(vector_file)
source_layer = source_ds.GetLayer()
x_min, x_max, y_min, y_max = source_layer.GetExtent()
2) Find the pixle size of the input raster using gdal GetGeoTransform()
dataset = gdal.Open(inputRasterFile)
geotransform = dataset.GetGeoTransform()
pixelWidth, pixelHeight = geotransform[1], geotranform[5]
3) Write the array into raster using the gdal library
driver = gdal.GetDriverByName('GTiff')
outRaster = driver.Create(newRasterfile, cols, rows, 1, gdal.GDT_Float32)
outRaster.SetGeoTransform((x_min, pixelWidth, 0, y_min, 0, pixelHeight))
outband = outRaster.GetRasterBand(1)
outband.WriteArray(NDVI_Array)
outRasterSRS = osr.SpatialReference()
outRasterSRS.ImportFromEPSG(4326)
outRaster.SetProjection(outRasterSRS.ExportToWkt())
outband.FlushCache()
If the pixel width and heigth are negative use xmax and xmin instead of xmin and ymin.
NumPyArrayToRaster
which you could use.