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 function writeshp_xyz_lonlatalt_provinces global g_province; %north america figure; worldmap('north america'); load coast; plotm(lat,long,'LineWidth',1,'Color','black'); %plotm(lat,long,'LineWidth',1,'Color','blue') m=gcm; latlim=m.maplatlimit; lonlim=m.maplonlimit; boundingbox_na=[lonlim(1) latlim(1);lonlim(2) latlim(2)]; %canada worldmap('canada'); load coast; plotm(lat,long,'LineWidth',1,'Color','black'); %plotm(lat,long,'LineWidth',1,'Color','blue') m=gcm; latlim=m.maplatlimit; lonlim=m.maplonlimit; boundingbox_can=[lonlim(1) latlim(1);lonlim(2) latlim(2)]; %canadaalaska worldmap([boundingbox_can(1,2) boundingbox_can(2,2)],[boundingbox_na(1,1) boundingbox_na(2,1)]); load coast; plotm(lat,long,'LineWidth',1,'Color','black'); %plotm(lat,long,'LineWidth',1,'Color','blue') m=gcm; latlim=m.maplatlimit; lonlim=m.maplonlimit; boundingbox_canala=[lonlim(1) latlim(1);lonlim(2) latlim(2)]; %lakes lakes=shaperead('C:\spoirier\oifii-org\httpdocs\ns- org\nsd\ar\sp\tsat_shp\northamerica_lakes\northamerica_lakes. shp','BoundingBox',boundingbox_canala,'UseGeoCoords',true); %geoshow([lakes.Lat],[lakes.Lon]); %already drawn with the plotm() after load coast calls for index=1:numel(lakes) h=textm((lakes(index).BoundingBox(1,2)+lakes(index).BoundingB ox(2,2))/2,... (lakes(index).BoundingBox(1,1)+lakes(index).BoundingBox(2,1)) /2,lakes(index).NAME); trimcart(h) rotatetext(h) end %cities cities=shaperead('worldcities.shp','BoundingBox',boundingbox_ canala,'UseGeoCoords',true); for index=1:numel(cities) h=textm(cities(index).Lat,cities(index).Lon,cities(index).Nam e); trimcart(h) rotatetext(h) end %provinces provinces=shaperead('.\dcw_provinces\provinces.shp','Bounding Box',boundingbox_canala,'UseGeoCoords',true); geoshow([provinces.Lat],[provinces.Lon],'DisplayType','polygo n','FaceColor','None'); for index=1:numel(provinces) h=textm((provinces(index).BoundingBox(1,2)+provinces(index).B oundingBox(2,2))/2,... (provinces(index).BoundingBox(1,1)+provinces(index).BoundingB ox(2,1))/2,provinces(index).NAME); trimcart(h) rotatetext(h) end if exist('xyz_lonlatalt_provinces.shp','file') %do nothing else %write a first shapefile for all provinces %load tsat land points tsatlandpoints=shaperead('.\xyz_lonlatalt\xyz_lonlatalt.shp', 'BoundingBox',boundingbox_canala,'UseGeoCoords',true); %section for adding an attribute (a province tag) to tsatlandpoints shapefile for index=1:numel(tsatlandpoints) %{ if(tsatlandpoints(index).Alt==0.0) h=textm(tsatlandpoints(index).Lat,tsatlandpoints(index).Lon,n um2str(tsatlandpoints(index).Alt)); trimcart(h) rotatetext(h) end %} tsatlandpoints(index).PROV=''; for indexprov=1:numel(provinces) [in on]=inpolygon(tsatlandpoints(index).Lon,tsatlandpoints(index).Lat,provinces(indexprov).Lon,provinces(indexprov).Lat); if(in==1 || on==1) str=provinces(indexprov).NAME; tsatlandpoints(index).PROV=str; display([num2str(index),' in ',str]); break; %this break in order not to get provinces' boundary points into multiple classes (provinces) end if(isempty(tsatlandpoints(index).PROV)) str='United States'; %Alaska or south of Canada tsatlandpoints(index).PROV=str; display([num2str(index),' in ',str]); end %write a first shapefile for all provinces shapewrite(tsatlandpoints,'xyz_lonlatalt_provinces'); end %write one shapefile for each provinces and usa for index=1:numel(provinces) g_province=provinces(index).NAME; %load tsat land points tsatlandpoints=shaperead('xyz_lonlatalt_provinces','Selector',{@provincefilter,'PROV'},'UseGeoCoords',true); if numel(tsatlandpoints)>1 %write shapefile shapewrite(tsatlandpoints,['xyz_lonlatalt_',g_province]); %all provinces else display(['no points for ',g_province]); end g_province='United States'; %load tsat land points tsatlandpoints=shaperead('xyz_lonlatalt_provinces','Selector',{@provincefilter,'PROV'},'UseGeoCoords',true); %write alast shapefile for united state shapewrite(tsatlandpoints,['xyz_lonlatalt_',g_province]); %all provinces end%function function result=provincefilter(provincestring) global g_province; if ~isempty(strfind(provincestring,g_province(2:end))) %kick out the first letter because most likely uppercase in the shapefile result=1; else result=0; end end%function


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

Similar presentations


Ads by Google