X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 13 Dec 2013 07:12 PM by  anon
Multi-temporal MODIS NDVI Stacking....
 7 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
13 Dec 2013 07:12 PM
    I want to use MODIS multi-temporal NDVI images for a prolonged period of time. How can I stack all the images into one single file using IDL? The estimated output will be a plot (of each single pixel) showing the change in NDVI over time.

    Deleted User



    New Member


    Posts:
    New Member


    --
    16 Dec 2013 11:20 AM
    I like to have your expert suggestions or any sample code to learn how to stack NDVI images and derive temporal information. It will be a great help and will be appreciated wholeheartedly. Thanks in advance.

    Deleted User



    New Member


    Posts:
    New Member


    --
    16 Dec 2013 09:39 PM
    Do you want to layer stacking from multiple images to one image including many bands?

    Deleted User



    New Member


    Posts:
    New Member


    --
    17 Dec 2013 01:03 PM
    Dear Hoa Yes. You got it.

    Deleted User



    New Member


    Posts:
    New Member


    --
    25 Dec 2013 09:07 PM
    pro stacking_images ENVI_BATCH_INIT, LOG_FILE = 'batch_log.txt' ; file thông báo khi b? l?i files = FINDFILE('G:\Backup\Hoa.lq\temp\Modis\*.img', count=count) fid = lonarr(count) pos = lonarr(count) dims = lonarr(5,count) out_bname = strarr(count) FOR j= 0,4 DO BEGIN ; FOR i=0,count-1 DO BEGIN envi_open_data_file, files(i), r_fid=layer_fid if (layer_fid eq -1) then begin envi_batch_exit return endif ENVI_FILE_QUERY, layer_fid, NS = ns, NL = nl, NB = nb, sname=sname fid[i] = layer_fid pos[i] = j dims[0,i] = [-1,0,ns-1,0,nl-1] out_bname[i] = STRMID(sname,STRPOS(sname,''),7) ; Endfor out_name = 'G:\Backup\Hoa.lq\temp\Modis\'+STRMID(sname,STRPOS(sname,''),7)+'_'+'B'+string(abs(1*j+1)) ; out_dt = 4 ; 4 là d?nh d?ng ki?u float out_proj = envi_get_projection(fid=layer_fid, pixel_size=out_ps) ; tham s? v? t?a d? ; tach envi_doit, 'envi_layer_stacking_doit', $ fid=fid, pos=pos, dims=dims, $ out_dt=out_dt, out_name=out_name, $ out_bname = out_bname, $ interp=0, out_ps=out_ps, $ out_proj=out_proj, r_fid=r_fid Endfor ENVI_BATCH_EXIT END

    Deleted User



    New Member


    Posts:
    New Member


    --
    30 Dec 2013 09:31 PM
    Dear Loa Thanks but the files are not in .img format. I have tried to use the HDF reading script in your given code but it's not working. I want to generate NDVI and EVI values for the extended period, the output will be one stacked image containing NDVI & EVI values for the prolonged period so that I can extract a temporal NDVI/EVI value for a sample pixel. For your information, I am using MOD13Q1 (both Terra & Aqua) images. Nice if you please can check the code and send me a revised one. It will be a great help. I acknowledge your previous help and suggestions. Thanks.

    Deleted User



    New Member


    Posts:
    New Member


    --
    28 Oct 2015 05:25 PM
    <p>Hi,</p> <p>I know its a long shot but did you ever get this resolved? I'm looking to make a similar data stack. I have a variable number of input files from sequential dates that are all have three pre-calculated vegetation indices. I want to make a layer stack of each indice with all the temporal values from oldest to most recent.</p> <p>Thanks,</p> <p>Laura</p>

    Deleted User



    New Member


    Posts:
    New Member


    --
    29 Oct 2015 03:31 PM
    <p>One thing you can try is the new Raster Series analysis tools in ENVI. From the toolbox, you can use Build Raster Series and Regrid Raster Series by Intersection to (1) build a series of images that you can scroll forwards and backwards through time, (2) regrid the images to a common coordinate system (if not already), common pixel size and containing the same number of rows and columns. From here, you can &nbsp;use our new Spectral Profile tool to see how a single pixel has changed over time throughout the series. This is great for working with NDVI. Here's a code example to build and regrid a series programmatically in ENVI:</p> <p>pro BuildNGridSeries<br /> compile_opt idl2<br /> <br /> ; Get an object reference to ENVI<br /> e = envi(/current)<br /> if e eq !NULL then e = envi()<br /> <br /> ; Create a list of files in a specific folder with a specific file suffix (for example, '*.dat' or '*.tif')<br /> filelist = file_search('C:\Users\jpeters\Documents\Data\MODIS_NDVI\Testing\', '*.dat')<br /> <br /> ; Build a Raster Series<br /> SeriesTask = ENVITask('BuildRasterSeries')<br /> SeriesTask.INPUT_RASTER_URI = filelist<br /> SeriesTask.Execute<br /> Series = SeriesTask.OUTPUT_RASTERSERIES<br /> SeriesFile = SeriesTask.OUTPUT_RASTERSERIES_URI<br /> <br /> ; Regrid the Raster Series to ensure each pixel lines up exactly with corresponding images<br /> ; Change the output location and filename to match a location on your computer<br /> RegridTask = ENVITask('RegridRasterSeriesByIntersection')<br /> RegridTask.INPUT_RASTERSERIES_URI = SeriesFile<br /> RegridTask.OUTPUT_RASTERSERIES_URI = 'C:\Users\jpeters\Documents\Data\MODIS_NDVI\Testing\New\New\RasterSeries.series'<br /> RegridTask.Execute<br /> <br /> SeriesFiles = e.Data.Get(/SERIES)<br /> SeriesFiles.close<br /> <br /> ; Get a reference to the Data Manager<br /> DataColl = e.Data<br /> <br /> ; Add the output to the Data Manager<br /> DataColl.Add, RegridTask.OUTPUT_RASTERSERIES<br /> <br /> ; Display the result<br /> View = e.GetView()<br /> Layer = View.CreateLayer(RegridTask.OUTPUT_RASTERSERIES)<br /> <br /> end</p> <p>If you really want to stack the bands into one image file, that's pretty easy too. Check out the documentation for the BuildBandStackTask:</p> <p>http://www.exelisvis.com/...ktask.html</p> <p>Anyways, I hope this information helps!</p> <p>Joe Peters</p>
    You are not authorized to post a reply.