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

reverse_particle_track_2nd_largeGrid

PURPOSE ^

REVERSE_PARTICLE_TRACK_2ND_LARGEGRID - uses particle_track_2nd_largeGrid in reverse to find

SYNOPSIS ^

function [ res, paths ] = reverse_particle_track_2nd_largeGrid( h, end_ts, start_ts,dest, radius, varargin )

DESCRIPTION ^

 REVERSE_PARTICLE_TRACK_2ND_LARGEGRID - uses particle_track_2nd_largeGrid in reverse to find
 out where things came from.

 Usage: [ start_info, paths] = reverse_particle_track_2nd_largeGrid( hfrc_obj, ...
                                 end_ts, start_ts, ...
                                 destinations, radius, search_coords, ...
                                 max_dist, circle_radius, ... )

 This function looks for where particles located at destinations (two
 columns, lon & lat) at times end_ts came from at various times in the
 past given in start_ts.  This is determined by computing forward
 particle tracks at the times in start_ts from the points given in
 search_coords and including all particles that end up within a distance
 radius of the destinations.

 all start_ts must be less than all end_ts.

 max_dist, circle_radius, radius, and search_coords are optional.  max_dist
 and circle_radius will inherit their defaults from
 particle_track_2nd_largeGrid, radius defaults to 1 and search_coords
 defaults to hfrc_obj.totalGrid.

 The final ... is for extra arguments to particle_track_2nd_largeGrid.  See this
 function for more details.

 If a second output argument is given, then the paths that each particle
 took will be returned in this argument.  Both output arguments are
 structure arrays with length(start_ts) elements.  Inside, there are a
 number of substructure arrays with size(destinations,1) elements that
 contain the information about particles that ended up at that particle
 destination. 

 The results returned by this function can be rather difficult to
 understand.  start_info is a structure array with the same number of
 elements as start_ts.  For each start time and end time combination, a
 structure is created containing another structure, coords, that has the
 same size as destinations.  Inside coords are the start and end pts for
 each path that got sufficiently close to destinations.  As an example, say
 you want to know the starting point of all particles that started at the
 second starting time, ended at the third end time and ended up close to
 the fifth destination:

            start_pts(2,3).coords(5).start_lon
            start_pts(2,3).coords(5).start_lat

 paths is similar.  For the paths taken by the above mentioned
 particles, you would do:

            paths(2,3).path(5).start_lon
            paths(2,3).path(5).start_lat

 Finally, note that this function can only look for particles that
 arrived at your destinations that were inside the data area during the
 entire period of there travel.  This misses particles that started
 outside and particles that were inside but went out at some point and
 would have returned if you had data.

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

     $Id: reverse_particle_track_2nd_largeGrid.m,v 1.5 2004-11-17 02:51:31 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