comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Extract pixel values from HDF-EOS file
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Extract pixel values from HDF-EOS file [message #71906 is a reply to message #71832] Mon, 26 July 2010 08:16 Go to previous messageGo to previous message
Snow53 is currently offline  Snow53
Messages: 32
Registered: July 2010
Member
On Jul 26, 8:13 am, Snow53 <jennifer_wa...@hotmail.com> wrote:
> On Jul 23, 4:17 pm, Snow53 <jennifer_wa...@hotmail.com> wrote:
>
>
>
>
>
>> Hello all. I'm now trying to work with HDF-EOS files. I've been using
>> the IDL guide as a reference in trying to make this work. My data are
>> associated with lat, long coordinates. These data originated from
>> MODIS swath files (HDF4), but were converted to lat/long gridded HDF-
>> EOS using ModisTool. In reading the IDL guide, it looks like I need to
>> define the grid system for my file, attatch the grid to my file, and
>> then I can use  EOS_GD_GETPIXVALUES (?) to extract pixel data.  I've
>> tried to set this project up as follows; currently I'm getting stuck
>> at EOS_GD_CREATE (apparently I haven't created the grid properly).
>> Would anyone be willing to do a quick read-through and throw out
>> thoughts or suggestions?
>
>> Thanks!
>
>>  pro hdftest1
>
>> ; open and extract data from MODIS HDF-EOS file
>> path = 'X:\MODIS_GPP\Lena\2003\test\'
>
>> file_array=file_search(path, '*.hdf', count=num_file)
>>     file=file_array
>
>>     print, num_file
>>   ;print, file
>
>> for i=0, num_file-1 do begin
>> file_name=file_basename(file[i], '.hdf')
>> ;print, file_name
>
>> fid=EOS_GD_OPEN(file[i], /READ)
>
>> upx=172.763114356
>> upy=79.9999999993
>> lrx=116.952175961
>> lry=69.99999994
>> ydim=1110
>> xdim=10239
>
>> gridname='geo'
>> gridID=EOS_GD_CREATE ( fid, gridname, xdim, ydim, [upx, upy], [lrx,
>> lry]) ; this part isn't working. need to fix. failed .
>> print, gridID
>
>> ;gridname=EOS_GD_INQGRID(file[i], gridlist)
>> ;print, gridlist
>
>> out=EOS_GD_ATTACH(fid, gridname)
>> print, out
>
>> pixCol=[2,2]
>> pixRow=[2,2]
>
>> result=EOS_GD_GETPIXVALUES (out, 1, pixCol, pixRow,'Gpp_1km', buffer)
>> print, result
>
>> print, buffer
>
>> status=EOS_GD_CLOSE(fid)
>>  endfor
>>  end
>
> Still trying to get the EOS_GD_CREATE to work. I've attempted to
> change the format to the following, but still no luck.
> fid=EOS_GD_OPEN(file[i], /RDWR)
> ;print, fid
>
> upl=dblarr(87.74131944, 80)
>
> lowr=dblarr(179.957375, 70)
>
> ydim=1110
> xdim=10239
>
> gridname='geo'
> gridID=EOS_GD_CREATE( fid, gridname, xdim, ydim, upl, lowr) ; this
> part isn't working. need to fix. failed .
> print, gridID- Hide quoted text -
>
> - Show quoted text -

Ok, got that part working. Now trying to figure out why this attach
grid won't work.

pro hdftest1

; open and extract data from MODIS HDF-EOS file
path = 'X:\MODIS_GPP\Lena\2003\test\'

file_array=file_search(path, '*.hdf', count=num_file)
file=file_array

print, num_file
;print, file

for i=0, num_file-1 do begin
file_name=file_basename(file[i], '.hdf')
;print, file_name

fid=EOS_GD_OPEN(file[i], /READ)
print, fid
ffid=fid
upl=[87.74131944, 80]

lowr=[179.957375, 70]

ydim=1110
xdim=10239

gridname='geo'
gridID=EOS_GD_CREATE(ffid, gridname, xdim, ydim, upl, lowr)
print, gridID



out=EOS_GD_ATTACH(ffid, gridname)
print, ffid
print, gridname
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDL 8.0 questions
Next Topic: Object filenames

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 17:41:53 PDT 2025

Total time taken to generate the page: 0.23771 seconds