function DATA=data_pick(D_in,vdims)
%
%
% COPYRIGHT (c) 2008
% 
% Applied Research Laboratories, The University of Texas at Austin
% (ARL:UT)
% All rights reserved.
% 
% This material may be reproduced by or for the U.S. Government
% only. This notice must appear in all copies of this file and its
% derivatives. Further distribution outside the U.S. Government is
% prohibited without the explicit written authorization from the
% Director of the Environmental Sciences Laboratory, ARL:UT.
% 
% THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
% EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE
% IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
% PURPOSE, OR NONINFRINGEMENT.
% 
% IN NO EVENT WILL ARL:UT BE LIABLE FOR ANY DAMAGES WHATSOEVER ARISING
% OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN IF ARL:UT HAS
% BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
view_global;
if nargin<2, vdims=[]; end
%
nplot=0; iidone=0;
%
x_tot=[];
while ~iidone,
	figure(133); clf;
    if nplot==0,
    	[D,Vx]=view5(D_in,vdims,1,0);
    else
    	[D,Vx]=view5(D_in,vdims,1,0);
    end
	nplot=nplot+1;
	dim_meld=Vx.vdims(2);
	dim_fix=Vx.vdims(3);
	dim_elim=Vx.vdims(1);
	jfix{nplot}=Vx.KV{dim_fix};
    ax=axis; xlim=ax(1:2); ylim=ax(3:4);
	hold on;
	[x{nplot},y{nplot},npt{nplot}]=graph_input(V.size,xlim,ylim,[],[],-1,0,'k');
    if nplot==1, 
        vdims=Vx.vdims;
        npt_tot=npt{1};
    else
        npt_tot=npt_tot + npt{nplot};
    end
    x_tot=[x_tot, x{nplot}(:)'];
	if npt{nplot}==0, nplot=nplot-1; iidone=1; end
end
DATA.ndim=D_in.ndim-1;
DATA.labels([1:2])=D_in.labels([dim_meld,dim_fix]);
DATA.scales([1:2])=D_in.scales([dim_meld,dim_fix]);
DATA.scales{1}=x_tot;
DATA.dims=[length(DATA.scales{1}), length(DATA.scales{2})];
DATA.data=NaN*ones(DATA.dims);
DATA.dlab=D_in.dlab;
title=D_in.title; xx=findstr(title,'.');
if ~isempty(xx), title=title(1:xx(end-1)); end
DATA.title=[title,'_pick'];

j1=0;
for jplot=1:nplot,
    ii=j1+[1:npt{jplot}];
    DATA.data(ii,jfix{jplot})=y{jplot};
    j1=j1 + npt{jplot};
end
%
str=['save ',DATA.title,' DATA']; disp(str); eval(str);
view5(DATA);
