heightmap_interpolation.apps.netcdf_data_io module

heightmap_interpolation.apps.netcdf_data_io.create_work_areas(elevation, areas_kml_file, lons_1d, lats_1d)
heightmap_interpolation.apps.netcdf_data_io.imageToArray(i)

Converts a Python Imaging Library array to a numpy array.

heightmap_interpolation.apps.netcdf_data_io.load_interpolation_input_data(input_file, elevation_var, x_var='lon', y_var='lat', x_dim='lon', y_dim='lat', interpolation_flag_var=None, areas_kml_file=None)

Loads the data required for interpolation from the NetCDF file

Parameters:
  • input_file – path to the input file (expected NetCDF4 format)

  • elevation_var – the name of the variable within the netcdf4 file representing the elevation

  • interpolation_flag_var – the name of the variable representing an “interpolation flag”, where 0 == reference data, 1 == interpolated point (or point to interpolate).

  • areas_kml_file – the KML file with a set of areas where the interpolation should take place. Areas out of the described polygons will be left as they are.

heightmap_interpolation.apps.netcdf_data_io.write_interpolation_results(input_file, output_file, elevation, mask_int, elevation_var, x_dim='lon', y_dim='lat', interpolation_flag_var=None, areas_kml_file=None)
heightmap_interpolation.apps.netcdf_data_io.write_interpolation_results_new_file(output_file, elevation, mask_int, lats, lons, elevation_var_name, interpolation_flag_var_name)