{"id":2769,"date":"2018-07-18T16:41:57","date_gmt":"2018-07-18T15:41:57","guid":{"rendered":"https:\/\/research.reading.ac.uk\/meteorology\/?page_id=2769"},"modified":"2018-07-18T16:42:13","modified_gmt":"2018-07-18T15:42:13","slug":"matlab-script-to-generate-movie-for-globe","status":"publish","type":"page","link":"https:\/\/research.reading.ac.uk\/meteorology\/intranet\/it\/the-globe-display-in-the-library\/matlab-script-to-generate-movie-for-globe\/","title":{"rendered":"Matlab script to generate movie for globe"},"content":{"rendered":"<h2>Sample Matlab Script<\/h2>\n<p><code>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br \/>\n% This is a sample script to generate image files from SST data.     %<br \/>\n% These can then be combined into a movie file which will run on the %<br \/>\n% globe display in the Meteorology Department, University of Reading.%<br \/>\n%                                                                    %<br \/>\n% Written by Maria Broadbridge, m.b.broadbridge@reading.ac.uk        %<br \/>\n% Version 1.0, 16\/01\/2017                                            %<br \/>\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<\/p>\n<p>%% LOAD DATA<br \/>\n% Using monthly mean 1x1 degree gridded COBE SST (1891 - near present) as an example.<br \/>\n% The dataset is freely available from NOAA (https:\/\/www.esrl.noaa.gov\/psd\/data\/gridded\/data.cobe.html)<br \/>\nclear<br \/>\nsst=ncread('sst.mon.mean.nc','sst');<br \/>\nlat=ncread('sst.mon.mean.nc','lat');<br \/>\nlon=ncread('sst.mon.mean.nc','lon');<br \/>\ntime=ncread('sst.mon.mean.nc','time');<\/p>\n<p>% replace land placeholder values in the dataset with NaNs<br \/>\nind=find(sst>1e15);<br \/>\nsst(ind)=NaN;<br \/>\nclear ind<\/p>\n<p>%% PLOT DATA<br \/>\n% This creates a simple contour plot of the SST fields. <\/p>\n<p>% plot contourlines with 2 degree C spacing<br \/>\nc_intervals=[-2:2:32];<\/p>\n<p>% setup base name of files<br \/>\nbasename='pngfiles\/sst_'<\/p>\n<p>%counter for numbering in filenames<br \/>\ncount=0<\/p>\n<p>% plotting loop (only do 40 years (1977-2016) in this example, too many frames otherwise)<br \/>\nfor i=1033:length(time)<\/p>\n<p>    % count files<br \/>\n    count=count+1<\/p>\n<p>    % setup filename<br \/>\n    filename=[basename,num2str(count,'%04.0f'),'.png'];<\/p>\n<p>    close all<br \/>\n    figure(1)<br \/>\n    contourf(lon,lat,sst(:,:,i)',c_intervals)<br \/>\n    %colorbar<br \/>\n    caxis([-2 32])<br \/>\n    set(gcf,'Colormap',jet)<br \/>\n    % borderless figure, don't want a grid box or axis labels<br \/>\n    box off<br \/>\n    set(gca,'visible','off')<br \/>\n    % fill entire figure<br \/>\n    set(gca,'position',[0 0 1 1],'units','normalized')<br \/>\n    % setup 2:1 axis ratio in figure<br \/>\n    set(gcf,'Paperunits','points','Papersize',[1400 700],'Paperposition',[0 0 1400 700])<br \/>\n    % -r sets figure resolution in dpi, test for filesize!<br \/>\n    print('-dpng','-r100',filename)<br \/>\nend<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sample Matlab Script %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % This is a sample script to generate image files from SST data. % % These can then be combined into a movie file which will [&hellip;]<\/p>\n","protected":false},"author":194,"featured_media":0,"parent":2704,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"__cvm_playback_settings":[],"__cvm_video_id":"","footnotes":"","_links_to":"","_links_to_target":""},"class_list":["post-2769","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.8.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Matlab script to generate movie for globe - Meteorology<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/research.reading.ac.uk\/meteorology\/intranet\/it\/the-globe-display-in-the-library\/matlab-script-to-generate-movie-for-globe\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Matlab script to generate movie for globe - Meteorology\" \/>\n<meta property=\"og:description\" content=\"Sample Matlab Script %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % This is a sample script to generate image files from SST data. % % These can then be combined into a movie file which will [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/research.reading.ac.uk\/meteorology\/intranet\/it\/the-globe-display-in-the-library\/matlab-script-to-generate-movie-for-globe\/\" \/>\n<meta property=\"og:site_name\" content=\"Meteorology\" \/>\n<meta property=\"article:modified_time\" content=\"2018-07-18T15:42:13+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@UniRdg_Met\" \/>\n<meta name=\"twitter:label1\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/research.reading.ac.uk\/meteorology\/intranet\/it\/the-globe-display-in-the-library\/matlab-script-to-generate-movie-for-globe\/\",\"url\":\"https:\/\/research.reading.ac.uk\/meteorology\/intranet\/it\/the-globe-display-in-the-library\/matlab-script-to-generate-movie-for-globe\/\",\"name\":\"Matlab script to generate movie for globe - Meteorology\",\"isPartOf\":{\"@id\":\"https:\/\/research.reading.ac.uk\/meteorology\/#website\"},\"datePublished\":\"2018-07-18T15:41:57+00:00\",\"dateModified\":\"2018-07-18T15:42:13+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/research.reading.ac.uk\/meteorology\/intranet\/it\/the-globe-display-in-the-library\/matlab-script-to-generate-movie-for-globe\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/research.reading.ac.uk\/meteorology\/intranet\/it\/the-globe-display-in-the-library\/matlab-script-to-generate-movie-for-globe\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/research.reading.ac.uk\/meteorology\/intranet\/it\/the-globe-display-in-the-library\/matlab-script-to-generate-movie-for-globe\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/research.reading.ac.uk\/meteorology\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Welcome to the Meteorology Intranet\",\"item\":\"https:\/\/research.reading.ac.uk\/meteorology\/intranet\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Computing in Meteorology\",\"item\":\"https:\/\/research.reading.ac.uk\/meteorology\/intranet\/it\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"The Globe display in the Library\",\"item\":\"https:\/\/research.reading.ac.uk\/meteorology\/intranet\/it\/the-globe-display-in-the-library\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Matlab script to generate movie for globe\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/research.reading.ac.uk\/meteorology\/#website\",\"url\":\"https:\/\/research.reading.ac.uk\/meteorology\/\",\"name\":\"Meteorology\",\"description\":\"Meteorology, Research, Teaching, Environment, NCAS\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/research.reading.ac.uk\/meteorology\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-GB\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Matlab script to generate movie for globe - Meteorology","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/research.reading.ac.uk\/meteorology\/intranet\/it\/the-globe-display-in-the-library\/matlab-script-to-generate-movie-for-globe\/","og_locale":"en_GB","og_type":"article","og_title":"Matlab script to generate movie for globe - Meteorology","og_description":"Sample Matlab Script %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % This is a sample script to generate image files from SST data. % % These can then be combined into a movie file which will [&hellip;]","og_url":"https:\/\/research.reading.ac.uk\/meteorology\/intranet\/it\/the-globe-display-in-the-library\/matlab-script-to-generate-movie-for-globe\/","og_site_name":"Meteorology","article_modified_time":"2018-07-18T15:42:13+00:00","twitter_card":"summary_large_image","twitter_site":"@UniRdg_Met","twitter_misc":{"Estimated reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/research.reading.ac.uk\/meteorology\/intranet\/it\/the-globe-display-in-the-library\/matlab-script-to-generate-movie-for-globe\/","url":"https:\/\/research.reading.ac.uk\/meteorology\/intranet\/it\/the-globe-display-in-the-library\/matlab-script-to-generate-movie-for-globe\/","name":"Matlab script to generate movie for globe - Meteorology","isPartOf":{"@id":"https:\/\/research.reading.ac.uk\/meteorology\/#website"},"datePublished":"2018-07-18T15:41:57+00:00","dateModified":"2018-07-18T15:42:13+00:00","breadcrumb":{"@id":"https:\/\/research.reading.ac.uk\/meteorology\/intranet\/it\/the-globe-display-in-the-library\/matlab-script-to-generate-movie-for-globe\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/research.reading.ac.uk\/meteorology\/intranet\/it\/the-globe-display-in-the-library\/matlab-script-to-generate-movie-for-globe\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/research.reading.ac.uk\/meteorology\/intranet\/it\/the-globe-display-in-the-library\/matlab-script-to-generate-movie-for-globe\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/research.reading.ac.uk\/meteorology\/"},{"@type":"ListItem","position":2,"name":"Welcome to the Meteorology Intranet","item":"https:\/\/research.reading.ac.uk\/meteorology\/intranet\/"},{"@type":"ListItem","position":3,"name":"Computing in Meteorology","item":"https:\/\/research.reading.ac.uk\/meteorology\/intranet\/it\/"},{"@type":"ListItem","position":4,"name":"The Globe display in the Library","item":"https:\/\/research.reading.ac.uk\/meteorology\/intranet\/it\/the-globe-display-in-the-library\/"},{"@type":"ListItem","position":5,"name":"Matlab script to generate movie for globe"}]},{"@type":"WebSite","@id":"https:\/\/research.reading.ac.uk\/meteorology\/#website","url":"https:\/\/research.reading.ac.uk\/meteorology\/","name":"Meteorology","description":"Meteorology, Research, Teaching, Environment, NCAS","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/research.reading.ac.uk\/meteorology\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-GB"}]}},"_links":{"self":[{"href":"https:\/\/research.reading.ac.uk\/meteorology\/wp-json\/wp\/v2\/pages\/2769","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/research.reading.ac.uk\/meteorology\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/research.reading.ac.uk\/meteorology\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/research.reading.ac.uk\/meteorology\/wp-json\/wp\/v2\/users\/194"}],"replies":[{"embeddable":true,"href":"https:\/\/research.reading.ac.uk\/meteorology\/wp-json\/wp\/v2\/comments?post=2769"}],"version-history":[{"count":1,"href":"https:\/\/research.reading.ac.uk\/meteorology\/wp-json\/wp\/v2\/pages\/2769\/revisions"}],"predecessor-version":[{"id":2774,"href":"https:\/\/research.reading.ac.uk\/meteorology\/wp-json\/wp\/v2\/pages\/2769\/revisions\/2774"}],"up":[{"embeddable":true,"href":"https:\/\/research.reading.ac.uk\/meteorology\/wp-json\/wp\/v2\/pages\/2704"}],"wp:attachment":[{"href":"https:\/\/research.reading.ac.uk\/meteorology\/wp-json\/wp\/v2\/media?parent=2769"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}