Skip to content

Fix get_end_of_shot method in time_setting #443

@gtrevisan

Description

@gtrevisan

for some shots, no valid_indices are found in the _get_end_of_shot class method:

valid_indices = np.where((polarized_signal >= threshold) & (signal_time > 0.0))
duration = signal_time[np.max(valid_indices)]

and thus we fail with:

ValueError: zero-size array to reduction operation maximum which has no identity

a couple of examples:

# on DIII-D
poetry run disruption-py 173927
# on EAST
poetry run disruption-py 59684

since this happens when setting up the timebase, such an exception is handled as critical and any further computation is impossible.

is there any fix? do these shots really deserve to be discarded?
otherwise we might just add a check on valid_indices and raise a user-friendlier exception.

Metadata

Metadata

Assignees

Labels

bugUnexpected failures

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions