function [data] = loadHDF_new(namein,sds_index)

%import matlab.io.hdfeos.*
import matlab.io.hdf4.*

%namein_coords = '/home/disk/bob/gpm_v03B/TESTDATA/2A.GPM.Ku.V5-20140829.20151130-S231357-E004626.009978.V03BCoords.hdf';
%namein_ext = '/home/disk/bob/gpm_v03B/TESTDATA/2A.GPM.Ku.V5-20140829.20151130-S231357-E004626.009978.V03Bmod.hdf';
%sds_index = 1;  %latitude from coords file
%sds_index = 2;  %refl from ext file

% pathin = '/home/disk/arcus2/gwec/dcwilton/VEN.1999/';
% namein = [pathin '2A25.991216.11797.5.HDF'];
sd_id = sd.start(namein,'read'); % initializes the SD interface for a particular file

% sds_index = 0; % geolocation
% sds_index = 1; % rain
% sds_index = 3; % correctZFactor
% sds_index = 24; % nearSurfRain
% sds_index = 25; % nearSurfZ

%sds_id = hdfsd('select',sd_id,sds_index);
sds_id = sd.select(sd_id,sds_index);

%[ndatasets,nglobal_attr,status] = hdfsd('fileinfo',sd_id); 
%[ndatasets,nglobal_attr] = sd.fileInfo(sd_id); 

%[name,rank, dimsizes,data_type,nattrs,status] = hdfsd('getinfo',sds_id);
%[name,ndims,dimsizes,data_type,nattrs,status] = hdfsd('getinfo',sds_id);
%[name,dimsizes,data_type,nattrs] = sd.getInfo(sds_id);

%rank = size(dimsizes);
%start=zeros(1,rank(1)); %=[0 0 0];
%edges=dimsizes;
%stride=ones(1,rank(1)); %=[1 1 1];
%[data,status] = hdfsd('readdata',sds_id,start,stride,edges);
data = sd.readData(sds_id);

sd.endAccess(sds_id);           % this is just a precaution
%status = hdfsd('end', sd_id);   % this is just a precaution
sd.close(sd_id);