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
%%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
******************** ** renomme_cartes_narr(region,anneedebut,anneefin) ** ********************
function renomme_cartes_narr(region,anneedebut,anneefin) %fonction ecrite par stephane poirier %pour renommer les fichiers narr selon le format approprie % %cette fonction traitera tous les fichiers de la region %i.e.: renomme_cartes('canada', 2002, 2002); % %la validation sur les annees suppose que les donnees sont de %type SMMR/SSMI soit annees 1978 a 2006 yearmax=2008; if(strcmp(upper(region), 'CANADA')~=1) warning('region parameter is not valid'); return; end %if (anneedebut 2006) if (anneedebut yearmax) warning('anneedebut parameter is not valid'); return; end %if (anneefin 2006) if (anneefin yearmax) warning('anneefin parameter is not valid'); return; end if (anneedebut > anneefin) warning('anneedebut must be smaller or equal to anneefin'); return; end %cheminentree = 'D:\narr\ease\'; %cheminsortie = 'D:\narr\ease\'; cheminentree = 'G:\narr\ease\'; cheminsortie = 'G:\narr\ease\'; anneecourante = anneedebut; while(anneecourante<=anneefin) %1) pour chacun des annees (dossiers annees), trouver tous les fichiers chemincourant = [cheminentree, num2str(anneecourante)]; fichiers = dir(chemincourant); %files = dir(fullfile(directory,'*')); [nombredefichiers,nombredestructuresparfichiers] = size(fichiers); %1.1) assuming any number of subfolders could be present for n = 1:nombredefichiers if ~fichiers(n).isdir && ~strcmp(fichiers(n).name,'.') && ~strcmp(fichiers(n).name,'..') %les fichiers sont nescessairement des dossiers fichiercourant = fichiers(n).name; fichierentre = [chemincourant,'\',fichiercourant]; fichiersorti = [chemincourant,'\ease',fichiercourant]; if ~fichiers(n).isdir && fichiers(n).bytes== %160*240*8*4 %8 couches de temperatures specifiees par des float32 %ne rien faire pour les dossiers ou les fichiers vides movefile(fichierentre,fichiersorti); end %3) preparer compteur pour annee suivante anneecourante=anneecourante+1; end %fclose('all'); end