function stochast = createStochastVar_2stp(varargin)
%CREATESTOCHASTVAR_2STP  create stochast variable based on 2 HBC points
%
%   function to create a stochast variable, suitable for the OpenEarth
%   probabilistic routines, based on 2 Hydraulic Boundary condition points
%
%   Syntax:
%   stochast = createStochastVar_2stp(varargin)
%
%   Input:
%   varargin =
%
%   Output:
%   stochast =
%
%   Example
%   createStochastVar_2stp
%
%   See also 

%% Copyright notice
%   --------------------------------------------------------------------
%   Copyright (C) 2010 Delft University of Technology
%       Kees den Heijer
%
%       C.denHeijer@TUDelft.nl	
%
%       Faculty of Civil Engineering and Geosciences
%       P.O. Box 5048
%       2600 GA Delft
%       The Netherlands
%
%   This library is free software: you can redistribute it and/or
%   modify it under the terms of the GNU Lesser General Public
%   License as published by the Free Software Foundation, either
%   version 2.1 of the License, or (at your option) any later version.
%
%   This library is distributed in the hope that it will be useful,
%   but WITHOUT ANY WARRANTY; without even the implied warranty of
%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
%   Lesser General Public License for more details.
%
%   You should have received a copy of the GNU Lesser General Public
%   License along with this library. If not, see <http://www.gnu.org/licenses/>.
%   --------------------------------------------------------------------

% This tool is part of <a href="http://OpenEarth.nl">OpenEarthTools</a>.
% OpenEarthTools is an online collaboration to share and manage data and 
% programming tools in an open source, version controlled environment.
% Sign up to recieve regular updates of this function, and to contribute 
% your own tools.

%% Version <http://svnbook.red-bean.com/en/1.5/svn.advanced.props.special.keywords.html>
% Created: 26 Oct 2010
% Created with Matlab version: 7.10.0.499 (R2010a)

% $Id$
% $Date$
% $Author$
% $Revision$
% $HeadURL$
% $Keywords: $

%%
OPT = struct(...
    'station', '',...
    'lambda', 1,...
    'D50', [225e-6 225e-7]);

OPT = setproperty(OPT, varargin{:});

WL_tParams = getWLparams(OPT.station{1,:});
Hsig_tParams = getBCparams(OPT.station{1,:}, 'WL', 'Hsig');
Tp_tParams = getBCparams(OPT.station{1,:}, 'Hsig', 'Tp');

%%
stochast = struct(...
    'Name', {
        'Accuracy'...
        'D50'...
        'Duration'...
        'WL_t'...
        'Hsig_t'...
        'Tp_t'...
        },...
    'Distr', {
        @deterministic...
        @norm_inv...
        @norm_inv...
        @conditionalWeibull...
        @getHsig_t_2stp...
        @getHsig_t_2stp...
        },...
    'Params', {
        {0}...
        mat2cell(OPT.D50, 1, [1 1])...
        {0 .1}...
        {WL_tParams{:} OPT.lambda}...
        {'WL_t'...
            Hsig_tParams{:}...
            OPT.lambda... % lambda
            0.6 0.6}... % sigma1 sigma2
        {'Hsig_t'...
            Tp_tParams{:}...
            OPT.lambda... % lambda
            1 1}... % sigma1 sigma2
        },...
    'propertyName', {
        true...
        true...
        true...
        true...
        true...
        true...
        }...
    );