Changeset 28097
- Timestamp:
- 02/15/24 05:21:30 (13 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/plot/radarpower.m
r27606 r28097 11 11 12 12 %Parse inputs 13 if nargin==1 ,13 if nargin==1 14 14 options=pairoptions; 15 15 else … … 20 20 end 21 21 22 highres = getfieldvalue(options,'highres',0);23 22 xlim = getfieldvalue(options,'xlim',[min(md.mesh.x) max(md.mesh.x)]); 24 23 ylim = getfieldvalue(options,'ylim',[min(md.mesh.y) max(md.mesh.y)]); … … 28 27 c = getfieldvalue(options,'overlay_adjust_c',0); 29 28 d = getfieldvalue(options,'overlay_adjust_d',1); 29 if diff(xlim)<1000e3 && diff(ylim)<1000e3 30 highres = getfieldvalue(options,'highres',1); 31 else 32 highres = getfieldvalue(options,'highres',0); 33 end 30 34 31 35 %find GDAL coordinates … … 33 37 y0=min(ylim); y1=max(ylim); 34 38 35 if ~exist(options,'overlay_image'), % no image provided, go look into ModelData for one!{{{ 39 %Fix libraries if need be 40 if strcmp(oshostname(),'totten') 41 setenv('LD_LIBRARY_PATH', '/usr/lib/x86_64-linux-gnu/libgeos_c.so.1') 42 setenv('PROJ_LIB', '/usr/share/proj/'); 43 end 44 45 if ~exist(options,'overlay_image'), % no image provided, go look into ModelData for one 36 46 if exist(options,'geotiff_name'), 37 47 paths = {getfieldvalue(options,'geotiff_name')}; … … 83 93 %Crop radar image from xylim 84 94 filename='./temp.tif'; 85 eval(['!gdal_translate -quiet -projwin ' num2str(x0) ' ' num2str(y1) ' ' num2str(x1) ' ' num2str(y0) ' ' geotiff_name ' ' filename ]); 95 96 97 system(['gdal_translate -quiet -projwin ' num2str(x0) ' ' num2str(y1) ' ' num2str(x1) ' ' num2str(y0) ' ' geotiff_name ' ' filename ]); 86 98 87 99 %Read in temp.tif: … … 98 110 system('rm -rf ./temp.tif'); 99 111 end 100 %}}} 101 else %user provided image {{{ 112 else %user provided image 102 113 103 114 %user provided an image. check we also have overlay_xlim and overlay_ylim options, to know what range of coordinates the image covers. … … 154 165 md.radaroverlay.y=(y0:(y1-y0)/(size(md.radaroverlay.pwr,1)-1):y1); 155 166 end 156 end %}}}157 158 %Was a triangulation requested for the area of the image that is not covered by the mesh? %{{{167 end 168 169 %Was a triangulation requested for the area of the image that is not covered by the mesh? 159 170 if strcmpi(getfieldvalue(options,'outertriangulation','no'),'yes'), 160 171 … … 194 205 md.radaroverlay.outery=outermd.mesh.y; 195 206 196 end %}}}207 end
Note:
See TracChangeset
for help on using the changeset viewer.