faninsar.constants.Resampling#
- class faninsar.constants.Resampling(*values)[source]#
Bases:
IntEnumAvailable warp resampling algorithms.
Notes
The first 8, ‘nearest’, ‘bilinear’, ‘cubic’, ‘cubic_spline’, ‘lanczos’, ‘average’, ‘mode’, and ‘gauss’, are available for making dataset overviews.
‘max’, ‘min’, ‘med’, ‘q1’, ‘q3’ are only supported in GDAL >= 2.0.0.
‘nearest’, ‘bilinear’, ‘cubic’, ‘cubic_spline’, ‘lanczos’, ‘average’, ‘mode’ are always available (GDAL >= 1.10).
‘sum’ is only supported in GDAL >= 3.1.
‘rms’ is only supported in GDAL >= 3.3.
Note: ‘gauss’ is not available to the functions in rio.warp.
- __init__(*args, **kwds)#
Methods
Returns self, the complex conjugate of any int.
Number of bits necessary to represent self in binary.
Number of ones in the binary representation of the absolute value of self.
to_bytes([length, byteorder, signed])Return an array of bytes representing an integer.
from_bytes(bytes[, byteorder, signed])Return the integer represented by the given array of bytes.
Return a pair of integers, whose ratio is equal to the original int.
Returns True.
__init__(*args, **kwds)Attributes
the real part of a complex number
the imaginary part of a complex number
the numerator of a rational number in lowest terms
the denominator of a rational number in lowest terms
Nearest neighbor resampling (default, fastest algorithm, worst interpolation quality).
Bilinear resampling.
Cubic resampling.
Cubic spline resampling.
Lanczos windowed sinc resampling.
Average resampling, computes the weighted average of all non-NODATA contributing pixels.
Mode resampling, selects the value which appears most often of all the sampled points.
not available to the functions in rio.warp.
Maximum resampling, selects the maximum value from all non-NODATA contributing pixels.
Minimum resampling, selects the minimum value from all non-NODATA contributing pixels.
Median resampling, selects the median value of all non-NODATA contributing pixels.
Q1, first quartile resampling, selects the first quartile value of all non-NODATA contributing pixels.
Q3, third quartile resampling, selects the third quartile value of all non-NODATA contributing pixels.
Sum, compute the weighted sum of all non-NODATA contributing pixels.
RMS, root mean square / quadratic mean of all non-NODATA contributing pixels.
- as_integer_ratio()#
Return a pair of integers, whose ratio is equal to the original int.
The ratio is in lowest terms and has a positive denominator.
>>> (10).as_integer_ratio() (10, 1) >>> (-10).as_integer_ratio() (-10, 1) >>> (0).as_integer_ratio() (0, 1)
- bit_count()#
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13) '0b1101' >>> (13).bit_count() 3
- bit_length()#
Number of bits necessary to represent self in binary.
>>> bin(37) '0b100101' >>> (37).bit_length() 6
- conjugate()#
Returns self, the complex conjugate of any int.
- classmethod from_bytes(bytes, byteorder='big', *, signed=False)#
Return the integer represented by the given array of bytes.
- bytes
Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.
- signed
Indicates whether two’s complement is used to represent the integer.
- is_integer()#
Returns True. Exists for duck type compatibility with float.is_integer.
- to_bytes(length=1, byteorder='big', *, signed=False)#
Return an array of bytes representing an integer.
- length
Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.
- signed
Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.
- average = 5#
Average resampling, computes the weighted average of all non-NODATA contributing pixels.
- bilinear = 1#
Bilinear resampling.
- cubic = 2#
Cubic resampling.
- cubic_spline = 3#
Cubic spline resampling.
- denominator#
the denominator of a rational number in lowest terms
- gauss = 7#
not available to the functions in rio.warp.
- Type:
Gaussian resampling, Note
- imag#
the imaginary part of a complex number
- lanczos = 4#
Lanczos windowed sinc resampling.
- max = 8#
Maximum resampling, selects the maximum value from all non-NODATA contributing pixels. (GDAL >= 2.0)
- med = 10#
Median resampling, selects the median value of all non-NODATA contributing pixels. (GDAL >= 2.0)
- min = 9#
Minimum resampling, selects the minimum value from all non-NODATA contributing pixels. (GDAL >= 2.0)
- mode = 6#
Mode resampling, selects the value which appears most often of all the sampled points.
- nearest = 0#
Nearest neighbor resampling (default, fastest algorithm, worst interpolation quality).
- numerator#
the numerator of a rational number in lowest terms
- q1 = 11#
Q1, first quartile resampling, selects the first quartile value of all non-NODATA contributing pixels. (GDAL >= 2.0)
- q3 = 12#
Q3, third quartile resampling, selects the third quartile value of all non-NODATA contributing pixels. (GDAL >= 2.0)
- real#
the real part of a complex number
- rms = 14#
RMS, root mean square / quadratic mean of all non-NODATA contributing pixels. (GDAL >= 3.3)
- sum = 13#
Sum, compute the weighted sum of all non-NODATA contributing pixels. (GDAL >= 3.1)