From the course: Geospatial Raster Data Analytics in Python

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Applying simple functions on raster data: Part 2

Applying simple functions on raster data: Part 2 - Python Tutorial

From the course: Geospatial Raster Data Analytics in Python

Applying simple functions on raster data: Part 2

- In the next analytical exercise, we will learn how to derive new roster layers based on two initial layers by using two simple mathematical operations, taking the sum and the product of the two layers. In both cases, we are doing these operations element wise. Here we will use the normalized band data from the previous part of this course. However, we could just as easily use the original roster as well. Additionally, at the end of the code block, we will export the resulting rosters as single band D files. Now first, let's create the sum and the product of the two grids. Since both of the bands are stored in MPI arrays, arithmetic operations are relatively simple with them. Now let's have a look at what we created. Again, the roster is full of zeros, so just by printing it, we don't learn much about the data. So let's compute a few simpler statistical measures of it. First, to set the baseline for our expectations, let's print the extreme values of the two bands, which should be…

Contents