Changes between Version 1 and Version 2 of udg/ecoms/dataserver/interfaces/python


Ignore:
Timestamp:
Apr 18, 2013 2:18:29 PM (9 years ago)
Author:
maru
Comment:

--

Legend:

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

    v1 v2  
    1 A python function has been created in order to explore and access the data portal in a user-friendly way, allowing the retrieval of dimensional slices of selected simulation members from the ECMWF's SYSTEM4 model.
     1A python function has been created in order to access the ''SPECS-EUPORIAS Data Portal'' in a user-friendly way, allowing the retrieval of dimensional slices of selected simulation members from the ECMWF's SYSTEM4 model. This function ([mtl:browser:MLToolbox/trunk/MLToolbox_experiments/antonio/system4/python/load_system4.py load_system4.py]) automatically cares about the proper location of the right indices for data sub-setting across the different variable dimensions, given a few simple arguments for subset definition. In addition, instead of retrieving a NetCDF file that needs to be opened and read, the requested data is directly loaded into the current python working session, according to a particular structure described below, prior to data analysis and/or representation.
     2
     3The request is simply formulated via the `load_system4` function:
     4{{{
     5>>> load_system4(dataset, var, season, leadMonth, lonLim, latLim, year, members=[])
     6}}}
     7
     8The arguments of the function are described below:
     9
     10* `dataset`: A character string indicating the full URL path to the OPeNDAP dataset. Currently, the accepted values correspond to the System4 datasets described in Section [https://www.meteo.unican.es/trac/meteo/wiki/SpecsEuporias/DataServer/Datasets Datasets], for instance `http://www.meteo.unican.es/tds5/dodsC/system4/System4_Seasonal_15Members.ncml`, but using the `System4_Seasonal_15Members.ncml`, `System4_Seasonal_51Members.ncml` or `System4_Annual_15Members.ncml` ending strings depending on the dataset of choice.
     11* `var`: Variable code. Argument values currently accepted are `tas`, `tasmin`, `tasmax`, `pr` or `mslp`, as internally defined in the vocabulary for System4 following the nomenclature displayed in the table below. However, note that new variables and datasets will be progressively included. Note that depending on the time step of the variable the units might be referred to different time aggregations. For instance, currently `mslp` is 6-hourly, and thus the 6-hourly mean value is returned for each time step. Similarly, 24-h accumulated values are returned for `pr`, and so on. Note that the ''instantaneous'' and ''aggregated'' fields in table below refer to the potential time step values that the variables may take, which does not mean that the resolution provided by the System4 model is necessarily that.
     12
     13||='''Short Name'''=||='''Long name'''=||='''Units'''=||='''Instantaneous'''=||='''Aggregated'''=||
     14||tasmax ||Maximum temperature at 2 metres ||degC||No||Yes||
     15||tasmin ||Minimum temperature at 2 metres ||degC||No||Yes||
     16||tas ||Mean temperature at 2 metres ||degC||Yes||Yes||
     17||pr ||Total precipitation accumulated||mm||No||Yes||
     18||mslp ||Mean sea level pressure ||Pa||Yes||Yes||
     19
     20* `members`: List of members to select. In the above case, a single member (the first) of the System4 ensemble is loaded, but additional members could be also specified  (e.g. `members=[0,1,2,3,4]` for the first five members).
     21* `lonLim`: Vector of length = 2, with minimum and maximum longitude coordinates, in decimal degrees, of the bounding box selected.
     22* `latLim`: Vector of length = 2, with minimum and maximum latitude coordinates, in decimal degrees, of the bounding box selected.
     23* `season`: A vector of integers specifying the desired season (in months, January=1, etc.) of analysis. Options include a single month (as in the above example) or a standard season (e.g. `season = [12,1,2]` for standard Boreal winter, DJF).
     24* `year`: List of years to select. Note that in cases with year-crossing seasons (e.g. winter DJF, `season = [12,1,2]`, for a particular year period `year = [1981,1982,1983]`), by convention the first season would be DJF 1981/82.
     25* `leadMonth`: Lead month forecast time corresponding to the first month of the specified season. Note that `leadMonth = 1` for `season = [1]` (January) corresponds to the December initialization forecasts. In this way the effect of the lead time forecast in the analysis of a particular season can be analyzed by just changing this parameter.
     26
     27The output returned by the function consists of a list with the following elements providing the necessary information for data representation and analysis:
     28
     29* `VarName`: Character string indicating the variable long name, as defined in the vocabulary (see Table above)
     30* `VarUnits`: Character string. Units of the variable, as returned in `MemberData`
     31* `TimeStep`: A `difftime` class object. Indicates the time span of each forecast time
     32* `MemberData`: This is a list of length ''n'', where ''n'' = number of members of the ensemble selected by the `member` argument. Each element of the dataset is a 2-D matrix of ''i'' rows `x` ''j'' columns, of ''i'' forecast times and ''j'' grid-points
     33* `LatLonCoords`: A 2-D matrix of ''j'' rows (where ''j'' = number of grid points selected) and two columns corresponding to the latitude and longitude coordinates respectively.
     34* `RunDates`: A `POSIXlt` time object corresponding to the initialization times selected. There is an initialization time associated to each forecast time.
     35* `ForecastDates`: A list with two `POSIXlt` time elements of length ''i'', corresponding to the rows of each matrix in `MemberData`. The list contain tow elements:
     36    * `Start`: Starting times of the verification period of the variable
     37    * `End`: End time of the verification period of the variable
     38