Changeset 28097


Ignore:
Timestamp:
02/15/24 05:21:30 (13 months ago)
Author:
Mathieu Morlighem
Message:

BUG: fixing library problems on totten

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/plot/radarpower.m

    r27606 r28097  
    1111
    1212%Parse inputs
    13 if nargin==1,
     13if nargin==1
    1414        options=pairoptions;
    1515else
     
    2020end
    2121
    22 highres = getfieldvalue(options,'highres',0);
    2322xlim    = getfieldvalue(options,'xlim',[min(md.mesh.x) max(md.mesh.x)]);
    2423ylim    = getfieldvalue(options,'ylim',[min(md.mesh.y) max(md.mesh.y)]);
     
    2827c = getfieldvalue(options,'overlay_adjust_c',0);
    2928d = getfieldvalue(options,'overlay_adjust_d',1);
     29if diff(xlim)<1000e3 && diff(ylim)<1000e3
     30        highres = getfieldvalue(options,'highres',1);
     31else
     32        highres = getfieldvalue(options,'highres',0);
     33end
    3034
    3135%find GDAL coordinates
     
    3337y0=min(ylim); y1=max(ylim);
    3438
    35 if ~exist(options,'overlay_image'), % no image provided, go look into ModelData for one!{{{
     39%Fix libraries if need be
     40if 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/');
     43end
     44
     45if ~exist(options,'overlay_image'), % no image provided, go look into ModelData for one
    3646        if exist(options,'geotiff_name'),
    3747                paths = {getfieldvalue(options,'geotiff_name')};
     
    8393        %Crop radar image from xylim
    8494        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 ]);
    8698
    8799        %Read in temp.tif:
     
    98110                system('rm -rf ./temp.tif');
    99111        end
    100         %}}}
    101 else %user provided image {{{
     112else %user provided image
    102113
    103114        %user provided an image. check we also have overlay_xlim and overlay_ylim  options, to know what range of coordinates the image covers.
     
    154165                md.radaroverlay.y=(y0:(y1-y0)/(size(md.radaroverlay.pwr,1)-1):y1);
    155166        end
    156 end %}}}
    157 
    158 %Was a triangulation requested for the area of the image that is not covered by the mesh? %{{{
     167end
     168
     169%Was a triangulation requested for the area of the image that is not covered by the mesh?
    159170if strcmpi(getfieldvalue(options,'outertriangulation','no'),'yes'),
    160171
     
    194205        md.radaroverlay.outery=outermd.mesh.y;
    195206
    196 end %}}}
     207end
Note: See TracChangeset for help on using the changeset viewer.