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\mappathname application (lauched with ar\sp\mappathname.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 for mapping pathnames and filenames of the oifii.org's ar\sp\ library to the physical parameters %of the raw microwave raster data (from NSIDC's SMMR and SSMI satellite data, ref. % %revision: 15 novembre 2007, not tested since november 13 revision (see mappathname.m) %revision: 14 novembre 2007, adapting for generalized dataset (to support values between 0 and 90) %revision: 13 novembre 2007, adding ampm as an extra output parameter %note spi: begin %note spi: modification 20 aout 2007 %note spi: modification sur version alexandre roy, pour supporter AMSR-E, ajout d'un cas special, soit dataset==3 %ID2r3-AMSRE-NL A.v01.TIM.gz %ID2r3-AMSRE-NL A.v02.TIM.gz %note spi: pour AMSR-E, le cas dataset==3, ajout de la variable indexV0x pour supporter un nouveau champ v01/v02 %note spi: pour AMSR-E, le cas dataset==3, il faut propager la correction idFREQ = idFREQ+3 %note spi: end %version 0.0, modification 20 aout 2007 %version 0.1, revision 19 sept 2007, generalized mapfilename version, adding nl,year,jd,ad,vox,freq,pol % %nakedsoftware.org opensource license, copyright 2010
%%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
function [nl year jd ad ampm vox freq pol]=mappathname(inputpath,inputfile,zonename,region,dataset) yearmax=2008; nl=''; year=''; jd=''; ad=''; ampm=''; vox=''; freq=''; pol=''; if nargin<5 display('mapfilename(''inputpath'',''inputfile'',''zonename'',''region'',dataset)'); return; end if dataset>3 display('mapfilename: this function applies to dataset=1,2or3 only'); return; end if strcmp(region,'russie')==1 || strcmp(zonename,'russie')==1... strcmp(region,'tibet')==1 || strcmp(zonename,'tibet')==1 disp('mappathname: case not supported'); return; end % en entree (donnees brutes nsidc): % pour chaque jours juliens de 2001, SSMI am,pm,19GHz,37GHz,H,V,TIM % les fichiers telecharges en ftp (avec ftp_ssmi_2001.m) sont de formes % EASE-F13-NL A.19H.gz, EASE-F13-NL D.19H.gz % EASE-F13-NL A.19V.gz, EASE-F13-NL D.19V.gz % EASE-F13-NL A.37H.gz, EASE-F13-NL D.37H.gz % EASE-F13-NL A.37V.gz, EASE-F13-NL D.37V.gz % EASE-F13-NL A.TIM.gz, EASE-F13-NL D.TIM.gz % % en entree (donnees brutes converties, equipe tb cartel): % pour chaque jours juliens de 2001, SSMI am,pm,19GHz,37GHz,H,V,TIM % et pour le cas particulier de la region canada 160x240 (zonename=160x240,region=canada) % les dossiers pentades sont C:\ssmi\160x240\Canada\2001\D001_005 % [outputpath,] % et les fichiers sont de la forme CAN_L001am19H, a CAN_L005pmTIM % CAN_L001am19H, CAN_L001pm19H % CAN_L001am19V, CAN_L001pm19V % CAN_L001am37H, CAN_L001pm37H % CAN_L001am37V, CAN_L001pm37V % CAN_L001amTIM, CAN_L001pmTIM % % en entree (donnees calcules, equipe tb cartel) datasetmap={ ,'era40','D:\era40\ease\160x240\Canada\1978','ease001'; ,'era40_moy','D:\era40_moy\ease\160x240\Canada\1978','eas e001';... %2+10,'narr','D:\narr\ease\160x240\Canada\2002','ease001' %2+80,'narr_moy','D:\narr_moy\ease\160x240\Canada\2002','ease 001' 2+10,'narr','G:\narr\ease\160x240\Canada\2002','ease001' 2+80,'narr_moy','G:\narr_moy\ease\160x240\Canada\2002','ease0 01' 1,'smmr','D:\smmr\160x240\Canada\1978\D296_300','CAN_L298am18 H' 1+20,'smmr_ratio','D:\smmr_ratio\ratio_canada\fichier_ratio\1 978','ratio_am298' 1+30,'smmr_snowcover','D:\smmr_snowcover\canada\1979','001' 1+40,'smmr_ts','D:\smmr_ts\160x240\Canada\1978\37GHz','TS_D00 1_am' 1+70,'smmr_ts-coor','D:\smmr_ts-corr\smmr_ts- moy\160x240\Canada\1978\37GHz','TS_D300' 1+50,'smmr_ts-moy','D:\smmr_ts- moy\160x240\Canada\1978\37GHz','TS_D300' 1+60,'smmr_ts-norm','D:\smmr_ts- norm\160x240\Canada\1978\37GHz','TS_D300' 2,'ssmi','D:\ssmi\160x240\Canada\1987\D188_192','CAN_L190am19 H' 2+20,'ssmi_ratio','D:\ssmi_ratio\ratio_canada\fichier_ratio\1 987','ratio_am213' 2+30,'ssmi_snowcover','D:\ssmi_snowcover\canada\1988','001' 2+40,'ssmi_ts','D:\ssmi_ts\160x240\Canada\1987\37GHz','TS_D19 0_am' 2+70,'ssmi_ts-coor','D:\ssmi_ts-corr\ssmi_ts- moy\160x240\Canada\1987\37GHz','TS_D192' 2+50,'ssmi_ts-moy','D:\ssmi_ts- moy\160x240\Canada\1987\37GHz','TS_D192' % ,'ssmi_ts-moy-narr','D:\ssmi_ts- moy\160x240\Canada\2002\37GHz','TS_D003' % ,'ssmi_ts-norm','D:\ssmi_ts- norm\160x240\Canada\1987\37GHz','TS_D192' % ,'ssmi_ts-norm-narr','D:\ssmi_ts- norm\160x240\Canada\2002\37GHz','TS_D003'... %622 }; % indexNL=strfind(inputfile, 'NL'); %northern henmisphere low- resolution tag indexYEAR=indexNL+2; %year tag indexJD=indexYEAR+4; %julian day tag indexAD=indexJD+3; %ascendant/descendant tag %if(dataset==3 && str2num(inputfile(indexYEAR:indexYEAR+3))>=2006 && str2num(inputfile(indexJD:indexJD+2))>=305) %AMSR-E julianday=305 if(dataset==3 && str2num(inputfile(indexYEAR:indexYEAR+3))>=yearmax && str2num(inputfile(indexJD:indexJD+2))>=305) %AMSR-E julianday=305 indexV0x = indexAD+2; indexFREQ=indexV0x+3; %frequency tag indexPOL=indexFREQ+2; %polarisation tag else %dataset==1, dataset==2, dataset==3 %SMMR, SSMI and AMSR- E indexFREQ=indexAD+2; %frequency tag indexPOL=indexFREQ+2; %polarisation tag end year=inputfile(indexYEAR:indexYEAR+3); julianday=inputfile(indexJD:indexJD+2); ad=inputfile(indexAD); freq=inputfile(indexFREQ:indexFREQ+1); pol=inputfile(indexPOL); if(dataset==1) %SMMR % Pour toute la période SMMR, la phase ascendante correspond à la période am % et la phase descendante à la période pm (regle basee sur fichier IsAmPmMissing.m). if(strcmp(upper(ad),'A')) ampm = 'am'; elseif(strcmp(upper(ad),'D')) ampm = 'pm'; else warning('error'); end elseif(dataset==2) %SSMI % Pour la période SSMI, la phase ascendante correspond à la période am et la phase % descendante à la période pm jusqu'au jour 340 de l'année 1991 (en assumant que % pour l'année 1991, les données Tb des jours 340- ont été extraites à partir du % CD NSIDC Northern Hemisphere Volume 15.0, et celles des jours 341+ du CD NSIDC % Northern Hemisphere Volume 16.0). À partir du jour 341 de l'année 1991, l'inverse % est vrai, i.e. la phase ascendante correspond à la période pm et la phase descendante % à la période am (regle basee sur fichier IsAmPmMissing.m) if(str2num(year)<1991) %direct mapping of 'A' to 'am' and 'D' to 'pm' if(strcmp(upper(ad),'A')) ampm = 'am'; elseif(strcmp(upper(ad),'D')) ampm = 'pm'; else warning('error'); end elseif(str2num(year)==1991 && str2num(day)<=340) %direct mapping of 'A' to 'am' and 'D' to 'pm' if(strcmp(upper(ad),'A')) ampm = 'am'; elseif(strcmp(upper(ad),'D')) ampm = 'pm'; else warning('error'); end elseif(str2num(year)>1991) %inverse mapping, 'A' to 'pm' and 'D' to 'am' if(strcmp(upper(ad),'A')) ampm = 'pm'; elseif(strcmp(upper(ad),'D')) ampm = 'am'; else warning('error'); end elseif(dataset==3) %AMSR-E % Pour toute la période AMSR-E disponible ( ), aucun mapping A/D am/pm supporte dans cette implantation. if(strcmp(upper(ad),'A')) ampm = 'A'; %ampm = 'am'; elseif(strcmp(upper(ad),'D')) ampm = 'D'; %ampm = 'pm'; else warning('error'); end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%% %3) output filename format, assuming filename keeps same pentad structure and starts with 'ID2r3-AMSRE-NL' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%% %SMMR and SSMI output filename format, both keep the same pentad structure and both start with 'CAN_L' if(dataset==1 || dataset==2) outputpath = [outputpath,year,filesep,GetPentadDir(dataset,str2num(year),s tr2num(julianday))]; outputfilename = ['CAN_L',julianday,ampm]; if(strcmp(upper(pol),'M')) last3char = 'TIM'; elseif(strcmp(upper(pol),'H') || strcmp(upper(pol),'V')) last3char = [freq,pol]; else warning('error'); end outputfilename = [outputfilename,last3char]; %AMSR-E output filename format, assuming filename keeps same pentad structure and starts with 'ID2r3-AMSRE-NL' elseif(dataset==3) %outputpath = [outputpath,year,filesep,GetPentadDir(dataset,str2num(year),s tr2num(julianday))]; outputpath = [outputpath,year,filesep]; outputfilename = ['ID2r3-AMSRE-NL',julianday,ampm]; if(strcmp(upper(pol),'M')) %nnA, for TIM pol = M last3char = 'TIM'; elseif(strcmp(upper(pol),'H') || strcmp(upper(pol),'V')) last3char = [freq,pol]; else warning('error'); end outputfilename = [outputfilename,last3char]; end %if/elseif %sortie: s'assurer de retourner: nl year jd ad vox freq pol vox='VOx'; jd=julianday; nl='NL'; end %function