new: support for negative prop index

This commit is contained in:
Benoît Sierro
2023-08-16 10:56:36 +02:00
parent c9d23a2629
commit 420f0ff2bd

View File

@@ -157,6 +157,8 @@ class Propagation:
return self._load_slice(key)
if isinstance(key, (float, np.floating)):
key = math.argclosest(self.parameters.compute("z_targets"), key)
elif key < 0:
key = len(self) + key
array = self.io.load_spectrum(key)
return Spectrum(array, self.parameters)