Re: hdf_sd_getdata [message #30723] |
Thu, 16 May 2002 04:00  |
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   |
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  |
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]]
|
|
|