La présentation est en train de télécharger. S'il vous plaît, attendez

La présentation est en train de télécharger. S'il vous plaît, attendez

Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%

Présentations similaires


Présentation au sujet: "Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%"— Transcription de la présentation:

1 Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%

2

3

4 %nakedsoftware.org opensource license, copyright 2010 stephane.poirier@oifii.org % %developed by Stephane Poirier, M.Sc. Optical Physics, Remote Sensing Application Software Developer (1991-2010) % %this function is part of oifii.org's ar\sp\ Microwave- derived 30-year Canada-Alaska Daily Temperature and Snowcover Databases library % %this function is part of oifii.org's ar\sp\'this folder' application (lauched with ar\sp\'this file'.m) %oifii.org's ar\sp\affiche_carte application is part of the oifii.org's ar\sp set of applications which %may also contain similar variant versions of this function with identical filename. % %A geophysical research paper about this work has been submitted in June 2009 for publication in JGR-Atmosphere %Royer, A. and Poirier S., Surface temperature spatial and temporal variations in North America from homogenized %satellite SMMR-SSM/I microwave measurements and reanalysis for 1979-2008, Journal of Geophysical Research - Atmosphere, %Submitted June 2009, http://www.oifii.org/tsatdb/Royer- Poirier_Microwave-derived-daily-surface- temperature_JGR2009JD012760_R2.pdf % %This study's database can be downloaded from the author web site at: %http://www.oifii.org/tsatdb/Royer-Poirier_Microwave-derived- daily-surface-temperature-db_1979-2008.zip % %this function is used to display the raw microwave raster data (NSIDC's SMMR and SSMI satellite, ref. nsidc.org) % %usage: % 20yymmmdd % %version 0.0, 20yymmmdd, spi, initial function draft % %nakedsoftware.org opensource license, copyright 2010 stephane.poirier@oifii.org

5 %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%

6

7 %affiche_carte_diff(chemin1,nomfichier1,chemin2,nomfichier2,x _offset,y_offset,naffiche) function affiche_carte_diff(chemin1,nomfichier1,chemin2,nomfichier2,x_ offset,y_offset,naffiche,ndemimoniteur) if nargin<1 disp('affiche_carte_diff(''chemin1'',''nomfichier1'',''chemin 2'',''nomfichier2'',x_offset=0,y_offset=0,naffiche=- 1,ndemimoniteur=-1)'); return; end %heures = [' 0h00';' 6h00';'12h00';'18h00']; %heures des estimes de temperature du modele era40 heures = [' 0h00';' 3h00';' 6h00';' 9h00';'12h00';'15h00';'18h00';'21h00']; %heures des estimes de temperature du modele narr heure = cellstr(heures); if nargin<8 ndemimoniteur=-1; end %ndemimoniteur=-1 pour afficher dans la premiere moitie du moniteur primaire if nargin<7 naffiche=-1; end %naffiche=-1 selectionne toute les couches if nargin<6 y_offset=0; end if nargin<5 x_offset=0; end if nargin<4 nomfichier2=nomfichier1; end if nargin<3 disp('case not supported'); return; end %d1,d2,f et dd1,dd2,ff [d1 d2 format1] = autodimformat(chemin1,nomfichier1); [dd1 dd2 format2] = autodimformat(chemin2,nomfichier2); if d1~=dd1 || d2~=dd2 disp('cannot compare files of different dimensions'); return; end if ~strcmp(format1,format2) %diff era40 against narr if strcmp(format1,'4*float32')&& strcmp(format2,'8*float32') %chemin1,nomfichier1 est le fichier donnees era40 %chemin2,nomfichier2 est le fichier donnees narr elseif strcmp(format1,'8*float32')&& strcmp(format2,'4*float32') %chemin1,nomfichier1 est le fichier donnees narr %chemin2,nomfichier2 est le fichier donnees era40 disp('era40 path and filename must preceed narr path and filename'); return; %diff ts-norm against ts-moy elseif strcmp(format1,'4*float32')&& strcmp(format2,'24*float32') %chemin1,nomfichier1 est un fichier donnees ts-norm aux 6hrs %chemin2,nomfichier2 est le fichier donnees ts-moy aux 1hrs elseif strcmp(format1,'24*float32')&& strcmp(format2,'4*float32') %chemin1,nomfichier1 est le fichier donnees ts-moy aux 1hrs %chemin2,nomfichier2 est un fichier donnees ts-norm aux 6hrs disp('ts-norm 6hrs path and filename must preceed ts- moy 1hrs path and filename'); return; elseif strcmp(format1,'8*float32')&& strcmp(format2,'24*float32') %chemin1,nomfichier1 est un fichier donnees ts-norm aux 3hrs %chemin2,nomfichier2 est le fichier donnees ts-moy aux 1hrs elseif strcmp(format1,'24*float32')&& strcmp(format2,'8*float32') %chemin1,nomfichier1 est le fichier donnees ts-moy aux 1hrs %chemin2,nomfichier2 est un fichier donnees ts-norm aux 3hrs disp('ts-norm 3hrs path and filename must preceed ts- moy 1hrs path and filename'); return; else disp('cannot compare files of different formats'); return; end dim=[d1 d2]; %dim=[dd1 dd2] aussi %combiner chemin et nomfichier cheminnomfichier1=fullfile(chemin1,nomfichier1); fid=fopen(cheminnomfichier1, 'r'); if(fid~=-1) matrice1=fread(fid,[1 inf],format1); %fread(fid,[dim(1,1) dim(1,2)],format); fclose(fid); if ~isempty(strfind(format1, '*')) %i.e. if format=='4*float32', get the standard format multiplyfing %factor, in the herein example that would be the 4 n1 = str2num(strtok(format1, '*')); matrice1=reshape(matrice1,dim(1,1),dim(1,2),n1); else matrice1=reshape(matrice1,dim(1,1),dim(1,2)); end %combiner chemin et nomfichier cheminnomfichier2=fullfile(chemin2,nomfichier2); prevfid=fid; fid=fopen(cheminnomfichier2, 'r'); if(fid~=-1) matrice2=fread(fid,[1 inf],format2); fclose(fid); if ~isempty(strfind(format2, '*')) %i.e. if format=='4*float32', get the standard format multiplyfing %factor, in the herein example that would be the 4 n2 = str2num(strtok(format2, '*')); matrice2=reshape(matrice2,dim(1,1),dim(1,2),n2); else matrice2=reshape(matrice2,dim(1,1),dim(1,2)); end matrice2 = circshift(matrice2, [x_offset, y_offset]); if strcmp(format1,format2) %in case of problems with NaN, set NaN to some non- NaN value %indices=find(matrice1==NaN);if(~isempty(indices)) matrice1(indices)=-10; end %indices=find(matrice2==NaN);if(~isempty(indices)) matrice2(indices)=-10; end matrice = matrice1-matrice2; elseif strcmp(format1,'4*float32') && strcmp(format2,'8*float32') matrice(:,:,1) = matrice1(:,:,1)-matrice2(:,:,1); %00h matrice(:,:,2) = matrice1(:,:,2)-matrice2(:,:,3); %06h matrice(:,:,3) = matrice1(:,:,3)-matrice2(:,:,5); %12h matrice(:,:,4) = matrice1(:,:,4)-matrice2(:,:,7); %18h elseif strcmp(format1,'4*float32') && strcmp(format2,'24*float32') matrice(:,:,1) = matrice1(:,:,1)-matrice2(:,:,1); %00h matrice(:,:,2) = matrice1(:,:,2)-matrice2(:,:,7); %06h matrice(:,:,3) = matrice1(:,:,3)-matrice2(:,:,13); %12h matrice(:,:,4) = matrice1(:,:,4)-matrice2(:,:,19); %18h elseif strcmp(format1,'8*float32') && strcmp(format2,'24*float32') matrice(:,:,1) = matrice1(:,:,1)-matrice2(:,:,1); %00h matrice(:,:,2) = matrice1(:,:,2)-matrice2(:,:,4); %03h matrice(:,:,3) = matrice1(:,:,3)-matrice2(:,:,7); %06h matrice(:,:,4) = matrice1(:,:,4)-matrice2(:,:,10); %09h matrice(:,:,5) = matrice1(:,:,5)-matrice2(:,:,13); %12h matrice(:,:,6) = matrice1(:,:,6)-matrice2(:,:,16); %15h matrice(:,:,7) = matrice1(:,:,7)-matrice2(:,:,19); %18h matrice(:,:,8) = matrice1(:,:,8)-matrice2(:,:,22); %21h else warning('case not supported'); end else %fid==-1 disp('cannot open second file'); return; end if(~(prevfid==-1 || fid==-1)) if ~isempty(strfind(format1, '*')) %valider naffiche if naffiche~=-1 if naffiche==0 warning('case not supported'); end if naffiche 0 if naffiche~=0.5 && naffiche~=0.25 && naffiche~=0.125 warning('case not supported'); end end if naffiche>=1 if naffiche>n1 warning('naffiche cannot be greater than the number of layers in the first file'); naffiche=n1; end %afficher n figures for i=1:n1 %filtrer avec naffiche (aucun filtrage si naffiche=-1) if naffiche>=1 && naffiche~=i continue; end %skips all layers but the one selected with naffiche if naffiche 0 if mod(i-1,1/naffiche)~=0 continue; end end %affichage de la nieme figure figure; cmap = colormap; imagesc(rot90(matrice(:,:,i)')); colorbar; if(n1==4) title(strcat(nomfichier1,' - ',nomfichier2,' : ',heure(i*2-1)), 'Interpreter','none', 'Color','b'); elseif(n1==8) title(strcat(nomfichier1,' - ',nomfichier2,' : ',heure(i)), 'Interpreter','none', 'Color','b'); elseif(n1==24) hrs_str = sprintf('%2d',i-1); title(strcat(nomfichier1,' - ',nomfichier2,' : ',hrs_str,'h00'), 'Interpreter','none', 'Color','b'); else warning('case not supported'); end drawnow; end else figure; cmap = colormap; imagesc(rot90(matrice')); colorbar; title([nomfichier1,'-',nomfichier2], 'Interpreter','none', 'Color','b'); drawnow; end clear fid nomfichier1 nomfichier2 matrice1 matrice2 matrice cmap; fclose('all'); clear all; end


Télécharger ppt "Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%"

Présentations similaires


Annonces Google