%This program takes data computed by the read_scs_day progam and creates an ascii
%file appropriate for reading into a spreadsheet (e.g., lotus, quatropro, etc)
%Files are written as proc_scsDDD.txt where DDD is julian day
disp(['prt_jas_SCS: ', cruise]);

fclose('all');
clear jaz;

f=[way_proc_data_flux cruise '_proc_scs_1min_' sprintf('%04i_%02i_%02i_%03i',Vdate(1),Vdate(2),Vdate(3),ddd)  '.txt'];
flist=fopen(f,'w');

%take stats data and stick into matrix
npz=np;

jaz(1,1:npz)=jd_pc;          %Day-Of-Year
jaz(2,1:npz)=Dec_Lat;         %Latitude	deg	C-Nav GPS receiver
jaz(3,1:npz)=Dec_Lon;         %Longitude	deg	C-Nav GPS receiver
jaz(4,1:npz)=COG;             %Course Over Ground	deg	C-Nav GPS receiver
jaz(5,1:npz)=SOG;       %Speed Over Ground	knots	C-Nav GPS receiver
jaz(6,1:npz)=SBE48T;           %Sea Surface Temperature	C	SeaBird SBE48 hull-mounted, 5m below waterline?
jaz(7,1:npz)=SWR;            %Short Wave Radiation	W/m2	IMET (Eppley Laboratories, Inc. pyronometer)
jaz(8,1:npz)=LWR;            %Long Wave Radiation	W/m2	IMET (Eppley Laboratories, Inc. pyronometer)
jaz(9,1:npz)=WXTP_Ta ;       %Air Temp	C	Port VaisalaWXT520
jaz(10,1:npz)=WXTS_Ta;        %Air Temp	C	Starboard VaisalaWXT520
jaz(11,1:npz)=WXTS_Pa;        %Pressure	hPa	Starboard VaisalaWXT520, uncorrected for height
jaz(12,1:npz)=WXTP_Pa;        %Pressure	hPa	Port VaisalaWXT520, uncorrected for height
jaz(13,1:npz)=WXTP_Rc;        %Cumulative Rainfall	mm	Port VaisalaWXT520
jaz(14,1:npz)=WXTS_Rc;        %Cumulative Rainfall	mm	Starboard VaisalaWXT520
jaz(15,1:npz)=WXTS_Ri;        %Rainfall Intensity	mm/h	Starboard VaisalaWXT520
jaz(16,1:npz)=WXTP_Ri;        %Rainfall Intensity	mm/h	Port VaisalaWXT520
jaz(17,1:npz)=WXTS_Dm;        %Relative Wind Direction	deg	Starboard VaisalaWXT520
jaz(18,1:npz)=WXTS_Sm;        %Relative Wind Speed	m/s	Starboard VaisalaWXT520
jaz(19,1:npz)=WXTP_Dm;        %Relavive Wind Direction	deg	Port VaisalaWXT520
jaz(20,1:npz)=WXTP_Sm;        %Relative Wind Speed	m/s	Port VaisalaWXT520
jaz(21,1:npz)=WXTS_Ua;        %Relative Humidity	%	Port VaisalaWXT520
jaz(22,1:npz)=WXTP_Ua;        %Relative Humidity	%	Starboard VaisalaWXT520
jaz(23,1:npz)=HDT;            %Ship Heading	deg	Ship's gyro
jaz(24,1:npz)=HDT*NaN;          %Sea Surface Conductivity	mmho/cm	FSI OCM-S-212 #CO,  in-line near UCSW intake, 5m below waterline
jaz(25,1:npz)=WXTP_TD;        %True Wind Direction	deg	Port VaisalaWXT520, corrected for ship's gyro, SOG, and COG
jaz(26,1:npz)=WXTS_TD;        %True Wind Direction	deg	Starboard VaisalaWXT520, corrected for ship's gyro, SOG, and COG
jaz(27,1:npz)=WXTP_TS;        %True Wind Speed	m/s	Port VaisalaWXT520, corrected for ship's gyro, SOG, and COG
jaz(28,1:npz)=WXTS_TS;        %True Wind Speed	m/s	Starboard VaisalaWXT520, corrected for ship's gyro, SOG, and COG
jaz(29,1:npz)=FLR;    %Fluorescence	mV	WetLabs Wet-StarWS3S-901P


fprintf(flist,'%11.5f %10.4f %10.4f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f  %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f %9.2f \r\n',jaz);           
fclose('all');
	
