Changes between Version 9 and Version 10 of udg/ecoms/dataserver/interfaces/matlab
- Timestamp:
- Apr 22, 2013 7:33:04 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
udg/ecoms/dataserver/interfaces/matlab
v9 v10 9 9 10 10 Obligatory input arguments: 11 * `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]).12 * `var`: A string indicating the variable to be read.13 * `season`: A cell oftwo 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.14 * `leadMonth`: Forecast lead time (in months) to be considered. For instance, `leadMonth = 1` for January refersto forecasts issued the first of December.11 * `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]). 12 * `var`: String indicating the variable to be read. 13 * `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. 14 * `leadMonth`: Forecast lead time (in months) to be considered. For instance, `leadMonth = 1` for January would refer to forecasts issued the first of December. 15 15 16 16 Optional input arguments (''varargin''): 17 17 * `members`: Vector indicating the members to consider. By default all available members are considered. 18 * `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.19 * `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.20 * `user`: Username for ccessing the OPeNPAD server. By default it is set to 'euporias'.21 * `password`: Password for accessing the OPeNPAD server. By default it is set to 'uc123'.18 * `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. 19 * `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. 20 * `user`: Username required for accessing the data server. By default it is set to 'euporias'? 21 * `password`: Password required for accessing the data server. By default it is set to 'uc123'? 22 22 23 23 Outputs returned by the function: 24 * `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 refersto 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.25 * `run`: Cell with ''n = number of years'' vectors. Each vector indicates the initialization time (in ''datevec'' format) for a particular year.26 * `ens`: Cell of ''n = number of years'' vectors. Each vector contains the ensemble members considered.24 * `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. 25 * `run`: Cell with ''n = number of years'' vectors. Each vector contains the initialization time (in ''datevec'' format) for a particular year. 26 * `ens`: Cell of ''n = number of years'' vectors. Each vector indicates the ensemble members considered. 27 27 * `frc`: Cell with ''n = number of years'' 2-D matrices. Each matrix contains the forecasts times (in ''datevec'' format) for a particular year. 28 * `lat`: Cell of ''n = number of years'' vectors. Each vector contains the latitudes of the selected domain.29 * `lon`: Cell of ''n = number of years'' vectors. Each vector contains the longitudes of the selected domain.28 * `lat`: Cell of ''n = number of years'' vectors. Each vector contains the latitudes of the domain considered. 29 * `lon`: Cell of ''n = number of years'' vectors. Each vector contains the longitudes of the domain considered. 30 30 31 31 == Example: == 32 32 33 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).33 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). 34 34 35 35 {{{ 36 36 dataset = 'http://www.meteo.unican.es/tds5/dodsC/system4/System4_Seasonal_15Members.ncml'; 37 37 var = 'Maximum_temperature_at_2_metres_since_last_24_hours_surface'; 38 %% reading 38 39 [data,run,ens,frc,lat,lon] = loadSystem4(dataset,var,{'Aug';'Aug'},2,'members',5,'xlim',[-10 5],'ylim',[35 45]); 39 40 }}} 40 41 41 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].42 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]. 42 43 43 44 {{{ 45 %% matrix of nodes 44 46 lon = lon{1}; 45 47 lat = lat{1}; … … 47 49 nod = [nx(:)';ny(:)']'; 48 50 51 %% data for the first year (1981) 49 52 datay1 = nan(1,size(nod,1)); 50 53 for ilat = 1:length(lat) 51 54 inod = find(ismember(nod,[lon,repmat(lat(ilat),length(lon),1)],'rows') == 1); 52 datay1(:,inod) = nanmean(squeeze(data{1}(1,1,:,ilat,:)) - 273.15); 55 datay1(:,inod) = nanmean(squeeze(data{1}(1,1,:,ilat,:)) - 273.15); % Kelvin to Celsius 53 56 end 54 57 58 %% plot 55 59 drawStationsValue(datay1,nod,'marker','t','size',0.75,'colorbar','true','clim',[20 40],'resolution','high') 56 60 colormap(jet)