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)
Author:
maru
Comment:

--

Legend:

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

    v6 v7  
    11
    2 ==  Function ==
     2==  Function: ==
    33
    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 ([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.
     
    4040
    4141
    42 ==  Example ==
     42==  Example: ==
    4343
    44 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
     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.
    4545{{{
    4646>>> var = "tas"
     
    5252>>> members=[0]
    5353>>> 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])
     54>>> ud = loadSystem4(dataset,var,season, leadMonth,lonlim, latlim, year, members=[0])
    5555}}}
    5656
    57    
     57Data 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:
     58{{{
     59>>> temporal_mean=ud.data.mean(axis=0)
     60>>> plot_map(temporal_mean,ud,season,var)
     61}}}