set(0,'DefaultTextInterpreter','none');

% MISMO rainrate for DYNAMO

zh_aa = 0.027366;
zh_bb = 0.69444;

% RATE_ZH = zh_aa * ( ZH^zh_bb), where ZH is the non-log
% reflectivity

rate_zh = [];

for ZZ=1:60;
    rate_zh(ZZ) = zh_aa * (( 10.0^(ZZ/10) )^zh_bb);
end;

figure;
plot( [ 30:numel(rate_zh)], rate_zh(30:numel(rate_zh)));
hold on;

% rate_e1zh = [];
% for ZZ=1:60;
%     rate_e1zh(ZZ) = zh_aa * (( 10.0^((ZZ-1.0)/10) )^zh_bb);
% end;

% plot( [ 30:numel(rate_e1zh)], rate_e1zh(30:numel(rate_e1zh)),'r');

hold off;

% zh_ratio = rate_zh./rate_e1zh;

% figure;
% plot( [30:70], zh_ratio(30:70));


dbz_err = [0:.2:5];

rain_err = [];

for ii=1:numel(dbz_err);
   rain_err(ii) = 100*( (10.^(dbz_err(ii)/10))^zh_bb -1 );
end;

figure;
plot(dbz_err,rain_err)

xlabel('dBZ difference, or error (dB)');
ylabel('Resulting Rain Rate Error (%)');
title('Radar Z-R Rain Rate Errors','FontWeight','bold', 'FontSize', 14);

