function [psaptime, samplevol, spotsize, qcredraw] = PSAPmatthewedit()


cd('E:\Google Drive\Projects\HI-SCALE SGP\Data\Peripheral Data\PSAP_matthewdownload');

currdir=dir;
sizeBonDir = size(currdir,1);
samplevol = [];
flowrate = [];
psaptime = [];
qcsamplevol = [];
spotsize = [];
qcredraw = [];
qcredweiss = [];
red_weiss = [];

for i=1:length(currdir)
	
	
	cdfcheck = ~isempty(strfind(currdir(i).name,'.cdf')) || ~isempty(strfind(currdir(i).name,'.nc'));
	if cdfcheck == 0
		continue
	end
	currfile = currdir(i).name;
% 	datestartidx = 21;
% 	year_range = datestartidx : datestartidx +3;
% 	month_range = datestartidx +4 : datestartidx +5;
% 	day_range = datestartidx +6 : datestartidx +7;
% 	startdate = [str2num(currfile(year_range)), str2num(currfile(month_range)), str2num(currfile(day_range)), 0, 0, 0];
% 	sec_time = ncread(currfile,'time');
% 	
% 	currtimemat = repmat(startdate,length(sec_time),1);
% 	currtimemat(:,6) = currtimemat(:,6) + sec_time;
% 	currtimemat = datetime(currtimemat);
%     currpsaptime = ncread(currdir(i).name,'time');
% 	psaptime = [psaptime ; currpsaptime];

	psaptime = [psaptime ; ARMtimeimport(currfile,21)];
	
	
   
	currsamplevol= ncread(currdir(i).name,'sample_volume');
	samplevol = [samplevol ; currsamplevol];
	
	flowrate = [flowrate;
		ncread(currfile,'sample_flow_rate')];
	
	qcsamplevol = [qcsamplevol ; 
		ncread(currdir(i).name,'qc_sample_volume')];  %in liters
	
	spotsize = ncread(currdir(i).name,'spot_size_area');  %in mm^2
	
	
	
	qcredraw = [qcredraw ; 
		ncread(currdir(i).name,'qc_Ba_R_raw')];
	
	qcredweiss = [qcredweiss ;
		ncread(currdir(i).name,'qc_Ba_R_Weiss')];
	
	red_weiss = [red_weiss ;
		ncread(currdir(i).name,'Ba_R_Weiss')];
	
%     samplevol_size= size(samplevol,1);
%     samplevol(1:samplevol_size,(i-2)) =ncread(BonDir(i).name,'sample_volume');
% 	
%     PSAPimpactor = ncread(BonDir(i).name,'impactor_state');
%     PSAPimpactorsize = size(PSAPimpactor,1);
%     PSAPimpactor(1:PSAPimpactorsize,(i-2)) =ncread(BonDir(i).name,'impactor_state');
%     
% %     PSAPAbsGreen = ncread(BonDir(i).name,'absorbance_green');
%     PSAPAbsGreensize = size(PSAPAbsGreen,1);
%     PSAPAbsGreen(1:PSAPAbsGreensize,(i-2)) =ncread(BonDir(i).name,'absorbance_green');
%     
%     PSAPAbsBlue = ncread(BonDir(i).name,'absorbance_blue');
%     PSAPAbsBluesize = size(PSAPAbsBlue,1);
%     PSAPAbsBlue(1:PSAPAbsBluesize,(i-2)) =ncread(BonDir(i).name,'absorbance_blue');
%     
%     PSAPAbsRed = ncread(BonDir(i).name,'absorbance_red');
%     PSAPAbsRedsize = size(PSAPAbsRed,1);
%     PSAPAbsRed(1:PSAPAbsRedsize,(i-2)) =ncread(BonDir(i).name,'absorbance_red');
%     
%     
%     PSAPImpactor=[PSAPImpactor,ncread(BonDir(i).name,'impactor_state')];
%     AbsGreen=[AbsGreen,ncread(BonDir(i).name,'absorbance_green')];
%     subplot(subnum,subnum,i);
%     plot(PSAPtime,AbsGreen,'g:'),hold on,plot(PSAPtime,PSAPImpactor,'k-'),ylim([0,20]),hold on
%     AbsBlue=[AbsBlue,ncread(BonDir(i).name,'absorbance_blue')];
%     plot(PSAPtime,AbsBlue,'b.-'),hold on,plot(PSAPtime,PSAPImpactor,'k-'),ylim([0,20]),hold on
%     AbsRed=[AbsRed,ncread(BonDir(i).name,'absorbance_red')];
%     plot(PSAPtime,AbsRed,'r.-'),hold on,plot(PSAPtime,PSAPImpactor,'k-'),ylim([0,20]), hold on
end

% idx = size(PSAPtime,1);
% maxPSAP = size(PSAPtime,1);
% 
% for j = 1:size(PSAPtime,1)
%     zerocheck = sum(PSAPtime(maxPSAP + 1 - j,:));
%     if zerocheck == 0
%         PSAPtime = PSAPtime(1:maxPSAP-j,:);
%         PSAPImpactor = PSAPImpactor(1:maxPSAP-j,:);
%         AbsGreen = AbsGreen(1:maxPSAP-j,:);
%         AbsGreen = AbsGreen(1:maxPSAP-j,:);
%         AbsGreen = AbsGreen(1:maxPSAP-j,:);
%     else 
%         break
%     end
% end





% end