gsdtools.stats

Compute statistics and histograms of geo-spatial data.

Functions

GetStatisticsFromMetadata(band)
SafeGetStatistics(band, approxok, force) Retriewe statistics form a GDAL raster band in a safe way.
computestats(dataset[, bands, computestats, ...])
copy_dataset_subwin(dataset, srcwin[, ...])
handlecmd([argv])
main(*argv)
namedtuple(typename, field_names[, verbose, ...]) Returns a new subclass of tuple with named fields.

Classes

HistogramRequest([hmin, hmax, nbuckets, ...])
Statistics Statistics(min, max, mean, stddev)
gsdtools.stats.GetStatisticsFromMetadata(band)[source]
class gsdtools.stats.HistogramRequest(hmin=None, hmax=None, nbuckets=None, include_out_of_range=False, computehistogram=True)[source]

Bases: object

computehistogram = None

Enable histogram computation.

hmax = None

Histogram maximum.

hmin = None

Histogram minimum.

include_out_of_range = None

Flag for out of range values handling.

If set then values below the histogram range will be mapped into the first bucket, and values above will be mapped into last one. Otherwise out of range values are discarded.

iscustom()[source]
nbuckets = None

Number of buckets for histogram comutation.

values()[source]
gsdtools.stats.SafeGetStatistics(band, approxok, force)[source]

Retriewe statistics form a GDAL raster band in a safe way.

If it is not possible to get statistics (e.g. because the force flag is set to false and statistics are not available, or because the approxok is set and there are too many nodata elements in the raster band) then a tuple of four None is returned.

Parameters:
  • approxok – if True statistics may be computed based on overviews or a subset of all tiles
  • force – if False statistics will only be returned if it can be done without rescanning the image

Note

in order to check errors due to nodata values the GDAL internal error status is reset.

Important

this function only works for versions of GDAL in which gdal.Band.GetStatistics correctly reset the return values: 1.6.4 <= GDAL < 1.7.0 and GDAL > 1.7.2 (see ticket #3572 on GDAL Trac.

class gsdtools.stats.Statistics

Bases: tuple

Statistics(min, max, mean, stddev)

max

Alias for field number 1

mean

Alias for field number 2

min

Alias for field number 0

stddev

Alias for field number 3

gsdtools.stats.computestats(dataset, bands=None, computestats=True, histreq=None, approxok=False, minmax_only=False, callback=None)[source]
gsdtools.stats.copy_dataset_subwin(dataset, srcwin, bands=None, vrtfile='')[source]
gsdtools.stats.handlecmd(argv=None)[source]
gsdtools.stats.main(*argv)[source]

Get GSDView at SourceForge.net. Fast, secure and Free Open Source software downloads

Previous topic

gsdtools

Next topic

gsdtools.ras2vec

This Page