function AddAllDataToBinsR(bin, binL, binU, obs)

global 	gB1DataFlag...
		gB2DataFlag...
		gB3DataFlag...
		gB4DataFlag...
		gB5DataFlag...
		gB6DataFlag...
		gC1DataFlag...
		gC2DataFlag...
		gC3DataFlag...
		gB7NPDataFlag...
		gCNPDataFlag;
		
global 	gB1Data...
		gB2Data...
		gB3Data...
		gB4Data...
		gB5Data...
		gB6Data...
		gC1Data...
		gC2Data...
		gC3Data...
		gB7NPData...
		gCNPData;
		
global 	gAverageCimelFlag;

	% Place data for specified bands into the corrent bin

if gB1DataFlag == 1
	obsStartIndex = 26;
	for j=1:3
		for i=binL:binU
			gB1Data(i,j) = gB1Data(i,j) + obs(obsStartIndex);
			end;
		
		obsStartIndex = obsStartIndex + 1;
		end;
	end;
				
if gB2DataFlag == 1
	obsStartIndex = 8;
	for j=1:3
		for i=binL:binU
			gB2Data(i,j) = gB2Data(i,j) + obs(obsStartIndex);
			end;
		
		obsStartIndex = obsStartIndex + 1;
		end;
	end;
				
if gB3DataFlag == 1
	obsStartIndex = 22;
	for j=1:3
		for i=binL:binU
			gB3Data(i,j) = gB3Data(i,j) + obs(obsStartIndex);
			end;
			
		obsStartIndex = obsStartIndex + 1;
		end;
	end;
				
if gB4DataFlag == 1
	obsStartIndex = 15;
	for j=1:3
		for i=binL:binU
			gB4Data(i,j) = gB4Data(i,j) + obs(obsStartIndex);
			end;
			
		obsStartIndex = obsStartIndex + 1;
		end;
	end;
				
if gB5DataFlag == 1
	obsStartIndex = 19;
	for j=1:3
		for i=binL:binU
			gB5Data(i,j) = gB5Data(i,j) + obs(obsStartIndex);
			end;
			
		obsStartIndex = obsStartIndex + 1;
		end;
	end;
				
if gB6DataFlag == 1
	obsStartIndex = 12;
	for j=1:3
		for i=binL:binU
			gB6Data(i,j) = gB6Data(i,j) + obs(obsStartIndex);
			end;
			
		obsStartIndex = obsStartIndex + 1;
		end;
	end;
	
if gAverageCimelFlag == 1
	if gC1DataFlag == 1
		obsStartIndex = 38;
		for j=1:3
			for i=binL:binU
				gC1Data(i,j) = gC1Data(i,j) + obs(obsStartIndex);
				end;
			obsStartIndex = obsStartIndex + 1;
			end;
		end;	% if gC1DataFlag == 1
				
	if gC2DataFlag == 1
		obsStartIndex = 32;
		for j=1:3
			for i=binL:binU
				gC2Data(i,j) = gC2Data(i,j) + obs(obsStartIndex);
				end;
			obsStartIndex = obsStartIndex + 1;
			end;
		end;	% if gC2DataFlag == 1
				
	if gC3DataFlag == 1
		obsStartIndex = 35;
		for j=1:3
			for i=binL:binU
				gC3Data(i,j) = gC3Data(i,j) + obs(obsStartIndex);
				end;
			obsStartIndex = obsStartIndex + 1;
			end;
		end;	% if gC3DataFlag == 1

else	%gAverageCimelFlag ~= 1
	if gC1DataFlag == 1
		obsStartIndex = 38;
		for j=1:3
			gC1Data(bin,j) = gC1Data(bin,j) + obs(obsStartIndex);
			obsStartIndex = obsStartIndex + 1;
			end;
		end;	% if gC1DataFlag == 1
				
	if gC2DataFlag == 1
		obsStartIndex = 32;
		for j=1:3
			gC2Data(bin,j) = gC2Data(bin,j) + obs(obsStartIndex);
			obsStartIndex = obsStartIndex + 1;
			end;
		end;	%  if gC2DataFlag == 1
				
	if gC3DataFlag == 1
		obsStartIndex = 35;
		for j=1:3
			gC3Data(bin,j) = gC3Data(bin,j) + obs(obsStartIndex);
			obsStartIndex = obsStartIndex + 1;
			end;
		end;	%  if gC3DataFlag == 1
		
end;	% if gAverageCimelFlag == 1, else...
				
if gB7NPDataFlag == 1
	for i=binL:binU
		gB7NPData(i,1) = gB7NPData(i,1) + obs(11);
		gB7NPData(i,2) = gB7NPData(i,2) + obs(18);
		gB7NPData(i,3) = gB7NPData(i,3) + obs(25);
		end;
	end;
				
if gCNPDataFlag == 1
	obsStartIndex = 29;
	for j=1:3
		gCNPData(bin,j) = gCNPData(bin,j) + obs(obsStartIndex);
		obsStartIndex = obsStartIndex + 1;
		end;
	end;
