Skip to content

Issue with function trim_offsets (array1d) when x_source > X_receivers #33

Description

@RomeoCou

Hi,
There is a small issue when trimming by offset when you have, for example:
Source(x=66.0, y=0.0, z=0.0)
Sensors.x = [2.0, 4.0, 6.0, ..., 46.00]
Then the offsets are: [66.0, 64.0, ..., 20.0]

For min_offset, max_offset = 25, 50, it returns "ValueError: Removing all sensors at offsets between 25 and 50, results in no sensors." because we end up directly at lines 211-212 (array1d.py) and exit the function with no sensors.

A solution could be just to remove those lines 211-212 and simply have sensors = [sensor.x for sensor, offset in zip(array.sensors, array.offsets) if min_offset < abs(offset) < max_offset].

Thank you for your work coding this package and making it available!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions