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

Ignore:
Timestamp:
Apr 18, 2013 7:12:33 PM (9 years ago)
Comment:

--

### Legend:

Unmodified
 v6 ==  Function == ==  Function: == 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 ([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. ==  Example == ==  Example: == An 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 An 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. {{{ >>> var = "tas" >>> members=[0] >>> dataset="http://%s:%s@www.meteo.unican.es/tds5/dodsC/system4/System4_Seasonal_15Members.ncml" %(username,password) >>> uds = loadSystem4(dataset,var,season, leadMonth,lonlim, latlim, year, members=[0]) >>> ud = loadSystem4(dataset,var,season, leadMonth,lonlim, latlim, year, members=[0]) }}} Data is now loaded into the python session. One of the most common tasks consists on the representation of data, e.g. by mapping the spatial mean of the period under consideration. It can be done easily: {{{ >>> temporal_mean=ud.data.mean(axis=0) >>> plot_map(temporal_mean,ud,season,var) }}}