Home > hfrc > matlab > @HFRC > particle_track_2nd.m

particle_track_2nd

PURPOSE ^

PARTICLE_TRACK_2D - track the movement of one or more particles using a

SYNOPSIS ^

function [ t, lon, lat ] = particle_track_2nd( h, start_t, end_t,coord,max_dist,varargin )

DESCRIPTION ^

 PARTICLE_TRACK_2D - track the movement of one or more particles using a
 second order finite difference approach (Bennett and Clites, 1987).

 Usage: [t, lon, lat] = particle_track_2nd( hfrc_obj, start_t, end_t, ...
                                            coords, max_dist, ... )

 This function moves particles along with the currents.  It uses the 2nd
 order algorithm of Bennett and Clites (1987) with a variable time step
 that is determined so that no particle moves more than max_dist per
 time step.  It assumes that velocities are in cm/s.

 hfrc_obj will be temporally sorted before tracking is done.

 coords is a 2 column array of longitudes and latitudes of the particles to
 be tracked.  If absent, hfrc.totalGrid is used. max_dist specifies what is
 the maximum distance to move in a time step.  If absent, 0.25 kms is used.
 start_t and end_t are the start and end times of the tracking.  If absent,
 the entire time series will be used.  start_t and end_t should be in
 matlab units.

 This routine will end before end_t if all particles have gone out of
 data region (produced NaN).

 Nothing is done to bad data in this routine.  0's will be treated like
 zeros, NaNs like NaNs.  
 
 The final ... represents extra arguments to griddata, such as 'method',
 to be used when interpolating values.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

     $Id: particle_track_2nd.m,v 1.5 2004-11-11 20:29:56 dmk Exp $    

 Copyright (C) 2003 David M. Kaplan
 Licence: GPL

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Mon 18-Dec-2006 07:26:46 by m2html © 2003