Skip to content

get_significant_duration improvement #132

@jorge243

Description

@jorge243

this should be faster and i think improves readability:

def get_significant_duration(acceleration, time_step, start_level=0.,
end_level=1.0):
"""
Returns the significant duration of the record
"""
assert end_level >= start_level
husid, time_vector = get_husid(acceleration, time_step)
idx = np.searchsorted(husid, [start_level * husid[-1], end_level * husid[-1]])
return np.diff(time_vector[idx])[0]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions