Home > utilities > merge_bathymetry.m

merge_bathymetry

PURPOSE ^

Blend two sources of bathymetry

SYNOPSIS ^

function [ new_bat ] = merge_bathymetry( dist_OB,coarse_bat,fine_bat,d0,d1 )

DESCRIPTION ^

 Blend two sources of bathymetry 

 [ new_bat ] = merge_bathymetry( dist_OB,coarse_bat,fine_bat,d0,d1 )

 DESCRIPTION:
   This script uses a blending function to combine two bathymetry sources
    over a common spatial extent (High-resolution, unstructured meshes for hydrodynamic models of the Great Barrier Reef, Australia,
    Estuarine Coastal and Shelf Science 68:36-46 · June 2006
    DOI: 10.1016/j.ecss.2005.08.017 )

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % Blend two sources of bathymetry
0002 function [ new_bat ] = merge_bathymetry( dist_OB,coarse_bat,fine_bat,d0,d1 )
0003 %
0004 % [ new_bat ] = merge_bathymetry( dist_OB,coarse_bat,fine_bat,d0,d1 )
0005 %
0006 % DESCRIPTION:
0007 %   This script uses a blending function to combine two bathymetry sources
0008 %    over a common spatial extent (High-resolution, unstructured meshes for hydrodynamic models of the Great Barrier Reef, Australia,
0009 %    Estuarine Coastal and Shelf Science 68:36-46 · June 2006
0010 %    DOI: 10.1016/j.ecss.2005.08.017 )
0011 
0012 % INPUT [keyword pairs]:
0013 %  dist_OB:     a length metric used to combine the two sources
0014 %  coarse_bat:  Bathymetry data to combine at lower distance
0015 %  fine_bat:    Bathymetry data to combine at longer distances
0016 %  d0:          is the plateau distance
0017 %  d1:          is the end distance limiting factor
0018 %
0019 %
0020 %  the blending function is a piecewise polynomial function as
0021 %  f1d= 3.*( (dist_OB-d0)./(d1-d0) ).^2 - 2.*( (dist_OB-d0)./(d1-d0) ).^3;
0022 % % restric closes points
0023 % f1d(dist_OB<=d0)=0;
0024 % f1d(dist_OB>=d1)=1;
0025 % f1d=abs(f1d-1);
0026 % % % Example
0027 % d0=50;d1=2000;dist_OB = 0:100:12000;
0028 % f1d= 3.*( (dist_OB-d0)./(d1-d0) ).^2 - 2.*( (dist_OB-d0)./(d1-d0) ).^3;
0029 % % restric closes points
0030 % f1d(dist_OB<=d0)=0;
0031 % f1d(dist_OB>=d1)=1;
0032 % plot(dist_OB,abs(f1d-1));
0033 % EXAMPLE USAGE
0034 %    Mobj_all.sub.z_merged = merge_bathymetry( Distance_from_nodestring,Mobj_all.z,Mobj_all.z1,100,2000 );
0035 %
0036 % Author(s):
0037 %    Ricardo Torres (Plymouth Marine Laboratory)
0038 %
0039 % Revision history
0040 %
0041 %
0042 %==============================================================================
0043 
0044 
0045 
0046 f1d= 3.*( (dist_OB-d0)./(d1-d0) ).^2 - 2.*( (dist_OB-d0)./(d1-d0) ).^3;
0047 % restric closes points
0048 f1d(dist_OB<=d0)=0;
0049 f1d(dist_OB>=d1)=1;
0050 f1d=abs(f1d-1);
0051 new_bat=f1d.*coarse_bat+((1-f1d).*fine_bat);
0052 return
0053

Generated on Wed 20-Feb-2019 16:06:01 by m2html © 2005