Changes between Version 15 and Version 16 of udg/ecoms/dataserver/interfaces/python


Ignore:
Timestamp:
Feb 24, 2014 1:05:57 PM (8 years ago)
Author:
maru
Comment:

--

Legend:

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

    v15 v16  
    44A 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 ([browser:software/specseuporias/dataserver/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.
    55
    6 The request is simply formulated via the `load_system4` function:
     6The request is simply formulated via the `loadSystem4` function:
    77{{{
    8 >>> load_system4(dataset, var, season, leadMonth, lonLim, latLim, year, members=[])
     8>>> loadSystem4(dataset, var, season, leadMonth, lonlim, latlim, year, members=[])
    99}}}
    1010
     
    2222
    2323* `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).
    24 * `lonLim`: Vector of length = 2, with minimum and maximum longitude coordinates, in decimal degrees, of the bounding box selected.
    25 * `latLim`: Vector of length = 2, with minimum and maximum latitude coordinates, in decimal degrees, of the bounding box selected.
     24* `lonlim`: Vector of length = 2, with minimum and maximum longitude coordinates, in decimal degrees, of the bounding box selected.
     25* `latlim`: Vector of length = 2, with minimum and maximum latitude coordinates, in decimal degrees, of the bounding box selected.
    2626* `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).
    2727* `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.
     
    5353>>> password = "myPassword"
    5454>>> dataset = "http://%s:%s@www.meteo.unican.es/tds5/dodsC/system4/System4_Seasonal_15Members.ncml" %(username,password)
    55 >>> ud = loadSystem4(dataset,var,season, leadMonth,lonlim, latlim, year, members=[0])
     55>>> uds = loadSystem4(dataset,var,season, leadMonth,lonlim, latlim, year, members=[0])  # Note that this function returns a list
     56>>> ud=deepcopy(uds[0])
     57>>> ud.data = np.mean(map(lambda x:x.data, uds),axis=0)   # The ensemble mean, in case we select more than one member
    5658}}}
    5759