function pulse_duration_presyn=create_basic_text_file_justforstimduration(file_to_read)
%description: opens the hdf file of the experiment to read the pulse duration from the metadata at the beginning of each trial
%called by:
%calls:
%notes: ultimately the pulse duration should be stored in and read from the database
%code confirmed date:

hdfml('closeall');

if ismac, paththismachine='/Users/tathagatagarbha/dwn_data_analysis_system/'; elseif isunix, paththismachine='/home/dwn/Desktop/dwn_produ/'; end

patchlog_name=strcat(paththismachine,'raw_data_dwn/',file_to_read,'.hdf')

%open the patchlog created by update patchlog at the time of the recording
converting_hdf=hdfsd('start',patchlog_name,'read');
[datasets_for_converted,nglobal_atts,stat_readinghdf]=hdfsd('fileinfo',converting_hdf);
number_of_trials=datasets_for_converted;
converter_sds_id=hdfsd('select',converting_hdf,0);        %take the first dataset in the .hdf file
[ds_name, ds_ndims, ds_dims, ds_type, ds_atts, stat]=hdfsd('getinfo',converter_sds_id); %get info on the dataset
stat_dataset_end_post=hdfsd('endaccess',converter_sds_id);

for trial=1 %need only read the first trial
    %choose the dataset for this trial
    converter_sds_id=hdfsd('select',converting_hdf,(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',converter_sds_id);
    samples_per_trigger=ds_dims(2);
    ds_stride=[];       %these lines tell how the dataset should be read
    ds_edges=[1, samples_per_trigger];
    %read in the recording from the presynaptic neuron
    ds_start=[0 0];   %starts reading from the first row in the first column, with the row and column switched ala the .hdf indexing system 
    [ds_dataein,status]=hdfsd('readdata',converter_sds_id,ds_start,ds_stride,ds_edges);
    stat=hdfsd('endaccess',converter_sds_id);  %closing the data set after having read it
    pulse_duration_presyn=ds_dataein(3);
end

%closing the patchlog file
stat_hdfend=hdfsd('end',converting_hdf);