Changes between Version 41 and Version 42 of udg/ecoms


Ignore:
Timestamp:
Mar 14, 2013 7:10:10 PM (9 years ago)
Author:
antonio
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • udg/ecoms

    v41 v42  
    162162Note that the indices selected for the run coordinate correspond to the December initilizations (index positions 11, 23,...; note that indexes start in 0) and for the time coordinate correspond to January (positions, 31 to 62, in days after the run time). Note that the proper use of this service requires a full understanding of the data structure and, therefore, it is only advised for data exploration.
    163163
     164= Accessing to the Data portal using Python (Pydap version) = #ex.pydap
     165
     166{{{#!csh
     167[user@host ~]$ pip install Pydap
     168........................................................................
     169[user@host ~]$ python
     170Python 2.7.2 (default, Mar  3 2012, 10:45:44)
     171[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
     172Type "help", "copyright", "credits" or "license" for more information.
     173>>>
     174}}}
     175
     176{{{#!python
     177>>> from pydap.client import open_url
     178>>> dataset = open_url('http://username:password@www.meteo.unican.es/tds5/dodsC/system4/System4_Seasonal_15Members.ncml')
     179>>> print type(dataset)
     180<class 'pydap.model.DatasetType'>
     181>>> print dataset.keys()
     182['lat', 'lon', 'run', 'time', 'time1', 'time2', 'member', 'Maximum_temperature_at_2_metres_since_last_24_hours_surface', 'Minimum_temperature_at_2_metres_since_last_24_hours_surface', 'Mean_temperature_at_2_metres_since_last_24_hours_surface', 'Total_precipitation_surface', 'Mean_sea_level_pressure_surface']
     183>>> MN2T24 = dataset['Minimum_temperature_at_2_metres_since_last_24_hours_surface']
     184>>> print MN2T24.dimensions
     185('member', 'run', 'time', 'lat', 'lon')
     186>>> print MN2T24.shape
     187(15, 360, 215, 241, 480)
     188>>> arr = MN2T24[0,11:360:12,31:62,66,475]
     189>>> print numpy.squeeze(numpy.mean(arr,2))
     190[ 270.79171753  273.29437256  271.56661987  271.03707886  271.82745361
     191  272.49279785  271.48086548  268.59121704  271.53125     273.82156372
     192  270.99401855  274.23626709  270.99328613  271.56115723  273.98986816
     193  270.50756836  272.45046997  270.65560913  271.31182861  272.77200317
     194  273.4359436   271.85021973  273.39648438  274.16384888  269.98248291
     195  271.30166626  273.11950684  271.27301025  272.29147339  270.46688843]
     196}}}
    164197
    165198= Example of Data Analysis with `R` = #app1