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
%%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
************************************************************* *** ***** mat=fecrire(matrice,nomfichier,directory,format) ***** ************************************************************* ***
function mat=fecrire(matrice,nomfichier,directory,format,jour,an) prevdir = pwd; if(~isdir(directory)) mkdir(directory); end % fichier_neige=fopen(['H:\Documents\snowcover\database\canada\ ',an,'\',jour]); % neige=fread(fichier_neige,[1 inf],'int8'); % neige=reshape(neige,160,240); %matrice=matrice.*neige; % Création d'un masque pour les zones où il n'y a pas de données (ces zones % doivent avoir une valeur de -100 Celsius sur l'image finale) swath_mask=find(matrice==0); matrice(swath_mask)=173.16; % Création d'un masque pour les frontières (ces zones doivent avoir une % valeur de 100 Celsius sur l'image finale) frontieres=masque(2,2); matrice=matrice.*frontieres; frontieres_mask=find(matrice==0); matrice(frontieres_mask)=373.16; % Transformation des températures en Celsius (0 Celsius = Kelvin selon NSIDC) kelvins=ones(160,240); kelvins=kelvins.*273.16; matrice=matrice-kelvins; matrice(find(matrice<-100))=-100; cd(directory) if nargin==3 format='float32'; end fid=fopen(nomfichier,'w'); m=fwrite(fid,matrice,format); st=fclose(fid); %cd /Documents/Calcul_Ts cd(prevdir);