FqprExport

class HSTB.kluster.modules.export.FqprExport(fqpr)

Bases: object

Visualizations in Matplotlib built on top of FQPR class. Includes animations of beam vectors and vessel orientation.

fqpr = fully qualified ping record, the term for the datastore in kluster

Processed fqpr_generation.Fqpr instance is passed in as argument

Methods Summary

export_dataset_to_csv(dataset_name, dest_path)

Export each variable in the given dataset to one csv, writing to the provided path

export_lines_to_file([linenames, ...])

Take each provided line name and export it to the file_format provided

export_pings_to_file([output_directory, ...])

Uses the output of georef_along_across_depth to build sounding exports.

export_soundings_to_file(datablock[, ...])

A convenience method for exporting the data currently in the Kluster Points View to file.

export_tracklines_to_file([linenames, ...])

Export the navigation to vector file, where each trackline is a new feature.

export_variable_to_csv(dataset_name, ...[, ...])

Export the given variable to csv, writing to the provided path

Methods Documentation

export_dataset_to_csv(dataset_name, dest_path)

Export each variable in the given dataset to one csv, writing to the provided path

Parameters
  • dataset_name (str) – dataset identifier, one of [‘multibeam’, ‘raw navigation’, ‘processed navigation’, ‘attitude’]

  • dest_path (str) – path to the csv that we are going to write

export_lines_to_file(linenames=None, output_directory=None, file_format='csv', csv_delimiter=' ', filter_by_detection=True, format_type='xyz', z_pos_down=True, export_by_identifiers=True)

Take each provided line name and export it to the file_format provided

Parameters
  • linenames (Optional[list]) – list of linenames that we want to export, if None this will export all lines

  • output_directory (Optional[str]) – optional, destination directory for the xyz exports, otherwise will auto export next to converted data

  • file_format (str) – optional, destination file format, default is csv file, options include [‘csv’, ‘las’, ‘entwine’]

  • csv_delimiter – optional, if you choose file_format=csv, this will control the delimiter

  • filter_by_detection (bool) – optional, if True will only write soundings that are not rejected

  • format_type (str) – optional, used in csv mode, will determine the columns/variables exported to the text file, one of [‘xyz’, ‘xyzv’, ‘xyzhv’], h being horizontal uncertainty and v being vertical uncertainty.

  • z_pos_down (bool) – if True, will export soundings with z positive down (this is the native Kluster convention), only for csv export

  • export_by_identifiers (bool) – if True, will generate separate files for each combination of serial number/sector/frequency

Returns

list of written file paths

Return type

list

export_pings_to_file(output_directory=None, file_format='csv', csv_delimiter=' ', filter_by_detection=True, format_type='xyz', z_pos_down=True, export_by_identifiers=True)

Uses the output of georef_along_across_depth to build sounding exports. Currently you can export to csv, las or entwine file formats, see file_format argument. This will use all soundings in the dataset.

If you export to las and want to retain rejected soundings under the noise classification, set filter_by_detection to False.

Filters using the detectioninfo variable if present in multibeam and filter_by_detection is set. Set z_pos_down to False if you want positive up. Otherwise you get positive down.

entwine export will build las first, and then entwine from las

Parameters
  • output_directory (Optional[str]) – optional, destination directory for the xyz exports, otherwise will auto export next to converted data

  • file_format (str) – optional, destination file format, default is csv file, options include [‘csv’, ‘las’, ‘entwine’]

  • csv_delimiter – optional, if you choose file_format=csv, this will control the delimiter

  • filter_by_detection (bool) – optional, if True will only write soundings that are not rejected

  • format_type (str) – optional, used in csv mode, will determine the columns/variables exported to the text file, one of [‘xyz’, ‘xyzv’, ‘xyzhv’], h being horizontal uncertainty and v being vertical uncertainty.

  • z_pos_down (bool) – if True, will export soundings with z positive down (this is the native Kluster convention), only for csv export

  • export_by_identifiers (bool) – if True, will generate separate files for each combination of serial number/sector/frequency

Returns

list of written file paths

Return type

list

export_soundings_to_file(datablock, output_directory=None, file_format='csv', csv_delimiter=' ', filter_by_detection=True, format_type='xyz', z_pos_down=True)

A convenience method for exporting the data currently in the Kluster Points View to file.

Parameters
  • datablock (list) – list of [sounding_id, head_index, x, y, z, tvu, rejected, pointtime, beam, linename] arrays, all of the same size and shape. sounding_id is the name of the converted instance for each sounding

  • output_directory (Optional[str]) – optional, destination directory for the xyz exports, otherwise will auto export next to converted data

  • file_format (str) – optional, destination file format, default is csv file, options include [‘csv’, ‘las’, ‘entwine’]

  • csv_delimiter – optional, if you choose file_format=csv, this will control the delimiter

  • filter_by_detection (bool) – optional, if True will only write soundings that are not rejected

  • format_type (str) – optional, used in csv mode, will determine the columns/variables exported to the text file, one of [‘xyz’, ‘xyzv’], h being horizontal uncertainty and v being vertical uncertainty.

  • z_pos_down (bool) – if True, will export soundings with z positive down (this is the native Kluster convention), only for csv export

Returns

list of written file paths

Return type

list

export_tracklines_to_file(linenames=None, output_file=None, file_format='GPKG')

Export the navigation to vector file, where each trackline is a new feature.

Parameters
  • linenames (Optional[list]) – list of linenames that we want to export, if None this will export all lines

  • output_file (Optional[str]) – new file created to hold the vector data, if None will be inside the Fqpr parent folder

  • file_format (str) – OGR format for the written file, currently only supports GPKG

export_variable_to_csv(dataset_name, var_name, dest_path, reduce_method=None, zero_centered=False)

Export the given variable to csv, writing to the provided path

Parameters
  • dataset_name (str) – dataset identifier, one of [‘multibeam’, ‘raw navigation’, ‘processed navigation’, ‘attitude’]

  • var_name (str) – variable identifier for a variable in the provided dataset, ex: ‘latitude’

  • dest_path (str) – path to the csv that we are going to write

  • reduce_method (Optional[str]) – option for reducing the array, only for (time, beam) arrays. One of (mean, nadir, port_outer_beam, starboard_outer_beam). If not provided, will export the full (time, beam) array

  • zero_centered (bool) – if zero_centered, will subtract the arithmetic mean from the array.