%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This script is used to preprocess the selected hazards from the EM-DAT % dataset (at country level) as reported in: % % Daniel Nohrstedt, Maurizio Mazzoleni, Charles F. Parker, and Giuliano Di % Baldassarre. Policy change after natural hazard % events, Nature Communication % % This script was prepared by Maurizio Mazzoleni % Uppsala University, 2020 % mail to: maurizio.mazzoleni@geo.uu.se % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%Filter specific hazards from the EM-DAT dataset if strcmp(Hazard{1},'All')==1 EM_DATA_1970_2018_Disaster=EM_DATA_1970_2018; else EM_DATA_1970_2018_Disaster1=num2cell(zeros(size(EM_DATA_1970_2018,1)-3,size(EM_DATA_1970_2018,2))); for i=2:size(EM_DATA_1970_2018,2) Boolean_hazard=zeros(size(EM_DATA_1970_2018{2,i},1),1); %%Find hazard events in the disaster type cell for gg=1:size(Hazard,2) for j=1:size(EM_DATA_1970_2018{2,i},1) if strcmp(EM_DATA_1970_2018{2,i}(j,1),Hazard{gg})==1 Boolean_hazard(j,1)=1; end end end [m,n]=find(Boolean_hazard==1); %%Extract only flood information for the different countries for y=1:size(EM_DATA_1970_2018,1)-2 for tt = 1:length(m) EM_DATA_1970_2018_Disaster1{y,i}(tt,1)=EM_DATA_1970_2018{y+2,i}(m(tt,1),1); end end end %%Concatenate information of the name of the country and type of indicator EM_DATA_1970_2018_Disaster=[EM_DATA_1970_2018(1:2,1:end);EM_DATA_1970_2018_Disaster1]; EM_DATA_1970_2018_Disaster(3:end,1)=EM_DATA_1970_2018(3:end,1); end