Index: /issm/trunk-jpl/src/m/plot/radarpower.m
===================================================================
--- /issm/trunk-jpl/src/m/plot/radarpower.m	(revision 28096)
+++ /issm/trunk-jpl/src/m/plot/radarpower.m	(revision 28097)
@@ -11,5 +11,5 @@
 
 %Parse inputs
-if nargin==1,
+if nargin==1
 	options=pairoptions;
 else
@@ -20,5 +20,4 @@
 end
 
-highres = getfieldvalue(options,'highres',0);
 xlim    = getfieldvalue(options,'xlim',[min(md.mesh.x) max(md.mesh.x)]);
 ylim    = getfieldvalue(options,'ylim',[min(md.mesh.y) max(md.mesh.y)]);
@@ -28,4 +27,9 @@
 c = getfieldvalue(options,'overlay_adjust_c',0);
 d = getfieldvalue(options,'overlay_adjust_d',1);
+if diff(xlim)<1000e3 && diff(ylim)<1000e3
+	highres = getfieldvalue(options,'highres',1);
+else
+	highres = getfieldvalue(options,'highres',0);
+end
 
 %find GDAL coordinates
@@ -33,5 +37,11 @@
 y0=min(ylim); y1=max(ylim);
 
-if ~exist(options,'overlay_image'), % no image provided, go look into ModelData for one!{{{
+%Fix libraries if need be
+if strcmp(oshostname(),'totten')
+	setenv('LD_LIBRARY_PATH', '/usr/lib/x86_64-linux-gnu/libgeos_c.so.1')
+	setenv('PROJ_LIB', '/usr/share/proj/');
+end
+
+if ~exist(options,'overlay_image'), % no image provided, go look into ModelData for one
 	if exist(options,'geotiff_name'),
 		paths = {getfieldvalue(options,'geotiff_name')};
@@ -83,5 +93,7 @@
 	%Crop radar image from xylim
 	filename='./temp.tif';
-	eval(['!gdal_translate -quiet -projwin ' num2str(x0) ' ' num2str(y1) ' ' num2str(x1) ' ' num2str(y0) ' ' geotiff_name ' ' filename ]);
+
+
+	system(['gdal_translate -quiet -projwin ' num2str(x0) ' ' num2str(y1) ' ' num2str(x1) ' ' num2str(y0) ' ' geotiff_name ' ' filename ]);
 
 	%Read in temp.tif:
@@ -98,6 +110,5 @@
 		system('rm -rf ./temp.tif');
 	end
-	%}}}
-else %user provided image {{{
+else %user provided image
 
 	%user provided an image. check we also have overlay_xlim and overlay_ylim  options, to know what range of coordinates the image covers.
@@ -154,7 +165,7 @@
 		md.radaroverlay.y=(y0:(y1-y0)/(size(md.radaroverlay.pwr,1)-1):y1);
 	end
-end %}}}
-
-%Was a triangulation requested for the area of the image that is not covered by the mesh? %{{{
+end
+
+%Was a triangulation requested for the area of the image that is not covered by the mesh?
 if strcmpi(getfieldvalue(options,'outertriangulation','no'),'yes'),
 
@@ -194,3 +205,3 @@
 	md.radaroverlay.outery=outermd.mesh.y;
 
-end %}}}
+end
