points_to_surface

HSTB.kluster.fqpr_convenience.points_to_surface(data_files, horizontal_epsg, vertical_reference, grid_type='single_resolution', tile_size=1024.0, subtile_size=128, gridding_algorithm='mean', resolution=None, auto_resolution_mode='depth', use_dask=False, output_path=None, allow_append=True, export_path=None, export_format='geotiff', export_z_positive_up=True, export_resolution=None, client=None, grid_parameters=None, csv_columns=('x', 'y', 'z'))

Take in points in either csv or las/laz formats, and build a new bathygrid grid from the data points.

Parameters
  • data_files (list) – list of filepaths to csv or las/laz files

  • horizontal_epsg (int) – epsg integer code for the horizontal crs of this dataset

  • vertical_reference (str) – string identifier for the vertical reference, ex: ‘MLLW’

  • grid_type (str) – one of ‘single_resolution’, ‘variable_resolution_tile’

  • tile_size (float) – main tile size, the size in meters of the tiles within the grid, a larger tile size will improve performance, but size should be at most 1/2 the length/width of the survey area

  • subtile_size (float) – sub tile size, only used for variable resolution, the size of the subtiles within the tiles, subtiles are the smallest unit within the grid that is single resolution

  • gridding_algorithm (str) – algorithm to grid by, one of ‘mean’, ‘shoalest’, ‘cube’

  • resolution (Optional[float]) – resolution of the gridded data in the Tiles

  • auto_resolution_mode (str) – one of density, depth; chooses the algorithm used to determine the resolution for the grid/tile

  • use_dask (bool) – if True, will start a dask LocalCluster instance and perform the gridding in parallel

  • output_path (Optional[str]) – if provided, will save the Bathygrid to this path, with data saved as stacked numpy (npy) files

  • allow_append (bool) – if True and the output_path provided exists, this function will attempt to add the new points to the existing grid, using the existing grid resolution, grid type, etc.

  • export_path (Optional[str]) – if provided, will export the Bathygrid to csv

  • export_format (str) – format option, one of ‘csv’, ‘geotiff’, ‘bag’

  • export_z_positive_up (bool) – if True, will output bands with positive up convention

  • export_resolution (Optional[float]) – if provided, will only export the given resolution

  • client (Optional[Client]) – dask.distributed.Client instance, if you don’t include this, it will automatically start a LocalCluster with the default options, if you set use_dask to True

  • grid_parameters (Optional[dict]) – optional dict of settings to pass to the grid algorithm

  • csv_columns (list) – Used with csv files, columns in order for variables (‘x’, ‘y’, ‘z’, ‘thu’, ‘tvu’). ‘thu’ and ‘tvu’ are optional columns, but this tuple must at least include ‘x’, ‘y’ and ‘z’. If these columns are in a different order in the file, use the order of the tuple to reflect this. EX: (‘y’, ‘’, ‘x’, ‘z’) for northings in first column, eastings in the third column, depth in the fourth column, skipping the second column.

Returns

BathyGrid instance for the newly created surface

Return type

BathyGrid