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)
Author:
rodri
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • udg/ecoms/dataserver/interfaces/matlab

    v9 v10  
    99
    1010Obligatory 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 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.
    14 * `leadMonth`: Forecast lead time (in months) to be considered. For instance, `leadMonth = 1` for January refers to 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.
    1515
    1616Optional input arguments (''varargin''):
    1717* `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'?
    2222
    2323Outputs 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 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.
    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.
    2727* `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.
    3030
    3131==  Example: ==
    3232
    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).
     33In 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).
    3434
    3535{{{
    3636dataset = 'http://www.meteo.unican.es/tds5/dodsC/system4/System4_Seasonal_15Members.ncml';
    3737var = 'Maximum_temperature_at_2_metres_since_last_24_hours_surface';
     38%% reading
    3839[data,run,ens,frc,lat,lon] = loadSystem4(dataset,var,{'Aug';'Aug'},2,'members',5,'xlim',[-10 5],'ylim',[35 45]);
    3940}}}
    4041
    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].
     42The 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].
    4243
    4344{{{
     45%% matrix of nodes
    4446lon = lon{1};
    4547lat = lat{1};
     
    4749nod = [nx(:)';ny(:)']';
    4850
     51%% data for the first year (1981)
    4952datay1 = nan(1,size(nod,1));
    5053for ilat = 1:length(lat)
    5154    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
    5356end
    5457
     58%% plot
    5559drawStationsValue(datay1,nod,'marker','t','size',0.75,'colorbar','true','clim',[20 40],'resolution','high')
    5660colormap(jet)