Changeset 6488


Ignore:
Timestamp:
11/04/10 07:53:15 (14 years ago)
Author:
Mathieu Morlighem
Message:

Simplified Radarpower

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/model/radarpower.m

    r6286 r6488  
    1 function md=radarpower(md,hemisphere,xlim,ylim,highres)
     1function md=radarpower(md,xlim,ylim,highres)
    22%RADARPOWER - overlay a power radar image on an existing mesh
    33%
     
    77%
    88%   Usage:
    9 %      md=radarpower(md,hemisphere,xlim,ylim,highres)
     9%      md=radarpower(md,xlim,ylim,highres)
     10%      md=radarpower(md,xlim,ylim)
     11%      md=radarpower(md)
    1012
    1113global ISSM_TIER
     
    1517if isempty(MODELDATA), MODELDATA='/u/astrid-r1b/larour/ModelData'; end
    1618
     19%Parse inputs
     20if nargin<4,
     21        highres=0;
     22end
     23if nargin<3,
     24        xlim=[min(md.x) max(md.x)];
     25        ylim=[min(md.y) max(md.y)];
     26end
     27
    1728%find gdal coordinates
    18 x0=min(xlim);
    19 x1=max(xlim);
    20 
    21 y0=min(ylim);
    22 y1=max(ylim);
     29x0=min(xlim); x1=max(xlim);
     30y0=min(ylim); y1=max(ylim);
    2331
    2432%the geotiff image is either 200m or 1km accuracy.
    25 if strcmpi(hemisphere,'n'),
     33if strcmpi(md.hemisphere,'n'),
    2634        if ~exist([MODELDATA '/MOG/mog150_greenland_map.jpg']),
    2735                error(['radarpower error message: file ' MODELDATA '/MOG/mog150_greenland_map.jpg not found. Check MODELDATA variable..']);
     
    3543
    3644        %Read and crop file
     45        disp('Warning: expecting coordinates in polar stereographic (Std Latitude: 70ºN Meridian: 45º)');
    3746        im=imread(jpgim);
    3847        im=im(toplefty:toplefty+sizey,topleftx:topleftx+sizex);
     
    4150        md.sarym=(y0:(y1-y0)/(size(md.sarpwr,1)-1):y1);
    4251
    43 else
     52elseif strcmpi(md.hemisphere,'s'),
    4453        if highres,
    4554                if ~exist([MODELDATA '/MosaicTiffRsat/amm125m_v2_200m.tif']),
     
    6675        system('rm -rf ./temp.tif');
    6776
     77else
     78        error('field hemisphere should either be ''n'' or ''s''');
    6879end
Note: See TracChangeset for help on using the changeset viewer.