Re: reading multiple HDF files [message #61414 is a reply to message #61322] |
Tue, 15 July 2008 13:37  |
bulrushmower
Messages: 19 Registered: February 2008
|
Junior Member |
|
|
On Jul 15, 12:50 pm, Juggernaut <juggernau...@gmail.com> wrote:
> On Jul 15, 11:05 am, David Fanning <n...@dfanning.com> wrote:
>
>
>
>
>
>> julia.waltersp...@gmail.com writes:
>>> In the meantime I did the file_search and read in file by file with a
>>> for-loop. But I guess this solution does not append the "newly" read
>>> Variable to the other ones so that I can do a plot of a time series..?
>
>> You will probably have to do that yourself. :-)
>
>> But, I imagine this array can get pretty big. I think I would
>> write the files to disk, then read them back in using
>> the associated variable method (ASSOC) when you need them.
>
>> OpenW, outlun, 'mybigfile.dat', /Get_Lun
>> FOR thisFile = 0, count-1 DO BEGIN
>> thisImage = HDF_READ(files[thisFile], ....)
>> WriteU, outlun, thisImage
>> ENDFOR
>> Free_Lun, outlun
>
>> Then, later:
>
>> OpenR, lun, 'mybigfile.dat', /Get_Lun
>> imageStack = Assoc(lun, IntArr(xsize, ysize))
>
>> To display the 4th image:
>
>> TV, imageStack[3]
>
>> Or, whatever else you want to do with them.
>
>> If you want them all, of course:
>
>> stack = IntArr(xsize, ysize, count)
>> OpenR, lun, 'mybigfile.dat', /Get_Lun
>> ReadU, lun, stack
>> Free_Lun, lun
>
>> Of course, your images might not be integer arrays, and
>> I have no idea what size these are, etc., etc. Use this
>> code at your discretion. :-)
>
>> Cheers,
>
>> David
>> --
>> David Fanning, Ph.D.
>> Fanning Software Consulting, Inc.
>> Coyote's Guide to IDL Programming:http://www.dfanning.com/
>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
> If you want to compare these in a plot you'll probably need to
> normalize your time series as this could be different for them all
> although I don't know if MODIS has a 0 start of collect time or a zulu
> start of collect time, etc...- Hide quoted text -
>
> - Show quoted text -
Try this link
http://groups.google.com/group/comp.lang.idl-pvwave/browse_t hread/thread/cae923b1cd9c393b/da2b8712b63af341?hl=en&lnk =gst&q=HDF#da2b8712b63af341
|
|
|