comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Re: extract lat/lon from MOD13Q1

Re: extract lat/lon from MOD13Q1
type: item
description: Hi Mark, I wrote this a while ago for MOD09 point retrieval for a student. I am not sure whether this is the final final version, but it should get you well on your way; It is a very long program, as it include the option to reproject .hdf files on the fly. I am sure there is a much easier, shorter solution, but I think if you look though the code, you can pick the pieces you need. pro get_modis_roi_after_reproject ;----------------------------------- ; Setup procedures ;----------------------------------- ; set folder of idl files idlfiles = "D:\_current_projects\_danni\IDL\" ; Is a reprojection required? reproject = 0 ; Set to 0 if files already reprojected, 1 to reproject ; Output folder for reprojected files reproject_dir = 'reprojected\' ; Output subdir to safe reprojected files ; Bands to return statistics for n_bands = 7 bands_to_return = [0,1,2,3,4,5,6] ; Get the input directory ; If reproject is set to 0, this is the folder from which files will be taken ; to produce stats. Otherwise, this folder is the folder with files for reprojection. ; The reprojected files, stored in reproject_dir will then be used for data-retrieval. indir = envi_pickfile(title='Input directory to use', /directory) if (indir eq '') then return indir = indir + '\' ; Get the input coordinate list ; Structure: imagebasename space X-coordinate space Y-coordinate. E.g., a point in australia: ; MOD09A1.h30v12.004_500m 32.95 -33.54 coordinate_file = DIALOG_PICKFILE(PATH=indir, title='Coordinate listing file (imagename X-coordinate Y-coordinate)') if (coordinate_file eq '') then return ; Get the filename for writing. outfilename = DIALOG_PICKFILE( /write, /OVERWRITE_PROMPT , PATH=indir, $ TITLE='Select output filename', DEFAULT_EXTENSION ='txt') ; Retrieve the pre-defined file template use for reading restore, idlfiles+"coordinate_template.sav" ; Read the file to filelists coordinates = read_ascii(coordinate_file, template=coordinates_template) basenames = coordinates.(0)[*] xcoord = coordin…
creator: Jelle
date: 2008-06-16T17:57:37-00:00

Re: extract lat/lon from MOD13Q1
type: item
description: mtschnur wrote: > Hello, I'm experienced in ENVI but new to IDL. I need to extract NDVI, > EVI, and VI Quality from about 75 datasets at 7 lat/lon coordinates > per date. I can do this individually in ENVI by opening the images, > but it is a tedious and error-prone task. I am sure IDL would make > this easier and more accurate. Can anyone help? > > Thanks, Mark Hi Mark, If these 7 lat/lon coordinates are the same for each image, then the job would be easy in ENVI: - Stack all 75 images, be careful keep the date order correctly in the stack - Start a Z-profile and go to the lan/lon of interest - Export the Z-profile as an IDL variable or ASCII file. You can do it programatically as well by using ENVI_CONVERT_PROJECTION_COORDINATES to convert from lat/lon to whatever projection your image data is in and ENVI_CONVERT_FILE_COORDINATES to convert from map to file coordinates. The data values can be retrieved by using the file coordinates as indexes into the image array. with best regards, Allard
creator: wita
date: 2008-06-17T13:31:11-00:00