Personal tools
You are here: Home CDAT Tips and Tricks File I/O Tips Getting data in CDAT
Document Actions

Getting data in CDAT


  Table of Contents Previous Next
Contents Previous Next

Goal: Learn how get data in CDAT.

There are multiple ways to retrieve data for self describing data file types.

All the data

You can get all of it, omitting dimensions are retrieving entire variable with the name 'var'

import cdms
f = cdms.open('sample.nc')
s = f(‘var’)

Specific dimension

You can specify dimension type and values

s = f(‘var’, time=(time1,time2))
Known dimension types: time, level, latitude, longitude (t,z,y,x) .

 

Specific dimension names and values 

s = f(‘var’,dimname1=(val1,val2))
Sometimes indices are more useful than actual values

s = f(‘var’,time=slice(indice1,indice2,step))


  Table of Contents Previous Next
Contents Previous Next

Powered by Plone