Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%% validation section initialization section.

Slides:



Advertisements
Similar presentations
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Advertisements

Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%% validation section initialization section navigation section.
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
1 CODATA 2006 October 23-25, 2006, Beijing Cryospheric Data Assimilation An Integrated Approach for Generating Consistent Cryosphere Data Set Xin Li World.
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Dedi Rahmawan Putra  Shared Document  Conventional Ways  Common Problems  What is TortoiseSVN  Advantages over another tools  Basic Concepts.
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Snow Cover: Current Capabilities, Gaps and Issues (Canadian Perspective) Anne Walker Climate Research Branch, Meteorological Service of Canada IGOS-Cryosphere.
Snow Water Equivalent Variations in Western Canada – Climate Change Related Impacts for Hydropower Production Anne Walker Climate Research Branch, Meteorological.
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
UMAC data callpage 1 of 11NLDAS EMC Operational Models North American Land Data Assimilation System (NLDAS) Michael Ek Land-Hydrology Team Leader Environmental.
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%% initialization section.
Earth Observation from Satellites GEOF 334 MICROWAVE REMOTE SENSING A brief introduction.
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Retrieving Snowpack Properties From Land Surface Microwave Emissivities Based on Artificial Neural Network Techniques Narges Shahroudi William Rossow NOAA-CREST.
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%% validation section initialization section.
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Page 1© Crown copyright HadISST2: progress and plans Nick Rayner, 14 th March 2007.
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Modern Era Retrospective-analysis for Research and Applications: Introduction to NASA’s Modern Era Retrospective-analysis for Research and Applications:
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
1. Analysis and Reanalysis Products Adrian M Tompkins, ICTP picture from Nasa.
REANALYSIS OF SEA ICE CONCENTRATION FROM THE SMMR AND SSM/I RECORDS Søren Andersen, Lars-Anders Breivik, Mary J. Brodzik, Craig Donlon, Steinar Eastwood,
The passive microwave sea ice products…. ….oh well…
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Brodzik et al. IGS ‘06 Deriving Long-Term Northern Hemisphere Snow Extent Trends from Satellite Passive Microwave and Visible Data R. L. Armstrong, M.
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Upgrade on Windows 7. DownloadSoftware Download Software from link provided in Webliography: e/
Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%
Overview %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% validation section.
Satellite sea ice observations for validating midterm climate models
Overview %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Overview %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Service Section Technical Training Dec 2005.
NSIDC DAAC UWG Meeting August 9-10 Boulder, CO
Generation of Cloud Products from NOAA’s Operational Satellite Imagers
Graphing Using Processing
Presentation transcript:

Overview %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%% validation section initialization section

%%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%

%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\tsat application (lauched with ar\sp\tsat.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 merge the (previously generated) snowcover database to the (previously generated) temperature database % %usage % 2009dec27 % tsat(1,1,1) % %version 3.4: tsat(mergetsat_flag, mergeera40_flag,mergenarr_flag), spi 2009nov24, merges the snowcover db not only to tsat % but also to era40 and narr, % % note: the snowcover db must be generated prior to call to tsat() function. the steps for generating % the snowcover db are: 1) running function main_ratio() from ratio folder, 2) running function from % snowcover folder and finaly 3) running function tsat() from tsat folder % %version 3.0: tsat(), spi 2009nov23, k:\ drive modif, %version 0.2 tsat(), avril 2009 april, yearmax revision %version 0.1 tsat(), merges the snowcover db (mask) with the satellite (smmr/ssmi derived) temperature db % %nakedsoftware.org opensource license, copyright 2010

%%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%

function tsat(mergetsat_flag,mergeera40_flag,mergenarr_flag)

validation section

if(nargin<3) mergenarr_flag=0;end if(nargin<2) mergeera40_flag=0;end if(nargin<1) mergetsat_flag=0;end display(['executing tsat(',num2str(mergetsat_flag),',',num2str(mergeera40_flag),',',num2str(mergenarr_flag),')']);

initialization section

[driveletter]=getsourceimagedatabasedrive();if(~exist(drivele tter,'dir'))display([driveletter,' drive not ready']);return;end load('srcarsplib_path.mat'); load('srcimgdb_paths.mat'); %outputpath='G:\tsat\canada\'; %outputpath_tsat='k:\g-tsat\canada\'; %outputpath_tsat='K:\c-db-bd_surface-temperature_ \canada\'; outputpath_tsat=srcimgdb_path_db_surface_temperature; %outputpath='G:\tsat\canada\'; %inputpath_era40='K:\d-era40_moy\ease\160x240\Canada\'; inputpath_era40=srcimgdb_path_era40_moy; % %outputpath_era40='K:\d-era40_scdb\'; %outputpath_era40='K:\d-era40_scdb\ease\160x240\Canada\'; outputpath_era40=srcimgdb_path_era40_scdb; %outputpath='G:\tsat\canada\'; %inputpath_narr='k:\g-narr_moy\ease\160x240\Canada\'; inputpath_narr=srcimgdb_path_narr_moy; %outputpath_era40='K:\d-era40_scdb\'; %outputpath_narr='k:\g-narr_scdb\ease\160x240\Canada\'; outputpath_narr=srcimgdb_path_narr_scdb; yearmax=2008; %%%%%% %merge tsat %%%%%% if(mergetsat_flag==1) %for year=yearmax:yearmax for year=1979:yearmax %outputpathname_tsat=[outputpath_tsat,num2str(year)]; outputpathname_tsat=fullfile(outputpath_tsat,num2str(year)); if(exist(outputpathname_tsat,'dir')==0) mkdir(outputpathname_tsat); else display(['outputpath_tsat ',outputpathname_tsat,' already exists']); display('choose another output directory or erase existing one'); display('returning without generating tsat database'); pause(); return; end matrice1=zeros(160,240); matrice2=zeros(160,240); matrice3=zeros(160,240); %for year=1979:2007 for year=1979:yearmax display(['tsat - merging year ',num2str(year)]); for day=1:366 %display(['day ',num2str(day)]); if((day==366)&&(((~rem(year,4)&rem(year,100))|~rem(year,400)) ==0)); continue; end %A) snowcover mask DB, inputdir if(year<=1987) %A1) smmr %filename1=['D:\smmr_snowcover\canada\',num2str(year),'\',spr intf('%03d',day)]; %filename1=['k:\d- smmr_snowcover\canada\',num2str(year),'\',sprintf('%03d',day) ]; filename1=fullfile(srcimgdb_path_smmr_snowcover,num2str(year),sprintf('%03d',day)); else %A2) ssmi %filename1=['D:\ssmi_snowcover\canada\',num2str(year),'\',spr intf('%03d',day)]; %filename1=['k:\d- ssmi_snowcover\canada\',num2str(year),'\',sprintf('%03d',day) ]; filename1=fullfile(srcimgdb_path_ssmi_snowcover,num2str(year),sprintf('%03d',day)); end [pathstr,name,ext,versn]=fileparts(filename1); [d1 d2 f]=autodimformat(pathstr,name); dim=[d1 d2]; format=f; fid=fopen(filename1, 'r'); if(fid~=-1) matrice1=fread(fid,[1 inf],format); matrice1=reshape(matrice1,160,240); fclose(fid); else matrice1=zeros(160,240); end indicessnow=find(matrice1==1); %B) Ts DB if(year<=1982) %filename2=['k:\d-smmr_ts- moy\160x240\Canada\',num2str(year),'\37GHz\TS_D',sprintf('%03 d',day)]; filename2=fullfile(srcimgdb_path_smmr_ts_moy,num2str(year),'3 7GHz',['TS_D',sprintf('%03d',day)]); elseif((year<=1986)||((year==1987)&&(day<192))) %B1) smmr D:\smmr_ts-corr\smmr_ts- moy\160x240\Canada\1979\37GHz %filename2=['D:\smmr_ts-corr\smmr_ts- moy\160x240\Canada\',num2str(year),'\37GHz\TS_D',sprintf('%03 d',day)]; %filename2=['k:\d-smmr_ts-corr\smmr_ts- moy\160x240\Canada\',num2str(year),'\37GHz\TS_D',sprintf('%03 d',day)]; filename2=fullfile(srcimgdb_path_smmr_ts_corr,num2str(year),' 37GHz',['TS_D',sprintf('%03d',day)]); elseif(((year>1987)&&(year =192)) ) %B2) ssmi D:\ssmi_ts-corr\ssmi_ts- moy\160x240\Canada\1987\37GHz %filename2=['D:\ssmi_ts-corr\ssmi_ts- moy\160x240\Canada\',num2str(year),'\37GHz\TS_D',sprintf('%03 d',day)]; %filename2=['k:\d-ssmi_ts-corr\ssmi_ts- moy\160x240\Canada\',num2str(year),'\37GHz\TS_D',sprintf('%03 d',day)]; filename2=fullfile(srcimgdb_path_ssmi_ts_corr,num2str(year),' 37GHz',['TS_D',sprintf('%03d',day)]); elseif((year>=1992)&&(year<2002)) %B3) ssmi D:\ssmi_ts- moy\160x240\Canada\1992\37GHz %filename2=['D:\ssmi_ts- moy\160x240\Canada\',num2str(year),'\37GHz\TS_D',sprintf('%03 d',day)]; %filename2=['k:\d-ssmi_ts- moy\160x240\Canada\',num2str(year),'\37GHz\TS_D',sprintf('%03 d',day)]; filename2=fullfile(srcimgdb_path_ssmi_ts_moy,num2str(year),'3 7GHz',['TS_D',sprintf('%03d',day)]); %elseif((year>=2002)&&(year<2008)) elseif((year>=2002)&&(year<=yearmax)) %B4) ssmi D:\ssmi_ts-moy- narr\160x240\Canada\2002\37GHz %filename2=['D:\ssmi_ts-moy- narr\160x240\Canada\',num2str(year),'\37GHz\TS_D',sprintf('%0 3d',day)]; %filename2=['k:\d-ssmi_ts-moy- narr\160x240\Canada\',num2str(year),'\37GHz\TS_D',sprintf('%0 3d',day)]; filename2=fullfile(srcimgdb_path_ssmi_ts_moy_narr,num2str(yea r),'37GHz',['TS_D',sprintf('%03d',day)]); end [pathstr,name,ext,versn]=fileparts(filename2); [d1 d2 f]=autodimformat(pathstr,name); dim=[d1 d2]; format=f; fid=fopen(filename2,'r'); if(fid~=-1) matrice2=fread(fid,[1 inf],format); matrice2=reshape(matrice2,160,240); fclose(fid); else matrice2=zeros(160,240); end %C) Tsat DB = snowcover mask DB + Ts DB %filename3=['D:\tsat\canada\',num2str(year),'\',sprintf('%03d ',day)]; filename3=fullfile(outputpath_tsat,num2str(year),sprintf('%03 d',day)); fid=fopen(filename3,'w'); if(fid~=-1) matrice3=matrice2; %temp in kelvin matrice3(indicessnow)=0; %NaN fwrite(fid,matrice3,'float'); %32bit fclose(fid); end end%for day end%for year end%if(mergetsat_flag==1) %%%%%% %merge era40 %%%%%% if(mergeera40_flag==1) %for year=yearmax:yearmax %for year=1979:yearmax for year=1979:2002 %outputpathname_era40=[outputpath_era40,num2str(year)]; outputpathname_era40=fullfile(outputpath_era40,num2str(year)) ; if(exist(outputpathname_era40,'dir')==0) mkdir(outputpathname_era40); else display(['outputpath_era40 ',outputpathname_era40,' already exists']); display('choose another output directory or erase existing one'); display('returning without generating era40_scdb database'); pause(); return; end matrice1=zeros(160,240); matrice2=zeros(160,240); matrice3=zeros(160,240); %for year=1979:yearmax for year=1979:2002 display(['era40 - merging year ',num2str(year)]); day_start=1; day_end=366;if(year==2002)day_end=243;end for day=1:day_end %display(['day ',num2str(day)]); if((day==366)&&(((~rem(year,4)&rem(year,100))|~rem(year,400)) ==0)); continue; end %A) snowcover mask DB, inputdir if(year<=1987) %A1) smmr %filename1=['D:\smmr_snowcover\canada\',num2str(year),'\',spr intf('%03d',day)]; %filename1=['k:\d- smmr_snowcover\canada\',num2str(year),'\',sprintf('%03d',day) ]; filename1=fullfile(srcimgdb_path_smmr_snowcover,num2str(year),sprintf('%03d',day)); else %A2) ssmi %filename1=['D:\ssmi_snowcover\canada\',num2str(year),'\',spr intf('%03d',day)]; %filename1=['k:\d- ssmi_snowcover\canada\',num2str(year),'\',sprintf('%03d',day) ]; filename1=fullfile(srcimgdb_path_ssmi_snowcover,num2str(year),sprintf('%03d',day)); end [pathstr,name,ext,versn]=fileparts(filename1); [d1 d2 f]=autodimformat(pathstr,name); dim=[d1 d2]; format=f; fid=fopen(filename1, 'r'); if(fid~=-1) matrice1=fread(fid,[1 inf],format); matrice1=reshape(matrice1,160,240); fclose(fid); else matrice1=zeros(160,240); end indicessnow=find(matrice1==1); %B) raw era40 DB filename2=fullfile(inputpath_era40,num2str(year),sprintf('eas e%03d',day)); [pathstr,name,ext,versn]=fileparts(filename2); [d1 d2 f]=autodimformat(pathstr,name); dim=[d1 d2]; format=f; fid=fopen(filename2,'r'); if(fid~=-1) matrice2=fread(fid,[1 inf],format); matrice2=reshape(matrice2,160,240); fclose(fid); else matrice2=zeros(160,240); end %C) era40 with snowmask DB = snowcover mask DB + raw era40 DB %filename3=['D:\tsat\canada\',num2str(year),'\',sprintf('%03d ',day)]; filename3=fullfile(outputpath_era40,num2str(year),sprintf('ea se%03d',day)); fid=fopen(filename3,'w'); if(fid~=-1) matrice3=matrice2; %temp in kelvin matrice3(indicessnow)=0; %NaN fwrite(fid,matrice3,'float'); %32bit fclose(fid); end end%for day end%for year end%if(mergeera40_flag==1) %%%%%% %merge narr %%%%%% if(mergenarr_flag==1) %for year=yearmax:yearmax %for year=1979:yearmax for year=1979:yearmax %outputpathname_narr=[outputpath_narr,num2str(year)]; outputpathname_narr=fullfile(outputpath_narr,num2str(year)); if(exist(outputpathname_narr,'dir')==0) mkdir(outputpathname_narr); else display(['outputpath_narr ',outputpathname_narr,' already exists']); display('choose another output directory or erase existing one'); display('returning without generating narr_scdb database'); pause(); return; end matrice1=zeros(160,240); matrice2=zeros(160,240); matrice3=zeros(160,240); %for year=1979:yearmax for year=1979:yearmax display(['narr - merging year ',num2str(year)]); day_start=1; day_end=366; for day=1:day_end %display(['day ',num2str(day)]); if((day==366)&&(((~rem(year,4)&rem(year,100))|~rem(year,400)) ==0)); continue; end %A) snowcover mask DB, inputdir if(year<=1987) %A1) smmr %filename1=['D:\smmr_snowcover\canada\',num2str(year),'\',spr intf('%03d',day)]; %filename1=['k:\d- smmr_snowcover\canada\',num2str(year),'\',sprintf('%03d',day) ]; filename1=fullfile(srcimgdb_path_smmr_snowcover,num2str(year),sprintf('%03d',day)); else %A2) ssmi %filename1=['D:\ssmi_snowcover\canada\',num2str(year),'\',spr intf('%03d',day)]; %filename1=['k:\d- ssmi_snowcover\canada\',num2str(year),'\',sprintf('%03d',day) ]; filename1=fullfile(srcimgdb_path_ssmi_snowcover,num2str(year),sprintf('%03d',day)); end [pathstr,name,ext,versn]=fileparts(filename1); [d1 d2 f]=autodimformat(pathstr,name); dim=[d1 d2]; format=f; fid=fopen(filename1, 'r'); if(fid~=-1) matrice1=fread(fid,[1 inf],format); matrice1=reshape(matrice1,160,240); fclose(fid); else matrice1=zeros(160,240); end indicessnow=find(matrice1==1); %B) raw narr DB filename2=fullfile(inputpath_narr,num2str(year),sprintf('ease %03d',day)); [pathstr,name,ext,versn]=fileparts(filename2); [d1 d2 f]=autodimformat(pathstr,name); dim=[d1 d2]; format=f; fid=fopen(filename2,'r'); if(fid~=-1) matrice2=fread(fid,[1 inf],format); matrice2=reshape(matrice2,160,240); fclose(fid); else matrice2=zeros(160,240); end %C) era40 with snowmask DB = snowcover mask DB + raw era40 DB %filename3=['D:\tsat\canada\',num2str(year),'\',sprintf('%03d ',day)]; filename3=fullfile(outputpath_narr,num2str(year),sprintf('eas e%03d',day)); fid=fopen(filename3,'w'); if(fid~=-1) matrice3=matrice2; %temp in kelvin matrice3(indicessnow)=0; %NaN fwrite(fid,matrice3,'float'); %32bit fclose(fid); end end%for day end%for year end%if(mergenarr_flag==1) end%function