Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
%nakedsoftware.org opensource license, copyright 2010 % %developed by Stephane Poirier, M.Sc. Optical Physics, Remote Sensing Application Software Developer ( ) % %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 , Journal of Geophysical Research - Atmosphere, %Submitted June 2009, Poirier_Microwave-derived-daily-surface- temperature_JGR2009JD012760_R2.pdf % %This study's database can be downloaded from the author web site at: % daily-surface-temperature-db_ 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
%%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
fct qui simule par spline cubique les donnees ERA40 les temperatures ERA 40 sont aux 6 heures : 0h00, 6h00, 12h00, 18h00
% simule les variations pour obtenir une variation aux heures function [tera,heure] = genere_Tera25kmx25kmx1h(an,jour1,jour2,zone); prevdir = pwd; % INPUT % an : entier du type aaaa % jour1 et jour2 : entier (jour de l'année : entre 1 et 365) % zone : 'canada' ; 'russie'; 'tibet' % FCT ASSOCIEES % - [temperature,day,hour] = lire_Tera25kmx25kmx6h(zone,an,jour1,jour2,EXT) ; % temperature : nbre de ligne x nbre de colonne (dim de la zone selectionnee) % x nbre de pas de temps % optiongraphe = 1 : trace la serie ERA simulée % 2 : ne trace pas la serie optiongraphe = 2 ; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%% % simulation a partir des donnees ERA40 air, hauteresolution disp('ERA utilisees : ERA40 air haute resolution'); [temperature,day,hour] = lire_Tera25kmx25kmx6h(zone,an,jour1,jour2,'air'); heureref = hour(1,1); %nombre de jours (jour2-jour1+1) multiplie par nombre d'heures par jour (24) %moins 6 (moins 6 heures, parce que derniere valeure dernier jour a 18h00) %plus 1 (? pour l'inclure, utilisation de derheure ci-dessous pas claire). derniereheure = (jour2-jour1)*24+1+hour(length(hour),1); %derniere heure % test si on a bien plusieurs canaux horaires differents if hour(2,1)==heureref disp('pour simulation, on doit avoir differents creneaux horaires par jour'); return, end dimension = 24 * (jour2-jour1+1); heure(1:6:dimension) = hour; heure(2:6:dimension) = 1 + heure(1:6:dimension); heure(3:6:dimension) = 2 + heure(1:6:dimension); heure(4:6:dimension) = 3 + heure(1:6:dimension); heure(5:6:dimension) = 4 + heure(1:6:dimension); heure(6:6:dimension) = 5 + heure(1:6:dimension); t = temperature; clear temperature; %whos % % % INTERPOLATION % % % if (ndims(t)==3 && (size(t,1)==1 || size(t,2)==1 || size(t,3)==1) ) %matrice de temperature 3 dimensions, avec une des trois dimensions egale a un t = squeeze(t); %reduire la matrice a deux dimensions t=t'; disp('a') pp = spline([1:6:dimension],t); tera = ppval(pp,[1:(dimension-(24-derniereheure-1))]); elseif size(t,1)~=1 & size(t,2)==1 t=t'; disp('b') pp = spline([1:6:dimension],t); tera = ppval(pp,[1:(dimension-(24-derniereheure-1))]); elseif size(t,1)==1 & size(t,2)~=1 derniereheure disp('c') pp = spline([1:6:dimension],t); tera = ppval(pp,[1:(dimension-(24-derniereheure-1))]); elseif (ndims(t)==3 & size(t,1)~=1 & size(t,2)~=1 & size(t,3)~=1) if strcmp(zone,'canada')==1 dim = [ ] ; disp('d1') m=mask(2,2); elseif strcmp(zone,'russie')==1 disp('d2') dim = [ ] ; m=mask(7,2); elseif strcmp(zone,'tibet')==1 disp('d3') dim = [90 180]; end indice = find(m==1); t = reshape(t,dim(1,1)*dim(1,2),size(hour,1)); t = t(indice,:); tinterp = interp1([1:6:length(heure)],t',[1:length(heure)],'spline'); tinterp = tinterp'; tera(1:dim(1,1)*dim(1,2),length(heure)) = NaN; tera(indice,:) = tinterp; tera = reshape(tera,dim(1,1),dim(1,2),length(heure)); tera (:,:,derniereheure+1:size(tera,3)) = NaN; end % % % NOTE SUR LES BORNES DE LA SIMULATION : lim sup = % dimension-(24-derniereheure+-1) % soit jusqu'a la derniere heure ERA disponible. % % % % GRAPHE % % % if optiongraphe == 1 % etiquette etiquette = []; etiquette1 = []; etiquette2 = []; etiquette1 = num2str(day); etiquette2 = num2str(hour); etiquette = strcat(etiquette1,'_',etiquette2); figure;plot([1:6:length(t)*6],t,'+r',[1:length(tera)],tera,'- ob'); set(gca,'XLim',[1 dimension]); xlabelrot90([1:24:dimension],day(1:4:length(day))',0); end % fin de condition optiongraphe cd(prevdir);