curve_apps.peak_finder package

Submodules

curve_apps.peak_finder.anomaly module

class curve_apps.peak_finder.anomaly.Anomaly(parent: LineData, start: int, end: int, inflect_up: int, inflect_down: int, peak: int)

Bases: object

Anomaly class.

Contains indices for the maxima, minima, inflection points.

amplitude: float
end: int
inflect_down: int
inflect_up: int
parent: LineData
peak: int
start: int

curve_apps.peak_finder.anomaly_group module

class curve_apps.peak_finder.anomaly_group.AnomalyGroup(anomalies: list[Anomaly], property_group: str, subgroups: set[AnomalyGroup])

Bases: object

Group of anomalies. Contains list with a subset of anomalies.

Parameters:
  • anomalies – List of anomalies.

  • property_group – Channel group.

  • subgroups – Groups merged into this group.

Variables:
  • amplitude – Sum of anomalies amplitudes.

  • center – Center of the group.

  • center_sort – Center of the group sorted.

  • peaks – Peaks of the group.

  • start – Start of the group.

  • end – End of the group.

property anomalies: list[Anomaly]

List of anomalies that are grouped together.

get_list_attr(attr: str) numpy.ndarray

Get list of attribute from anomalies.

Parameters:

attr – Attribute to get.

Returns:

List of attribute.

property property_group: str

Channel group.

property subgroups: set[AnomalyGroup]

Groups merged into this group.

curve_apps.peak_finder.application module

curve_apps.peak_finder.base_dash module

class curve_apps.peak_finder.base_dash.BaseDashApplication(params: geoapps_utils.base.Options, ui_json_data: dict | None = None)

Bases: ABC

Base class for geoapps dash applications

abstract property app: dash.Dash

Dash app

get_data_options(ui_json_data: dict, object_uid: str | None, object_name: str = 'objects', trigger: str | None = None) list

Get data dropdown options from a given object.

Parameters:
  • ui_json_data – Uploaded ui.json data to read object from.

  • object_uid – Selected object in object dropdown.

  • object_name – Object parameter name in ui.json.

  • trigger – Callback trigger.

Return options:

Data dropdown options.

get_params_dict(update_dict: dict) dict

Get dict of current params.

Parameters:

update_dict – Dict of parameters with new values to convert to a params dict.

Return output_dict:

Dict of current params.

static init_vals(layout: list[dash.development.base_component.Component], ui_json_data: dict[str, str], kwargs: dict | None = None)

Initialize dash components in layout from ui_json_data.

Parameters:
  • layout – Dash layout.

  • ui_json_data – Uploaded ui.json data.

  • kwargs – Optional properties to set for components.

property params: geoapps_utils.base.Options

Application parameters

run(*, debug: bool = False, port: int = 7999, use_reloader: bool = False, dev_tools_hot_reload: bool = False, **run_kwargs)

Run the Dash app with the provided keyword arguments.

Parameters:
  • debug – If True, runs the app in debug mode. If False, runs the app in a native Windows, requiring the pywebview package to be installed.

  • port – The port number to run the app on.

  • use_reloader – If True, enables the reloader.

  • dev_tools_hot_reload – If True, enables hot reloading of assets.

  • run_kwargs – Additional keyword arguments to pass to the run method.

static update_visibility_from_checklist(checklist_val: list[bool]) dict

Update visibility of a component from a checklist value.

Parameters:

checklist_val – Checklist value.

Return visibility:

Component style.

property workspace: Workspace | None

Current workspace.

curve_apps.peak_finder.constants module

curve_apps.peak_finder.driver module

curve_apps.peak_finder.layout module

curve_apps.peak_finder.line_anomaly module

curve_apps.peak_finder.line_data module

curve_apps.peak_finder.line_group module

curve_apps.peak_finder.line_position module

class curve_apps.peak_finder.line_position.LinePosition(*, locations: numpy.ndarray, line_indices: numpy.ndarray, line_start: numpy.ndarray, sorting: numpy.ndarray, smoothing: int = 0, residual: bool = False, **kwargs)

Bases: object

Compute and store the derivatives of inline data values. The values are re-sampled at a constant interval, padded then transformed to the Fourier domain using the numpy.fft package.

Parameters:
  • locations – An array of data locations, either as distance along line or 3D coordinates. For 3D coordinates, the locations are automatically converted and sorted as distance from the origin.

  • values – Data values used to compute derivatives over, shape(locations.shape[0],).

  • smoothing – Number of neighbours used by the geoapps.utils.running_mean routine.

  • residual – Use the residual between the values and the running mean to compute derivatives.

  • sampling – Sampling interval length (m) used in the FFT. Defaults to the mean data separation.

compute_azimuth() numpy.ndarray

Compute azimuth of line profile.

interp_x(distance: numpy.ndarray) numpy.ndarray

Get the x-coordinate from the inline distance.

Parameters:

distance – Inline distance.

Returns:

x-coordinate.

interp_y(distance: np.ndarray) np.ndarray | None

Get the y-coordinate from the inline distance.

Parameters:

distance – Inline distance.

Returns:

y-coordinate.

interp_z(distance: float) float | None

Get the z-coordinate from the inline distance.

Parameters:

distance – Inline distance.

Returns:

z-coordinate.

interpolate_array(inds: numpy.ndarray) numpy.ndarray

Interpolate the locations of the line profile at the given indices.

Parameters:

inds – Indices of locations to interpolate.

Returns:

Interpolated locations.

property line_indices: numpy.ndarray

Indices for current line

property line_start: numpy.ndarray

Start index for current line

property locations: numpy.ndarray

Position of values along line.

property locations_resampled: numpy.ndarray

Position of values resampled on a fix interval.

property map_locations: numpy.ndarray

A list where the indices are the resampled locations indices and the values are the original locations indices.

resample_values(values) tuple[numpy.ndarray, numpy.ndarray]

Values re-sampled on a regular interval.

property residual: bool

Use the residual of the smoothing data.

property sampling: float

Discrete interval length (m)

property smoothing: int

Smoothing factor in terms of number of nearest neighbours used in a running mean averaging of the signal.

property sorting: numpy.ndarray

Locations sorting order.

curve_apps.peak_finder.params module

curve_apps.peak_finder.utils module

curve_apps.peak_finder.utils.get_ordered_survey_lines(survey: geoh5py.objects.Curve, line_field: geoh5py.data.Data) dict

Order of survey lines.

Parameters:

survey – Survey object.

curve_apps.peak_finder.window module

Module contents