raster

Band

class espatools.raster.Band(**kwargs)[source]

Bases: properties.base.base.HasProperties

Contains raster metadata and data for a single band.

Required Properties:

  • data_type (String): Band data type, a unicode string
  • file_name (String): Original file name, a unicode string
  • fill_value (Integer): fill value, an integer, Default: -9999
  • long_name (String): Long display name, a unicode string
  • name (String): Name of the band, a unicode string
  • nlines (Integer): number of lines, an integer
  • nsamps (Integer): number of samples, an integer
  • pixel_size (PixelSize): The pixel size, an instance of PixelSize
  • product (String): Data product, a unicode string
  • short_name (String): Short name, a unicode string

Optional Properties:

  • add_offset (Float): Add offset, a float
  • app_version (String): app version, a unicode string
  • bitmap_description (Dictionary): band bitmap description (not always present), a dictionary (keys: a unicode string; values: a unicode string)
  • category (String): Band category, a unicode string
  • data_units (String): Data units, a unicode string
  • percent_coverage (Float): percent coverage, a float
  • production_date (String): production date, a unicode string
  • qa_description (String): QA description, a unicode string
  • radiance (Lum): The radiance, an instance of Lum
  • reflectance (Lum): The reflectance, an instance of Lum
  • resample_method (String): resample method, a unicode string
  • saturate_value (Integer): Saturate value, an integer
  • scale_factor (Float): Scaling factor, a float
  • source (String): Band source, a unicode string
  • thermal_const (ThermalConst): The thermal const, an instance of ThermalConst
  • valid_range (ValidRange): The valid data range, an instance of ValidRange
add_offset

add_offset (Float) – Add offset, a float

app_version

app_version (String) – app version, a unicode string

bitmap_description

bitmap_description (Dictionary) – band bitmap description (not always present), a dictionary (keys – a unicode string; values: a unicode string)

category

category (String) – Band category, a unicode string

data = None
data_type

data_type (String) – Band data type, a unicode string

data_units

data_units (String) – Data units, a unicode string

file_name

file_name (String) – Original file name, a unicode string

fill_value

fill_value (Integer) – fill value, an integer, Default – -9999

long_name

long_name (String) – Long display name, a unicode string

name

name (String) – Name of the band, a unicode string

nlines

nlines (Integer) – number of lines, an integer

nsamps

nsamps (Integer) – number of samples, an integer

percent_coverage

percent_coverage (Float) – percent coverage, a float

pixel_size

pixel_size (PixelSize) – The pixel size, an instance of PixelSize

product

product (String) – Data product, a unicode string

production_date

production_date (String) – production date, a unicode string

qa_description

qa_description (String) – QA description, a unicode string

radiance

radiance (Lum) – The radiance, an instance of Lum

reflectance

reflectance (Lum) – The reflectance, an instance of Lum

resample_method

resample_method (String) – resample method, a unicode string

saturate_value

saturate_value (Integer) – Saturate value, an integer

scale_factor

scale_factor (Float) – Scaling factor, a float

short_name

short_name (String) – Short name, a unicode string

source

source (String) – Band source, a unicode string

thermal_const

thermal_const (ThermalConst) – The thermal const, an instance of ThermalConst

valid_range

valid_range (ValidRange) – The valid data range, an instance of ValidRange

ColorSchemes

class espatools.raster.ColorSchemes[source]

Bases: object

A class to hold various RGB color schemes fo refernce. These color schemes are defined on the USGS website.

LOOKUP_FLASE_COLOR_A = {'LANDSAT_5': ['sr_band5', 'sr_band4', 'sr_band3'], 'LANDSAT_7': ['sr_band5', 'sr_band4', 'sr_band3'], 'LANDSAT_8': ['sr_band6', 'sr_band5', 'sr_band4']}
LOOKUP_FLASE_COLOR_B = {'LANDSAT_5': ['sr_band7', 'sr_band5', 'sr_band3'], 'LANDSAT_7': ['sr_band7', 'sr_band5', 'sr_band3'], 'LANDSAT_8': ['sr_band7', 'sr_band6', 'sr_band4']}
LOOKUP_FLASE_COLOR_C = {'LANDSAT_5': ['sr_band7', 'sr_band4', 'sr_band2'], 'LANDSAT_7': ['sr_band7', 'sr_band4', 'sr_band2'], 'LANDSAT_8': ['sr_band7', 'sr_band5', 'sr_band3']}
LOOKUP_INFRARED = {'LANDSAT_5': ['sr_band4', 'sr_band3', 'sr_band2'], 'LANDSAT_7': ['sr_band4', 'sr_band3', 'sr_band2'], 'LANDSAT_8': ['sr_band5', 'sr_band4', 'sr_band3']}
LOOKUP_TRUE_COLOR = {'LANDSAT_5': ['sr_band3', 'sr_band2', 'sr_band1'], 'LANDSAT_7': ['sr_band3', 'sr_band2', 'sr_band1'], 'LANDSAT_8': ['sr_band4', 'sr_band3', 'sr_band2']}

RasterSet

class espatools.raster.RasterSet(**kwargs)[source]

Bases: properties.base.base.HasProperties

The main class to hold a set of raster data. This contains all of the bands
for a given set of rasters. This is generated by the RasterSetReader.

Required Properties:

  • bands (Dictionary): A dictionary of bands for the swath, a dictionary (keys: a unicode string; values: an instance of Band)
  • global_metadata (RasterMetaData): Raster metadata, an instance of RasterMetaData
  • nlines (Integer): The number of lines, an integer
  • nsamps (Integer): The number of samples, an integer
  • pixel_size (PixelSize): The pixel size, an instance of PixelSize

Optional Properties:

  • version (String): version, a unicode string
GetRGB(scheme='infrared', names=None)[source]

Get an RGB color scheme based on predefined presets or specify your own band names to use. A given set of names always overrides a scheme.

Note

Available schemes are defined in RGB_SCHEMES and include:

  • true
  • infrared
  • false_a
  • false_b
  • false_c
RGB_SCHEMES = {'false_a': {'LANDSAT_8': ['sr_band6', 'sr_band5', 'sr_band4'], 'LANDSAT_5': ['sr_band5', 'sr_band4', 'sr_band3'], 'LANDSAT_7': ['sr_band5', 'sr_band4', 'sr_band3']}, 'false_b': {'LANDSAT_8': ['sr_band7', 'sr_band6', 'sr_band4'], 'LANDSAT_5': ['sr_band7', 'sr_band5', 'sr_band3'], 'LANDSAT_7': ['sr_band7', 'sr_band5', 'sr_band3']}, 'false_c': {'LANDSAT_8': ['sr_band7', 'sr_band5', 'sr_band3'], 'LANDSAT_5': ['sr_band7', 'sr_band4', 'sr_band2'], 'LANDSAT_7': ['sr_band7', 'sr_band4', 'sr_band2']}, 'infrared': {'LANDSAT_8': ['sr_band5', 'sr_band4', 'sr_band3'], 'LANDSAT_5': ['sr_band4', 'sr_band3', 'sr_band2'], 'LANDSAT_7': ['sr_band4', 'sr_band3', 'sr_band2']}, 'true': {'LANDSAT_8': ['sr_band4', 'sr_band3', 'sr_band2'], 'LANDSAT_5': ['sr_band3', 'sr_band2', 'sr_band1'], 'LANDSAT_7': ['sr_band3', 'sr_band2', 'sr_band1']}}
bands

bands (Dictionary) – A dictionary of bands for the swath, a dictionary (keys – a unicode string; values: an instance of Band)

global_metadata

global_metadata (RasterMetaData) – Raster metadata, an instance of RasterMetaData

nlines

nlines (Integer) – The number of lines, an integer

nsamps

nsamps (Integer) – The number of samples, an integer

pixel_size

pixel_size (PixelSize) – The pixel size, an instance of PixelSize

validate()[source]
version

version (String) – version, a unicode string