Add docstring to _write_heatmap_from_file