Less Than Frequency (Spatial Analyst)

License Level:BasicStandardAdvanced

Summary

Evaluates on a cell-by-cell basis the number of times a set of rasters is less than another raster.

Illustration

Less Than Frequency illustration
OutRas = LessThanFrequency(ValRas, [InRas1, InRas2, InRas3]

Usage

Syntax

LessThanFrequency (in_value_raster, in_rasters)
ParameterExplanationData Type
in_value_raster

For each cell location in the input value raster, the number of occurrences (frequency) where a raster in the input list has a lesser value is counted.

Raster Layer
in_rasters
[in_raster,...]

The list of rasters that will be compared against the value raster.

Raster Layer

Return Value

NameExplanationData Type
out_raster

The output raster.

For each cell in the output raster, the value represents the number of times that the corresponding cells in the list of rasters is less than the value raster.

Raster

Code Sample

LessThanFrequency example 1 (Python window)

This example evaluates the number of times a set of input Grid rasters is less than another raster and outputs the result as an IMG raster.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outLTF = LessThanFrequency("cost", ["degs", "negs", "fourgrd"])
outLTF.save("C:/sapyexamples/output/outltf.img")
LessThanFrequency example 2 (stand-alone script)

This example evaluates the number of times a set of input Grid rasters is less than another raster and outputs the result as an IMG raster.

# Name: LessThanFrequency_Ex_02.py
# Description: Evaluates the number of times a set of rasters is
#              less than another raster
# Requirements: Spatial Analyst Extension

# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *

# Set environment settings
env.workspace = "C:/sapyexamples/data"

# Set local variables
inValueRaster = "cost"
inRaster01 = "degs"
inRaster02 = "negs"
inRaster03 = "fourgrd"

# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")

# Execute LessThanFrequency
outLTF = LessThanFrequency(inValueRaster, [inRaster01, inRaster02, inRaster03])

# Save the output 
outLTF.save("C:/sapyexamples/output/outltf")

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Requires Spatial Analyst
ArcGIS for Desktop Standard: Requires Spatial Analyst
ArcGIS for Desktop Advanced: Requires Spatial Analyst
4/10/2014