function varData = gather_Water(fileList,indices,direc,variableName)

    % Initialize the output variable
    varData = cell(length(fileList), 1);

    % Loop through each file in the list
    for i = 1:length(fileList)
        [path, filename, ext] = fileparts(fileList{i});
        idx = indices{i}; %dropsonde index
        if contains(path,'CPEX_CV')
            h5_path = strrep(path, '/PBLH', direc);
            h5_file = strcat(filename,'.h5');
            full_path_h5 = strcat(h5_path,h5_file);
            variable = h5read(full_path_h5, variableName);
            varData{i} = variable(idx);
        else
            h5_path = strrep(path, '/PBLH', '/Archive_drop/Archive/');
            h5_file = strcat(filename,'.h5');
            full_path_h5 = strcat(h5_path,h5_file);
            filler_data = h5read(full_path_h5, '/Nav_Data/gps_time');
            variable = nan(size(filler_data));
            varData{i} = variable(idx);            
        end 
    end

end







