obspy.core.util.obspy_types.FloatWithUncertainties

class FloatWithUncertainties(value, **kwargs)[source]

Bases: CustomFloat

Helper class to inherit from and which stores a float with a given valid range, upper/lower uncertainties and eventual additional attributes.

Attributes

imag

the imaginary part of a complex number

real

the real part of a complex number

Public Methods

as_integer_ratio

Return integer ratio.

conjugate

Return self, the complex conjugate of any float.

fromhex

Create a floating-point number from a hexadecimal string.

hex

Return a hexadecimal representation of a floating-point number.

is_integer

Return True if the float is an integer.

Special Methods

FloatWithUncertainties.__abs__()

abs(self)

FloatWithUncertainties.__add__(value, /)

Return self+value.

FloatWithUncertainties.__bool__()

True if self else False

FloatWithUncertainties.__ceil__()

Return the ceiling as an Integral.

FloatWithUncertainties.__delattr__(name, /)

Implement delattr(self, name).

FloatWithUncertainties.__dir__()

Default dir() implementation.

FloatWithUncertainties.__divmod__(value, /)

Return divmod(self, value).

FloatWithUncertainties.__eq__(value, /)

Return self==value.

FloatWithUncertainties.__float__()

float(self)

FloatWithUncertainties.__floor__()

Return the floor as an Integral.

FloatWithUncertainties.__floordiv__(value, /)

Return self//value.

FloatWithUncertainties.__format__(format_spec, /)

Formats the float according to format_spec.

FloatWithUncertainties.__ge__(value, /)

Return self>=value.

FloatWithUncertainties.__getattribute__(name, /)

Return getattr(self, name).

FloatWithUncertainties.__getformat__()

You probably don’t want to use this function.

typestr

Must be ‘double’ or ‘float’.

It exists mainly to be used in Python’s test suite.

This function returns whichever of ‘unknown’, ‘IEEE, big-endian’ or ‘IEEE, little-endian’ best describes the format of floating point numbers used by the C type named by typestr.

FloatWithUncertainties.__getnewargs__()
FloatWithUncertainties.__gt__(value, /)

Return self>value.

FloatWithUncertainties.__hash__()

Return hash(self).

FloatWithUncertainties.__iadd__(other)
FloatWithUncertainties.__imul__(other)
FloatWithUncertainties.__init__(value, lower_uncertainty=None, upper_uncertainty=None, measurement_method=None)[source]
FloatWithUncertainties.__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

FloatWithUncertainties.__int__()

int(self)

FloatWithUncertainties.__le__(value, /)

Return self<=value.

FloatWithUncertainties.__lt__(value, /)

Return self<value.

FloatWithUncertainties.__mod__(value, /)

Return self%value.

FloatWithUncertainties.__mul__(value, /)

Return self*value.

FloatWithUncertainties.__ne__(value, /)

Return self!=value.

FloatWithUncertainties.__neg__()

-self

static FloatWithUncertainties.__new__(cls, value, **kwargs)[source]
FloatWithUncertainties.__pos__()

+self

FloatWithUncertainties.__pow__(value, mod=None, /)

Return pow(self, value, mod).

FloatWithUncertainties.__radd__(value, /)

Return value+self.

FloatWithUncertainties.__rdivmod__(value, /)

Return divmod(value, self).

FloatWithUncertainties.__reduce__()

Helper for pickle.

FloatWithUncertainties.__reduce_ex__(protocol, /)

Helper for pickle.

FloatWithUncertainties.__repr__()

Return repr(self).

FloatWithUncertainties.__rfloordiv__(value, /)

Return value//self.

FloatWithUncertainties.__rmod__(value, /)

Return value%self.

FloatWithUncertainties.__rmul__(value, /)

Return value*self.

FloatWithUncertainties.__round__(ndigits=None, /)

Return the Integral closest to x, rounding half toward even.

When an argument is passed, work like built-in round(x, ndigits).

FloatWithUncertainties.__rpow__(value, mod=None, /)

Return pow(value, self, mod).

FloatWithUncertainties.__rsub__(value, /)

Return value-self.

FloatWithUncertainties.__rtruediv__(value, /)

Return value/self.

FloatWithUncertainties.__setattr__(name, value, /)

Implement setattr(self, name, value).

FloatWithUncertainties.__setformat__(fmt, /)

You probably don’t want to use this function.

typestr

Must be ‘double’ or ‘float’.

fmt

Must be one of ‘unknown’, ‘IEEE, big-endian’ or ‘IEEE, little-endian’, and in addition can only be one of the latter two if it appears to match the underlying C reality.

It exists mainly to be used in Python’s test suite.

Override the automatic determination of C-level floating point type. This affects how floats are converted to and from binary strings.

FloatWithUncertainties.__sizeof__()

Size of object in memory, in bytes.

FloatWithUncertainties.__str__()

Return str(self).

FloatWithUncertainties.__sub__(value, /)

Return self-value.

FloatWithUncertainties.__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

FloatWithUncertainties.__truediv__(value, /)

Return self/value.

FloatWithUncertainties.__trunc__()

Return the Integral closest to x between 0 and x.