a strange loop problem [message #60946] |
Mon, 23 June 2008 19:53 |
bulrushmower
Messages: 19 Registered: February 2008
|
Junior Member |
|
|
What is wrong with the loop for the following:
i=0
Print, 'SDS_NAME'+STRTRIM(string(i+1),2), prints SDS_NAME01
But, Band = hdf_sd_nametoindex(file, 'SDS_NAME'+STRTRIM(string(i+1),
2)) is not the same with
Band = hdf_sd_nametoindex(file, SDS_NAME01 )
==========================================
SDS_NAME01 = "SREFL_CH1"
SDS_NAME02 = "SREFL_CH2"
SDS_NAME03 = "BT_CH3"
SDS_NAME04 = "BT_CH4"
SDS_NAME05 = "BT_CH5"
SDS_NAME06 = "SREFL_CH3"
SDS_NAME07 = "SZEN"
SDS_NAME08 = "VZEN"
SDS_NAME09 = "RELAZ"
SDS_NAME10 = "QA"
file = hdf_sd_start(fPath_data
+"AVH09C1.A1998180.N14.002.2007273131632.hdf")
for i=0, 9 do begin
Band = hdf_sd_nametoindex(file, 'SDS_NAME'+STRTRIM(string(i+1),2))
data = hdf_sd_select(file, Band)
hdf_sd_getdata, data, getdata
hdf_sd_endaccess, data
endfor
|
|
|