write_griddata_to_file simplification