Commit 78e61236 authored by Benjamin Pillot's avatar Benjamin Pillot
Browse files

Add log and log10 methods

parent 376a0162
......@@ -11,7 +11,7 @@ import numpy as np
import ogr
import pyproj
from pyrasta.io_.files import _copy_to_file
from pyrasta.tools.calculator import _op, _raster_calculation
from pyrasta.tools.calculator import _op, _raster_calculation, _log, _log10
from pyrasta.tools.clip import _clip_raster_by_extent, _clip_raster_by_mask
from pyrasta.tools.conversion import _resample_raster, _padding, _rescale_raster, \
_align_raster, _extract_bands, _merge_bands, _read_array, _xy_to_2d_index, _read_value_at, \
......@@ -183,6 +183,24 @@ class RasterBase:
"""
return _histogram(self, nb_bins, normalized)
def log(self):
""" Return logarithm of raster data
Returns
-------
"""
return _log(self)
def log10(self):
""" Return base 10 logarithm
Returns
-------
"""
return _log10(self)
def mask(self, mask, gdal_driver=gdal.GetDriverByName("Gtiff"),
data_type=gdal.GetDataTypeByName('Float32'),
all_touched=True, no_data=-999, window_size=500):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment