  function [data, auxData, metaData, txtData, weights] = mydata_Valencia_hispanica
%% set metadata
metaData.phylum     = 'Chordata'; 
metaData.class      = 'Actinopterygii'; 
metaData.order      = 'Cyprinodontiformes'; 
metaData.family     = 'Valenciidae';
metaData.species    = 'Valencia_hispanica'; 
metaData.species_en = 'Valencia toothcarp'; 

metaData.ecoCode.climate = {'BSk'};
metaData.ecoCode.ecozone = {'THp'};
metaData.ecoCode.habitat = {'0iFp'};
metaData.ecoCode.embryo  = {'Fnm'};
metaData.ecoCode.migrate = {};
metaData.ecoCode.food    = {'biCi'};
metaData.ecoCode.gender  = {'D'};
metaData.ecoCode.reprod  = {'O'};

metaData.T_typical  = C2K(20); % K, body temp
metaData.data_0     = {'am';  'Lp'; 'Li'; 'Wwb'; 'Wwp'; 'Wwi'; 'Ri'; 'dLb'};  
metaData.data_1     = {'t-L'}; 

metaData.COMPLETE = 2.5; % using criteria of LikaKear2011

metaData.author    = {'Bas Kooijman'};                             
metaData.date_subm = [2020 08 11];                          
metaData.email     = {'bas.kooijman@vu.nl'};                 
metaData.address   = {'VU Univ. Amsterdam'};      

metaData.author_mod_1   = {'Bas Kooijman'};    
metaData.date_mod_1     = [2023 04 06];              
metaData.email_mod_1    = {'bas.kooijman@vu.nl'};            
metaData.address_mod_1  = {'VU University, Amsterdam'};   

metaData.curator     = {'Starrlight Augustine'};
metaData.email_cur   = {'starrlight@tecnico.ulisboa.pt'}; 
metaData.date_acc    = [2023 04 06];

%% set data
% zero-variate data
data.am = 5*365;        units.am = 'd';  label.am = 'maximum life span';        bibkey.am = 'CaioVerg2001';
  temp.am = C2K(20); units.temp.am = 'K'; label.temp.am = 'temperature';

data.Lp = 3.9;     units.Lp = 'cm';     label.Lp = 'standard length at puberty';  bibkey.Lp = 'CaioVerg2001';
  comment.Lp = 'based on the remark that no 0+ fish was mature';
data.Li = 8;     units.Li = 'cm';     label.Li = 'ultimate standard length';  bibkey.Li = 'fishbase';

data.Wwb = 2.1e-3;  units.Wwb = 'g'; label.Wwb = 'wet weight at birth'; bibkey.Wwb = 'CaioVerg2001';   
  comment.Wwb = 'based on egg diameter of 1.6 mm: pi/6*0.16^3';
data.Wwp = 0.70; units.Wwp = 'g';  label.Wwp = 'wet weight at pubert';   bibkey.Wwp = {'fishbase','CaioVerg2001'};
  comment.Wwp = 'based on 0.01122*Lp^3.04, see F1';
data.Wwi = 6.24; units.Wwi = 'g';  label.Wwi = 'ultimate wet weight';   bibkey.Wwi = 'fishbase';
  comment.Wwi = 'based on 0.01122*Li^3.04, see F1';

data.Ri = 300/365;       units.Ri = '#/d';  label.Ri = 'maximum reprod rate';  bibkey.Ri = 'fishbase';   
  temp.Ri = C2K(20); units.temp.Ri = 'K'; label.temp.Ri = 'temperature'; 

% univariate data
% time-length
data.tL_f = [ ... % age class (yr), total length (cm)
    0 3.850
    1 4.678
    2 5.177
    3 6.000
    4 6.350];
data.tL_f(:,1) = 365 * (1.3 + data.tL_f(:,1)); % convert yr to d
units.tL_f = {'d', 'cm'}; label.tL_f = {'time since birth', 'total length', 'female'};  
temp.tL_f = C2K(20);  units.temp.tL_f = 'K'; label.temp.tL_f = 'temperature';
bibkey.tL_f = 'CaioVerg2001';
comment.tL_f = 'Data for females';
%
data.tL_m = [ ... % age class (yr), total length (cm)
    0 3.525
    1 4.176
    2 4.657
    3 5.082];
data.tL_m(:,1) = 365 * (1.3 + data.tL_m(:,1)); % convert yr to d
units.tL_m = {'d', 'cm'}; label.tL_m = {'time since birth', 'total length', 'male'};  
temp.tL_m = C2K(16);  units.temp.tL_m = 'K'; label.temp.tL_m = 'temperature';
bibkey.tL_m = 'CaioVerg2001';
comment.tL_m = 'Data for males';

%% set weights for all real data
weights = setweights(data, []);
weights.tL_f = 50 * weights.tL_f;
weights.tL_m = 50 * weights.tL_m;

%% set pseudodata and respective weights
[data, units, label, weights] = addpseudodata(data, units, label, weights);
weights.psd.v = 5 * weights.psd.v;

%% pack auxData and txtData for output
auxData.temp = temp;
txtData.units = units;
txtData.label = label;
txtData.bibkey = bibkey;
txtData.comment = comment;
 
%% Group plots
set1 = {'tL_f','tL_m'}; subtitle1 = {'Data for females, males'};
metaData.grp.sets = {set1};
metaData.grp.subtitle = {subtitle1};

%% Discussion points
D1 = 'temperature in tL data variet from 11.3 C (Dec) to 28.5 C (Aug)';
D2 = 'males are supposed to differ from females by {p_Am} only';
D3 = 'mod_1: males have equal state variables at b, compared to females';
metaData.discussion = struct('D1',D1, 'D2',D2, 'D3',D3);

%% Facts
F1 = 'weight length relationship: Ww in g = 0.01122 * (TL in cm)^3.04';  
  metaData.bibkey.F1 = 'fishbase';
metaData.facts = struct('F1',F1);

%% Links
metaData.links.id_CoL = '7F9RF'; % Cat of Life
metaData.links.id_ITIS = '165792'; % ITIS
metaData.links.id_EoL = '994520'; % Ency of Life
metaData.links.id_Wiki = 'Valencia_hispanica'; % Wikipedia
metaData.links.id_ADW = 'Valencia_hispanica'; % ADW
metaData.links.id_Taxo = '44554'; % Taxonomicon
metaData.links.id_WoRMS = '1022014'; % WoRMS
metaData.links.id_fishbase = 'Valencia-hispanica'; % fishbase


%% References
bibkey = 'Wiki'; type = 'Misc'; bib = ...
'howpublished = {\url{https://en.wikipedia.org/wiki/Valencia_hispanica}}';
metaData.biblist.(bibkey) = ['''@', type, '{', bibkey, ', ' bib, '}'';'];
% 
bibkey = 'fishbase'; type = 'Misc'; bib = ...
'howpublished = {\url{https://www.fishbase.se/summary/Valencia-hispanica.html}}';
metaData.biblist.(bibkey) = ['''@', type, '{', bibkey, ', ' bib, '}'';'];
%
bibkey = 'Kooy2010'; type = 'Book'; bib = [ ...  % used in setting of chemical parameters and pseudodata
'author = {Kooijman, S.A.L.M.}, ' ...
'year = {2010}, ' ...
'title  = {Dynamic Energy Budget theory for metabolic organisation}, ' ...
'publisher = {Cambridge Univ. Press, Cambridge}, ' ...
'pages = {Table 4.2 (page 150), 8.1 (page 300)}, ' ...
'howpublished = {\url{../../../bib/Kooy2010.html}}'];
metaData.biblist.(bibkey) = ['''@', type, '{', bibkey, ', ' bib, '}'';'];
%
bibkey = 'CaioVerg2001'; type = 'Article'; bib = [ ...
'author = {Nuno Alberto Caiola and Maria Josep Vargas and Aldolfo de Sostoa}, ' ...
'year = {2001}, ' ...
'title = {Life history pattern of the endangered {V}alencia toothcarp, \emph{Valencia hispanica} ({A}ctinopterygii: {V}alenciidae) and its implications for conservation}}, ' ...
'journal = {Arch. Hydrobiol}, ' ...
'volume = {150(3)}, '...
'pages = {473-489}'];
metaData.biblist.(bibkey) = ['''@', type, '{', bibkey, ', ' bib, '}'';'];

