Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%"— Presentation transcript:

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 %version 0.4: 2009sept21, spi, stephane poirier, modif. d:\ for k:\d-, c:\ for k:\c- and g:\ for k:\g- %version 0.3: lireTnarrmoyen(path_tsmoy,jd_start,jd_end,display,x_pixel,y_p ixel) ajout des vecteurs de coordonnees display x_pixel y_pixel %version 0.1, adaptation de lireTSmoy.m du dossier C:\mw\am- mt\work-programmes %version 0.1, adaptation de lireTSmoy(zone,an,phase,jour1,jour2) applicable %version 0.1, au ts-moy journaliers prealablement calcules. cette fonction %version 0.1, lis les ts-moy journaliers d'une series de jours juliens et %version 0.1, retourne la moyenne temporelle % %parametre path_tsmoy peut etre un des suivants: % %D:\narr_moy\ease\160x240\Canada\2002 %G:\narr_moy\ease\160x240\Canada\1979 function TS=lireTnarrmoyen(path_tsmoy,jd_start,jd_end,display,x_pixel, y_pixel); if nargin<6 y_pixel=[]; end %y display coordinate vector, defaults to empty if nargin<5 x_pixel=[]; end %x display coordinate vector, defaults to empty if nargin<4 display=0; end if nargin<3 disp('lireTnarrmoyen(''k:\g- narr_moy\ease\160x240\Canada\1979'',jd_start,jd_end,0)'); disp('lireTnarrmoyen(''k:\g- narr_moy\ease\160x240\Canada\1979'',jd_start,jd_end,0,[1 120 240],[1 80 160])'); return; end if exist(path_tsmoy,'file')==0 disp('lireTnarrmoyen: path_tsmoy invalide'); return; end if(~isempty(strfind(path_tsmoy,'160x240'))&&isempty(strfind(p ath_tsmoy,'281x281'))&&isempty(strfind(path_tsmoy,'721x721')) &&isempty(strfind(path_tsmoy,'tibet'))&&isempty(strfind(path_ tsmoy,'russie'))) dim=[160 240]; %eventually use [dim1,dim2,format]=autodimformat(chemin,nomfichier); region='canada'; format='float32'; else disp(['lireTnarrmoyen: ','281x281',', ','721x721',', ','tibet','and ','russie','image data not supported']); return; end if(isempty(x_pixel)&&isempty(y_pixel)) %load the whole image file m=mask(2,2); TS=[]; for i_jd=jd_start:jd_end filename=['ease',sprintf('%03d',i_jd)]; pathfilename=fullfile(path_tsmoy,filename); if exist(pathfilename,'file')~=0 fid=fopen(pathfilename,'r'); matrice=fread(fid,dim,'float32'); fclose(fid); clear fid; %assuming data in kelvin %assuming mask saved as zeros %assuming uncomputed values saved as zeros matrice(matrice==-100)=NaN; matrice(matrice==-20)=NaN; matrice(matrice==-10)=NaN; matrice(matrice==0)=NaN; TS=cat(3,TS,matrice); else disp(['lireTnarrmoyen: file ',pathfilename,' notfound']); end TS=permute(TS,[3 1 2]); TS=nanmoy(TS); TS=permute(TS,[2 3 1]); %TS(isnan(TS))=0; %leave NaN to NaN if any TS(m==0)=0; if display==1 figure;imagesc(rot90(TS'));axis;colorbar; end elseif(~isempty(x_pixel)&&~isempty(y_pixel)) %load only pixels of interest using x_pixel and y_pixel vectors in display coordinates if(max(size(x_pixel))~=max(size(y_pixel))) disp('x_pixel vector and y_pixel vector must be the same size'); return; end for i_jd=jd_start:jd_end TS_stations=[]; for ij=1:max(size(x_pixel)) filename=['ease',sprintf('%03d',i_jd)]; pathfilename=fullfile(path_tsmoy,filename); if exist(pathfilename,'file')~=0 fid=fopen(pathfilename,'r'); [x_pix,y_pix]=pixel2pix(x_pixel(ij),y_pixel(ij),region); fpo_inbytes=pix2fpo(x_pix,y_pix,dim(1,1),dim(1,2),format,regi on); status = fseek(fid,fpo_inbytes,'bof'); %3) lecture du pixel temp=fread(fid,1,'float32'); fclose(fid); if(temp==-100)temp=NaN; end if(temp==-20)temp=NaN; end if(temp==-10)temp=NaN; end if(temp==0)temp=NaN; end TS_stations=cat(2,TS_stations,temp); end TS=cat(1,TS,TS_stations); end else disp('case not supported'); end%if/elseif end %function


Download ppt "Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%"

Similar presentations


Ads by Google