function file_data=generic_hdf_reader(filename_to_read,trial)

read_=hdfsd('start',filename_to_read,'read');     %opens the SD file created by dwnrawreader, for reading

%opening the data set within prosslog_name
sds_id_pross_plr=hdfsd('select',read_,(trial-1)); %trial, corrected for zeroth indexing, tells which data set to read
[ds_name, ds_ndims, ds_dims, ds_type, ds_atts, stat]=hdfsd('getinfo',sds_id_pross_plr); %this line can be used to check reading
   
samples_per_record=ds_dims(2);

ds_start=[0 0]; %starts reading from the first row in the first column, with the row and column switched ala .hdf and its zeroth indexing system 
ds_stride=[];
ds_edges=[1 samples_per_record];    %one column
[ds_datauno,status]=hdfsd('readdata',sds_id_pross_plr,ds_start,ds_stride,ds_edges); 
   
ds_start=[1 0]; %starts reading from the first row in the second column
ds_stride=[];
ds_edges=[1 samples_per_record];  %other column
[ds_datados,status]=hdfsd('readdata',sds_id_pross_plr,ds_start,ds_stride,ds_edges);

file_data=[ds_datauno ds_datados];

%closing the data set after having read it
stat=hdfsd('endaccess',sds_id_pross_plr);  

%close the prosslog file
stat=hdfsd('end',read_);