Changes between Version 1 and Version 2 of udg/ecoms/dataserver/web


Ignore:
Timestamp:
Apr 1, 2013 5:31:17 AM (9 years ago)
Author:
gutierjm
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • udg/ecoms/dataserver/web

    v1 v2  
    3434
    3535Note 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.
    36 
    37 = Accessing to the Data portal using Python (Pydap version) = #ex.pydap
    38 
    39 [[NoteBox(warn,This section needs revision)]]
    40 
    41 {{{#!csh
    42 [user@host ~]$ pip install Pydap
    43 ........................................................................
    44 [user@host ~]$ python
    45 Python 2.7.2 (default, Mar  3 2012, 10:45:44)
    46 [GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
    47 Type "help", "copyright", "credits" or "license" for more information.
    48 >>>
    49 }}}
    50 
    51 {{{#!python
    52 >>> from pydap.client import open_url
    53 >>> dataset = open_url('http://username:password@www.meteo.unican.es/tds5/dodsC/system4/System4_Seasonal_15Members.ncml')
    54 >>> print type(dataset)
    55 <class 'pydap.model.DatasetType'>
    56 >>> print dataset.keys()
    57 ['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']
    58 >>> MN2T24 = dataset['Minimum_temperature_at_2_metres_since_last_24_hours_surface']
    59 >>> print MN2T24.dimensions
    60 ('member', 'run', 'time', 'lat', 'lon')
    61 >>> print MN2T24.shape
    62 (15, 360, 215, 241, 480)
    63 >>> arr = MN2T24[0,11:360:12,31:62,66,475]
    64 >>> print numpy.squeeze(numpy.mean(arr,2))
    65 [ 270.79171753  273.29437256  271.56661987  271.03707886  271.82745361
    66   272.49279785  271.48086548  268.59121704  271.53125     273.82156372
    67   270.99401855  274.23626709  270.99328613  271.56115723  273.98986816
    68   270.50756836  272.45046997  270.65560913  271.31182861  272.77200317
    69   273.4359436   271.85021973  273.39648438  274.16384888  269.98248291
    70   271.30166626  273.11950684  271.27301025  272.29147339  270.46688843]
    71 }}}