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

Home » Public Forums » archive » Re: hdf_sd_getdata
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: hdf_sd_getdata [message #30723] Thu, 16 May 2002 04:00 Go to next message
r_cherukuru3 is currently offline  r_cherukuru3
Messages: 5
Registered: May 2002
Junior Member
James Kuyper <kuyper@gscmail.gsfc.nasa.gov> wrote in message

> band4 = HDF_SD_GetData(sd_id, start=[0,0,4], count = [512, 1000, 1])
> band8 = HDF_SD_GetData(sd_id, start=[0,0,8], count = [512, 1000, 1])
> band11 = HDF_SD_GetData(sd_id, start=[0,0,11], count = [512, 1000, 1])
>
> three_band = [ [[band4]],[[band8]],[[band11]] ]

Thanks james......but is there any possibilty to do this same
task(random,multiple slab extraction) using a single line.....actually
im not clear with the keyword STRIDE....will that be of any use.....rc

C.R.C.Nagur
Institute of Marine Studies
University of Plymouth, UK
http://hydrography.ims.plym.ac.uk/geomatics/
Re: hdf_sd_getdata [message #30734 is a reply to message #30723] Wed, 15 May 2002 14:48 Go to previous messageGo to next message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
rc wrote:

> Hi all,
>
> I have a 3 dimensional HDF SD (512 pixels * 1000 lines * 14 bands) and
> i would like to extract only 3 bands( 4, 8,11). Can anyone tell me how
> i can do that using hdf_sd_getData. .......thanks in advance.......rc

band4 = HDF_SD_GetData(sd_id, start=[0,0,4], count = [512, 1000, 1])
band8 = HDF_SD_GetData(sd_id, start=[0,0,8], count = [512, 1000, 1])
band11 = HDF_SD_GetData(sd_id, start=[0,0,11], count = [512, 1000, 1])

three_band = [ [[band4]],[[band8]],[[band11]] ]
Re: hdf_sd_getdata [message #30810 is a reply to message #30723] Thu, 16 May 2002 12:05 Go to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
rc wrote:

> James Kuyper <kuyper@gscmail.gsfc.nasa.gov> wrote in message
>
>
>> band4 = HDF_SD_GetData(sd_id, start=[0,0,4], count = [512, 1000,
>> 1]) band8 = HDF_SD_GetData(sd_id, start=[0,0,8], count = [512,
>> 1000, 1]) band11 = HDF_SD_GetData(sd_id, start=[0,0,11], count =
>> [512, 1000, 1])

I knew I should have tested it before posting!

HDF_SD_GetData, sd_id, band4, start=[0,0,4], count = [512, 1000, 1])
; etc.

>>
>> three_band = [ [[band4]],[[band8]],[[band11]] ]
>
>
> Thanks james......but is there any possibilty to do this same
task(random,multiple
> slab extraction) using a single line.....actually im not clear
> with the keyword STRIDE....will that be of any use.....rc

STRIDE is extremely useful - when it's applicable. Which isn't thc case
with random selections. If you'd asked for bands 5, 8, 11, you could
have used

HDF_SD_GetData, bands, start=[0,0,5], count=[512,1000,3], stride=[1,1,3]

However, since the spacing is irregular, there's no way to do it in a
single call. One option is to read in the whole array, and then select
out the parts you want. This is only cost-effective for small arrays:

HDF_SD_GetData,sd_id, bands
bands = bands[*,*,[4,8,11]]
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: reversing [near, far] for volume rendering
Next Topic: MEDIAN and double?

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

Current Time: Wed Oct 08 17:04:59 PDT 2025

Total time taken to generate the page: 0.00567 seconds