Personal tools
You are here: Home CDAT Tips and Tricks File I/O Tips Extracting data at lat/lon point, reducing spurious dimentsions.
Document Actions

Extracting data at lat/lon point, reducing spurious dimentsions.


  Table of Contents Previous Next
Contents Previous Next

Goal: Learn how get data with specific latitude/longitude and reduce spurious, single dimentions.

 

To retrieve a point, you still should give the latitude as a range, ie. latitude=(50., 50., 'cob'). But if you do not want to retain the singleton dimentions ie. you do not want to retain the  latitude and longitude axes since they are a single point, use 'squeeze=1' keyword.

import cdms
f=cdms.open('sample.nc')
t_point_truly = f('t', latitude=(50.0, 50.0, 'cob'), \
longitude=(-120.0, -120.0, 'cob'), squeeze=1 )
print '\nShape of the variable t_point = ', t_point_truly.shape
print '\nThe information available for t_point_truly \n', t_point_truly.info()
f.close()


 
  Table of Contents Previous Next
Contents Previous Next

Powered by Plone