radarpower

PURPOSE ^

RADARPOWER - overlay a power radar image on an existing mesh

SYNOPSIS ^

function md=radarpower(md,highres)

DESCRIPTION ^

RADARPOWER - overlay a power radar image on an existing mesh

   This routine will overlay a power radar image on an existing mesh.
   The power amplitude will be output to vel for now.
   In the future, think about a field to hold this value.

   Usage:
      md=radarpower(md,highres)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function md=radarpower(md,highres)
0002 %RADARPOWER - overlay a power radar image on an existing mesh
0003 %
0004 %   This routine will overlay a power radar image on an existing mesh.
0005 %   The power amplitude will be output to vel for now.
0006 %   In the future, think about a field to hold this value.
0007 %
0008 %   Usage:
0009 %      md=radarpower(md,highres)
0010 
0011 global ISSM_DIR
0012 global MODELDATA
0013 
0014 %find gdal coordinates
0015 x0=min(md.x);
0016 x1=max(md.x);
0017 
0018 y0=min(md.y);
0019 y1=max(md.y);
0020 
0021 %Get path  to gdal binaries
0022 path_gdal=[ISSM_DIR '/Libs/gdal/install'];
0023 
0024 %Was gdal compiled?
0025 if exist([path_gdal 'gdal_translate'])==0,
0026     error(['radarpower error message: GDAL library needs to be compiled to use this routine. Compile GDAL in ' ISSM_DIR '/Libs/gdal to use this routine.']);
0027 end
0028 
0029 %the geotiff image is either 200m or 1km accuracy.
0030 if highres,
0031     geotiff_name=[MODELDATA 'MosaicTiffRsat/amm125m_v2_200m.tif'];
0032 else
0033     geotiff_name=[MODELDATA 'MosaicTiffRsat/amm125m_v2_1km.tif'];
0034 end
0035 
0036 %Name of image
0037 inputname='./temp.tif';
0038 
0039 command=['system(''' path_gdal 'gdal_translate -quiet -projwin ' num2str(x0) ' ' num2str(y1) ' ' num2str(x1) ' ' num2str(y0) ' ' geotiff_name ' ' inputname ''');'];
0040 eval(command);
0041 
0042 %Read in temp.tif:
0043 md.sarpwr=double(flipud(imread('temp.tif','TIFF')));
0044 md.sarxm=(x0:(x1-x0)/(size(md.sarpwr,2)-1):x1);
0045 md.sarym=(y0:(y1-y0)/(size(md.sarpwr,1)-1):y1);
0046 
0047 %Erase image
0048 system('rm -rf ./temp.tif');

Generated on Sun 29-Mar-2009 20:22:55 by m2html © 2003