ost.helpers.raster¶
Helper functions for raster data
Functions
Convert array of SAR power to decibel |
|
|
|
Function that fills no-data values with interpolation |
|
Function to create a polygon of image boundary |
|
Mask a raster layer with a vector file (including data conversions) |
|
Normalize array by its min/max or 2- and 98 percentile |
|
Generates a vector file with the valid areas of a raster file |
|
Polygonize a raster mask based on a mask value |
|
Re-convert a previously converted integer array back to float |
|
Convert a float array to integer by linear scaling between min and max |
|
|
- ost.helpers.raster.convert_to_db(pow_array)[source]¶
Convert array of SAR power to decibel
- Parameters
pow_array –
- Returns
- ost.helpers.raster.create_rgb_jpeg(filelist, outfile=None, shrink_factor=1, resampling_factor=5, plot=False, date=None, filetype=None)[source]¶
- Parameters
filelist –
outfile –
shrink_factor –
resampling_factor – 5 is average
plot –
date –
filetype –
- Returns
- ost.helpers.raster.create_timeseries_animation(timeseries_folder, product_list, out_folder, shrink_factor=1, resampling_factor=5, duration=1, add_dates=False, prefix=False)[source]¶
- ost.helpers.raster.fill_internal_nans(array)[source]¶
Function that fills no-data values with interpolation
- Parameters
array –
- Returns
- ost.helpers.raster.image_bounds(data_dir)[source]¶
Function to create a polygon of image boundary
This function for all files within a dimap data directory
- Parameters
data_dir –
- Returns
- ost.helpers.raster.mask_by_shape(infile, outfile, vector, to_db=False, datatype='float32', rescale=True, min_value=1e-06, max_value=1, ndv=None, description=True)[source]¶
Mask a raster layer with a vector file (including data conversions)
- Parameters
infile –
outfile –
vector –
to_db –
datatype –
rescale –
min_value –
max_value –
ndv –
description –
- Returns
- ost.helpers.raster.norm(array, percentile=False)[source]¶
Normalize array by its min/max or 2- and 98 percentile
- Parameters
array –
percentile –
- Returns
- ost.helpers.raster.outline(infile, outfile, ndv=0, less_then=False, driver='GeoJSON')[source]¶
Generates a vector file with the valid areas of a raster file
- Parameters
infile – input raster file
outfile – output shapefile
ndv – no-data-value
less_then –
driver –
- Returns
- ost.helpers.raster.polygonize_bounds(infile, outfile, mask_value=1, driver='GeoJSON')[source]¶
Polygonize a raster mask based on a mask value
- Parameters
infile –
outfile –
mask_value (int/float, optional) –
driver (str, optional) –
- Returns
- ost.helpers.raster.rescale_to_float(int_array, data_type)[source]¶
Re-convert a previously converted integer array back to float
- Parameters
int_array –
data_type –
- Returns