Changes between Version 5 and Version 6 of udg/ecoms/dataserver/interfaces/python


Ignore:
Timestamp:
Apr 18, 2013 7:03:40 PM (9 years ago)
Author:
maru
Comment:

--

Legend:

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

    v5 v6  
     1
     2==  Function ==
     3
    14A 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.
    25
     
    2528* `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.
    2629
    27 The output returned by the function consists of a list of user data objects (one for each member that we have loaded) with the following methods that provide the necessary information for data representation and analysis:
     30The output returned by the function consists of a list of user data objects (one for each member loaded) with the following methods that provide the necessary information for data representation and analysis:
    2831
    2932* `ud.short_name`: Character string indicating the variable short name, as defined in the vocabulary (see Table above).
    3033* `ud.units`: Unicode text. Units of the variable.
    31 * `ud.times`: An array of datetime objects. Indicates the time span of each forecast time.
    32 * `ud.member`: This is a list of length ''n'', where ''n'' is the number of members of the ensemble selected by the `members` argument.
     34* `ud.times`: Array of datetime objects. It indicates the time span of each forecast time.
     35* `ud.member`: List of length ''n'', where ''n'' is the number of members of the ensemble selected by the `members` argument.
    3336* `ud.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 * `ud.runtime`: An array of datetime objects corresponding to the initialization times selected. There is an initialization time associated to each forecast time.
     37* `ud.runtime`: Array of datetime objects corresponding to the initialization times selected. There is an initialization time associated to each forecast time.
    3538* `ud.data`: A 2-D matrix of ''i'' rows and ''j'' columns, of ''i'' forecast times and ''j'' grid-points
     39
     40
     41
     42==  Example ==
     43
     44An illustrative example of the `load_system4` function is described in the next lines. We will retrieve System4 simulation data for the Iberian Peninsula, considering mean surface temperature for January and the first simulation member, for the 10-year period 1990-1999. It should be noted that the user must enter here his/her authorized username and password as character strings
     45{{{
     46>>> var = "tas"
     47>>> season = [1]
     48>>> leadMonth = 1 
     49>>> lonlim = [-10,5]
     50>>> latlim= [35,45]
     51>>> year=[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999]
     52>>> members=[0]
     53>>> dataset="http://%s:%s@www.meteo.unican.es/tds5/dodsC/system4/System4_Seasonal_15Members.ncml" %(username,password)
     54>>> uds = loadSystem4(dataset,var,season, leadMonth,lonlim, latlim, year, members=[0])
     55}}}
     56
    3657