# Changes between Version 9 and Version 10 of udg/ecoms/dataserver/interfaces/matlab

Ignore:
Timestamp:
Apr 22, 2013 7:33:04 PM (9 years ago)
Comment:

--

### Legend:

Unmodified
 v9 Obligatory input arguments: * dataset: A string indicating the ''url'' of the dataset to be read (check the catalog of available datasets [https://www.meteo.unican.es/trac/meteo/wiki/SpecsEuporias/DataServer/Datasets here]). * var: A string indicating the variable to be read. * season: A cell of two strings indicating the first and final months to be read. Single months ({'Jan';'Jan'}) or seasons defined by consecutive months ({'Dec';'Feb'}) can be specified. Note that months are denoted by their three first letters. * leadMonth: Forecast lead time (in months) to be considered. For instance, leadMonth = 1 for January refers to forecasts issued the first of December. * dataset: String indicating the ''url'' of the dataset to be read (check the catalog of available datasets [https://www.meteo.unican.es/trac/meteo/wiki/SpecsEuporias/DataServer/Datasets here]). * var: String indicating the variable to be read. * season: Cell with two strings indicating the first and final months to be read. Single months ({'Jan';'Jan'}) or seasons defined by consecutive months ({'Dec';'Feb'}) can be specified. Note that months are denoted by their three first letters. * leadMonth: Forecast lead time (in months) to be considered. For instance, leadMonth = 1 for January would refer to forecasts issued the first of December. Optional input arguments (''varargin''): * members: Vector indicating the members to consider. By default all available members are considered. * xlim: Vector of length = 2 with minimum and maximum longitude (in degrees) of the selected bounding box. By default the whole domain of the dataset is considered. * ylim: Vector of length = 2 with minimum and maximum latitude (in degrees) of the selected bounding box. By default the whole domain of the dataset is considered. * user: Username for ccessing the OPeNPAD server. By default it is set to 'euporias'. * password: Password for accessing the OPeNPAD server. By default it is set to 'uc123'. * xlim: Vector of length = 2 containing the minimum and maximum longitudes (in degrees) determining the domain to be considered. By default the whole domain of the dataset is considered. * ylim: Vector of length = 2 containing the minimum and maximum latitudes (in degrees) determining the domain to be considered. By default the whole domain of the dataset is considered. * user: Username required for accessing the data server. By default it is set to 'euporias'? * password: Password required for accessing the data server. By default it is set to 'uc123'? Outputs returned by the function: * data: Cell with ''n = number of years'' 5-D matrices. Each matrix contains the forecasts for a particular year. Its first and second dimension of the matrix refers to the dataset and variable read. The third dimension correspondons to the forecasts times. Forth and fifth dimensions refer to the latitudes and longitudes of the grid boxes selected. * run: Cell with ''n = number of years'' vectors. Each vector indicates the initialization time (in ''datevec'' format) for a particular year. * ens: Cell of ''n = number of years'' vectors. Each vector contains the ensemble members considered. * data: Cell with ''n = number of years'' 5-D matrices. Each matrix contains the forecasts for a particular year. Its first and second dimensions refer to the dataset and variable read. The third dimension correspondons to the forecasts times. Forth and fifth dimensions refer to the latitudes and longitudes of the grid boxes selected. * run: Cell with ''n = number of years'' vectors. Each vector contains the initialization time (in ''datevec'' format) for a particular year. * ens: Cell of ''n = number of years'' vectors. Each vector indicates the ensemble members considered. * frc: Cell with ''n = number of years'' 2-D matrices. Each matrix contains the forecasts times (in ''datevec'' format) for a particular year. * lat: Cell of ''n = number of years'' vectors. Each vector contains the latitudes of the selected domain. * lon: Cell of ''n = number of years'' vectors. Each vector contains the longitudes of the selected domain. * lat: Cell of ''n = number of years'' vectors. Each vector contains the latitudes of the domain considered. * lon: Cell of ''n = number of years'' vectors. Each vector contains the longitudes of the domain considered. ==  Example: == In this example, the '''loadSystem4''' function is used to read the maximum temperature for the Iberian Peninsula in August for the whole hindcast period (1981-2010), considering the initialization of the first of June (two-month lead time thus) for a single member (member5, for instance). In this example, the '''loadSystem4''' function is used to read the maximum temperature for the Iberian Peninsula in August for the whole hindcast period (1981-2010), considering the forecasts issued the first of June (two-month lead time) for a single member (member5). {{{ dataset = 'http://www.meteo.unican.es/tds5/dodsC/system4/System4_Seasonal_15Members.ncml'; var = 'Maximum_temperature_at_2_metres_since_last_24_hours_surface'; %% reading [data,run,ens,frc,lat,lon] = loadSystem4(dataset,var,{'Aug';'Aug'},2,'members',5,'xlim',[-10 5],'ylim',[35 45]); }}} The data can be plotted by using the functions from [https://www.mdm.unican.es/trac/MLToolbox MeteoLab], the open-source ''Matlab'' toolbox for statistical analysis and data mining in Meteorology created by the [http://www.meteo.unican.es/en/main Santander Meteorology Group]. The data for the first year (August of 1981) can be plotted by using the functions from [https://www.mdm.unican.es/trac/MLToolbox MeteoLab], the open-source ''Matlab'' toolbox for statistical analysis and data mining in meteorology created by the [http://www.meteo.unican.es/en/main Santander Meteorology Group]. {{{ %% matrix of nodes lon = lon{1}; lat = lat{1}; nod = [nx(:)';ny(:)']'; %% data for the first year (1981) datay1 = nan(1,size(nod,1)); for ilat = 1:length(lat) inod = find(ismember(nod,[lon,repmat(lat(ilat),length(lon),1)],'rows') == 1); datay1(:,inod) = nanmean(squeeze(data{1}(1,1,:,ilat,:)) - 273.15); datay1(:,inod) = nanmean(squeeze(data{1}(1,1,:,ilat,:)) - 273.15);  % Kelvin to Celsius end %% plot drawStationsValue(datay1,nod,'marker','t','size',0.75,'colorbar','true','clim',[20 40],'resolution','high') colormap(jet)