Index: /issm/trunk-jpl/src/m/classes/model.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/model.m	(revision 19893)
+++ /issm/trunk-jpl/src/m/classes/model.m	(revision 19894)
@@ -1352,5 +1352,5 @@
 
 		end % }}}
-		function savemodeljs(md,modelname,filename) % {{{
+		function savemodeljs(md,modelname,websiteroot) % {{{
 
 			%the goal of this routine is to save the model as a javascript array that can be included in any html 
@@ -1358,8 +1358,8 @@
 
 			%disp: 
-			disp(['saving model ''' modelname ''' in file ' filename]);
+			disp(['saving model ''' modelname ''' in file ' websiteroot '/js/' modelname '.js']);
 
 			%open file for writing and declare the model:
-			fid=fopen(filename,'w');
+			fid=fopen([websiteroot '/js/' modelname '.js'],'w');
 			fprintf(fid,'var %s=new model();\n',modelname);
 
@@ -1371,5 +1371,5 @@
 
 				%Some properties do not need to be saved
-				if ismember(field,{'results' 'radaroverlay','cluster' }),
+				if ismember(field,{'results','cluster' }),
 					continue;
 				end
Index: /issm/trunk-jpl/src/m/classes/radaroverlay.js
===================================================================
--- /issm/trunk-jpl/src/m/classes/radaroverlay.js	(revision 19893)
+++ /issm/trunk-jpl/src/m/classes/radaroverlay.js	(revision 19894)
@@ -11,14 +11,18 @@
 		console.log(sprintf('   radaroverlay parameters:'));
 
-		fielddisplay(this,'pwr','radar power image (matrix)');
-		fielddisplay(this,'x','corresponding x coordinates [m]');
-		fielddisplay(this,'y','corresponding y coordinates [m]');
+		fielddisplay(this,'xlim','corresponding x boundaries[m]');
+		fielddisplay(this,'ylim','corresponding y boundaries [m]');
+		fielddisplay(this,'outerindex','outer triangulation between mesh and bounding box');
+		fielddisplay(this,'outerx','outer triangulation x coordinate between mesh and bounding box');
+		fielddisplay(this,'outery','outer triangulation y coordinate between mesh and bounding box');
 
 	}// }}}
 	//properties 
 	// {{{
-	this.pwr = NaN;
-	this.x   = NaN;
-	this.y   = NaN;
+	this.xlim   = NaN;
+	this.ylim   = NaN;
+	this.outerindex   = NaN;
+	this.outerx   = NaN;
+	this.outery   = NaN;
 	this.setdefaultparameters();
 	//}}}
Index: /issm/trunk-jpl/src/m/classes/radaroverlay.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/radaroverlay.m	(revision 19893)
+++ /issm/trunk-jpl/src/m/classes/radaroverlay.m	(revision 19894)
@@ -9,4 +9,8 @@
 		x   = NaN;
 		y   = NaN;
+		outerindex = NaN;
+		outerx = NaN;
+		outery = NaN;
+		outerheight = NaN;
 	end
 	methods
@@ -28,4 +32,20 @@
 			fielddisplay(self,'x','corresponding x coordinates [m]');
 			fielddisplay(self,'y','corresponding y coordinates [m]');
+			fielddisplay(self,'outerindex','outer triangulation corresponding to space between mesh and the bounding box');
+			fielddisplay(self,'outerx','outer x corresponding to space between mesh and the bounding box');
+			fielddisplay(self,'outery','outer y corresponding to space between mesh and the bounding box');
+			fielddisplay(self,'outerheight','outer height corresponding to space between mesh and the bounding box');
+
+		end % }}}
+		function savemodeljs(self,fid,modelname) % {{{
+		
+			if ~isnan(self.pwr),
+				writejs1Darray(fid,[modelname '.radaroverlay.xlim'],[min(self.x) max(self.x)]);
+				writejs1Darray(fid,[modelname '.radaroverlay.ylim'],[min(self.y) max(self.y)]);
+				writejs2Darray(fid,[modelname '.radaroverlay.outerindex'],self.outerindex);
+				writejs1Darray(fid,[modelname '.radaroverlay.outerx'],self.outerx);
+				writejs1Darray(fid,[modelname '.radaroverlay.outery'],self.outery);
+				writejs1Darray(fid,[modelname '.radaroverlay.outerheight'],self.outerheight)
+			end
 
 		end % }}}
Index: /issm/trunk-jpl/src/m/classes/timestepping.m
===================================================================
--- /issm/trunk-jpl/src/m/classes/timestepping.m	(revision 19893)
+++ /issm/trunk-jpl/src/m/classes/timestepping.m	(revision 19894)
@@ -93,5 +93,4 @@
 			writejsdouble(fid,[modelname '.timestepping.cfl_coefficient'],self.cfl_coefficient);
 			writejsdouble(fid,[modelname '.timestepping.interp_forcings'],self.interp_forcings);
-			writejsdouble(fid,[modelname '.timestepping.in_years'],self.in_years);
 
 		end % }}}
Index: /issm/trunk-jpl/src/m/miscellaneous/converttopowerof2.m
===================================================================
--- /issm/trunk-jpl/src/m/miscellaneous/converttopowerof2.m	(revision 19894)
+++ /issm/trunk-jpl/src/m/miscellaneous/converttopowerof2.m	(revision 19894)
@@ -0,0 +1,29 @@
+function converttopowerof2(tiffname,pngname)
+%CONVERTTOPOWEROF2: read it a tiff, resize it so its xy dimensions are multiples of 2, and convert to png 
+%
+%  Usage:    converttopowerof2('temp.tif','temp.png')
+%
+
+	if ismac,
+		dyld_library_path_old=getenv('DYLD_LIBRARY_PATH');
+		setenv('DYLD_LIBRARY_PATH','/opt/local/lib:/usr/lib');
+	end
+
+	%figure out the size of the tiff
+	[status,width]=system(['tiffinfo ' tiffname ' 2>/dev/null | grep "Image Width" | awk ''{printf("%s\n",$3);}''']); 
+	[status,length]=system(['tiffinfo ' tiffname ' 2>/dev/null | grep "Image Width" | awk ''{printf("%s\n",$6);}''']);
+	width=str2num(width); length=str2num(length);
+
+	
+	%Now, figure out the highest multiple of 2 for both width and length:
+	width=2^nextpow2(width); length=2^nextpow2(length);
+
+	%convert image to that size: 
+	setenv('DYLD_LIBRARY_PATH','/opt/local/lib:/usr/lib');
+	
+	[status,result]=system(sprintf('convert %s -resize %ix%i %s',tiffname,width,length,pngname));
+	system(sprintf('rm -rf %s',tiffname));
+
+	%reset DYLD_LIBRARY_PATH to what it was:
+	if ismac, setenv('DYLD_LIBRARY_PATH',dyld_library_path_old); end
+end
Index: /issm/trunk-jpl/src/m/plot/radarpower.m
===================================================================
--- /issm/trunk-jpl/src/m/plot/radarpower.m	(revision 19893)
+++ /issm/trunk-jpl/src/m/plot/radarpower.m	(revision 19894)
@@ -104,10 +104,7 @@
 
 		%Erase image or keep it?
-		if getfieldvalue(options,'keep_image',0),
-			system(['mv ./temp.tif ' getfieldvalue(options,'image_name','temp.tif')]);
-		else
+		if ~getfieldvalue(options,'keep_image',0),
 			system('rm -rf ./temp.tif');
 		end
-
 	elseif md.mesh.epsg==3031,
 		if ~exist(options,'geotiff_name'),
@@ -140,4 +137,9 @@
 		%Erase image
 		system('rm -rf ./temp.tif');
+		%Erase image or keep it?
+		if ~getfieldvalue(options,'keep_image',0),
+			system('rm -rf ./temp.tif');
+		end
+
 
 	else
@@ -170,2 +172,36 @@
 	md.radaroverlay.y=(y0:(y1-y0)/(size(md.radaroverlay.pwr,1)-1):y1);
 end
+
+%Was a triangulation requested for the area of the image that is not covered by the mesh?
+if getfieldvalue(options,'outertriangulation','yes'),
+
+	%create expfile that is a box controlled by xlim and ylim, with a hole defined by the mesh outer segments.
+	box.name='';
+	
+	%box: 
+	box.x=[xlim(1) xlim(2) xlim(2) xlim(1) xlim(1)];
+	box.y=[ylim(1) ylim(1) ylim(2) ylim(2) ylim(1)];
+	box.density=1;
+
+	%inner hole from mesh segments: 
+	box(2).x=[md.mesh.x(md.mesh.segments(:,1)); md.mesh.x(md.mesh.segments(end,2))];
+	box(2).x=[box(2).x; box(2).x(1)];
+	box(2).y=[md.mesh.y(md.mesh.segments(:,1)); md.mesh.y(md.mesh.segments(end,2))];
+	box(2).y=[box(2).y; box(2).y(1)];
+
+	box(2).x=flipud(box(2).x);
+	box(2).y=flipud(box(2).y);
+
+	%write contour to file
+	expwrite(box,'./outertriangulation.exp');
+
+	%mesh: 
+	maxarea=max(GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y));
+	outermd=triangle(model(),'./outertriangulation.exp',maxarea);
+	
+	%save the triangulation: 
+	md.radaroverlay.outerindex=outermd.mesh.elements;
+	md.radaroverlay.outerx=outermd.mesh.x;
+	md.radaroverlay.outery=outermd.mesh.y;
+
+end
Index: /issm/trunk-jpl/src/m/plot/slider.js
===================================================================
--- /issm/trunk-jpl/src/m/plot/slider.js	(revision 19893)
+++ /issm/trunk-jpl/src/m/plot/slider.js	(revision 19894)
@@ -14,4 +14,5 @@
 	endmessage=options.getfieldvalue('endmessage',message);
 	color=options.getfieldvalue('color','#bbbbbb');
+	precision=options.getfieldvalue('precision',3);
 
 	$('<div id="slider_'+slidername+'"></div>').appendTo('#sliders');
@@ -48,11 +49,11 @@
 function moveSlide(event,ui,info,middlemessage){
 	var val=ui.value;
-	info.text(middlemessage[0]+val.toPrecision(3).toString()+middlemessage[1]);
+	info.text(middlemessage[0]+val.toPrecision(precision).toString()+middlemessage[1]);
 }
 
 function stopSlide(event,ui,info,functionvalue,middlemessage,endmessage){
 	var val=ui.value;
-	info.text(middlemessage[0]+val.toPrecision(3).toString()+middlemessage[1]);
+	info.text(middlemessage[0]+val.toPrecision(precision).toString()+middlemessage[1]);
 	functionvalue(val);
-	info.text(endmessage[0]+val.toPrecision(3).toString()+endmessage[1]);
+	info.text(endmessage[0]+val.toPrecision(precision).toString()+endmessage[1]);
 }
