Use double rather than float when appropriate to improve precision of heatmaps
merged heatmap_fixes from nyalldawson for doubles
fixed improper raster size due to float-int conversions