Making an image layer stack for time series processing

One often need a layer stack image, at least for displaying time series of values for a pixel. Have you seen that Envi make_layerstack function provided with the GUI sorts the file name in reverse order? Quite irritating. If you’ve got gdal, simply make the layer stack in one command lines.

gdal_merge.py -of gtiff -separate -o layerstackname.tif file1 file2 file3 file4

I use to make layer stack of hundreds images for processing time series, which I got in two command lines:

list=($(ls *_ndvi.tif))

gdal_merge.py -of gtiff -separate -o timeSeries.tif ${list[@]}

The list variable is actually an array (the two external parenthesis). You can be more selective in the array definition by playing around with the ls command or adding some grep command.

0 Responses to “Making an image layer stack for time series processing”



  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s





%d bloggers like this: