ST_d2phi.m 804 Bytes
Newer Older
Pierre Cazenave's avatar
Pierre Cazenave committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
function [phi] = ST_d2phi(d)
% Convert sediment diameter (m) to phi 
%
% function [phi] = ST_d2phi(d)
%
% DESCRIPTION:
%    Convert a sediment grain size in m to phi 
%
% INPUT:
%    d: sediment grain size in m
%
% OUTPUT:
%    phi: sediment grain size in phi scale
%
% EXAMPLE USAGE
%    phi = ST_d2phi(.001)
%
% Author(s):  
%    Geoff Cowles (University of Massachusetts Dartmouth)
%
% Revision history
%   
%==============================================================================

%subname = 'ST_d2phi';  
%fprintf('\n')
%fprintf(['begin : ' subname '\n'])

%------------------------------------------------------------------------------
% calculate phi 
%------------------------------------------------------------------------------
phi = -log2(d*1000);

%fprintf(['end   : ' subname '\n'])