A wrapper around 'mrg_gofstat' code for use with MIKE DFS0 files INPUT Pred_fname Optional. A filename for a DFS0 file to act as the 'prediction' Obs_fname Optional. A filename for a DFS0 file to act as the 'observations' OUTPUT gofstat A MATLAB structure containing model comparision statistics, with the addition of Pred_fname and Obs_fname, the supplied files names used in the comparision. See doc mrg_gofstat for further information on the statistics returned. REQUIREMENTS Requires mrg_gofstat and mrg_read_DFS0 from the MRG toolbox DHI MIKE toolbox (tested with v. 20130222) AUTHORS Daniel Pritchard LICENCE Code distributed as part of the MRG toolbox from the Marine Research Group at Queens Univeristy Belfast (QUB) School of Planning Architecture and Civil Engineering (SPACE). Distributed under a creative commons CC BY-SA licence, retaining full copyright of the original authors. http://creativecommons.org/licenses/by-sa/3.0/ http://www.qub.ac.uk/space/ http://www.qub.ac.uk/research-centres/eerc/ DEVELOPMENT v 1.0 August 2013 First version. DP % Function Begin!
0001 function gofstat = mrg_dfs0_gofstat(Pred_fname, Obs_fname) 0002 % A wrapper around 'mrg_gofstat' code for use with MIKE DFS0 files 0003 % 0004 % INPUT 0005 % Pred_fname Optional. A filename for a DFS0 file to act as the 0006 % 'prediction' 0007 % Obs_fname Optional. A filename for a DFS0 file to act as the 0008 % 'observations' 0009 % 0010 % OUTPUT 0011 % gofstat A MATLAB structure containing model comparision statistics, 0012 % with the addition of Pred_fname and Obs_fname, the supplied 0013 % files names used in the comparision. 0014 % See doc mrg_gofstat for further information on the 0015 % statistics returned. 0016 % 0017 % REQUIREMENTS 0018 % Requires mrg_gofstat and mrg_read_DFS0 from the MRG toolbox 0019 % DHI MIKE toolbox (tested with v. 20130222) 0020 % 0021 % AUTHORS 0022 % Daniel Pritchard 0023 % 0024 % LICENCE 0025 % Code distributed as part of the MRG toolbox from the Marine Research 0026 % Group at Queens Univeristy Belfast (QUB) School of Planning 0027 % Architecture and Civil Engineering (SPACE). Distributed under a 0028 % creative commons CC BY-SA licence, retaining full copyright of the 0029 % original authors. 0030 % 0031 % http://creativecommons.org/licenses/by-sa/3.0/ 0032 % http://www.qub.ac.uk/space/ 0033 % http://www.qub.ac.uk/research-centres/eerc/ 0034 % 0035 % DEVELOPMENT 0036 % v 1.0 August 2013 0037 % First version. DP 0038 % 0039 %% Function Begin! 0040 0041 if ~exist('Pred_fname', 'var') 0042 [Pred_fname, Pred_path] = uigetfile('.dfs0','Select predictions'); 0043 Pred_fname = [Pred_path, Pred_fname]; 0044 end 0045 0046 if ~exist('Obs_fname', 'var') 0047 [Obs_fname, Obs_path] = uigetfile([Pred_path,'.dfs0'],['Select observations to compare against ', Pred_fname]); 0048 Obs_fname = [Obs_path, Obs_fname]; 0049 end 0050 0051 preds = mrg_read_dfs0(Pred_fname); 0052 obs = mrg_read_dfs0(Obs_fname); 0053 0054 if size(preds.items,1)~=size(obs.items,1) 0055 error('The files have a different number of items. For now, this is an error') 0056 end 0057 0058 gofstat = mrg_gofstat(preds.dData, obs.dData); 0059 0060 gofstat.Pred_fname = preds.Fullname; 0061 gofstat.Obs_fname = obs.Fullname; 0062 0063 0064 end