Changes between Version 15 and Version 16 of udg/ecoms/dataserver/interfaces/python
- Timestamp:
- Feb 24, 2014 1:05:57 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
udg/ecoms/dataserver/interfaces/python
v15 v16 4 4 A 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. 5 5 6 The request is simply formulated via the `load _system4` function:6 The request is simply formulated via the `loadSystem4` function: 7 7 {{{ 8 >>> load _system4(dataset, var, season, leadMonth, lonLim, latLim, year, members=[])8 >>> loadSystem4(dataset, var, season, leadMonth, lonlim, latlim, year, members=[]) 9 9 }}} 10 10 … … 22 22 23 23 * `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 * `lon Lim`: Vector of length = 2, with minimum and maximum longitude coordinates, in decimal degrees, of the bounding box selected.25 * `lat Lim`: 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. 26 26 * `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). 27 27 * `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. … … 53 53 >>> password = "myPassword" 54 54 >>> 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 56 58 }}} 57 59