Ignore:
Timestamp:
17/03/08 14:59:30 (12 years ago)
Author:
spascoe
Message:

This branch contains CSML converted to use cdat_lite-5.

  • convertcdms was run on the source
  • the MA.set_print_limit call was changed to the numpy equivilent
  • The tests were changed to account for the existence of numpy scalar types.

All tests, except the two known to fail, pass on i686 ubuntu.

Location:
TI02-CSML/branches/csml-cdms2
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • TI02-CSML/branches/csml-cdms2/csmllibs/csmldataiface.py

    r3279 r3627  
    11#!/usr/bin/env python 
     2# Adapted for numpy/ma/cdms2 by convertcdms.py 
    23 
    34''' 
     
    1314 
    1415import pdb 
    15 import cdms  
    16 import Numeric 
     16import cdms2 as cdms  
     17import numpy.oldnumeric as Numeric 
    1718 
    1819try: 
     
    2425import csml.csmllibs.csmltime 
    2526# This is required to prevent Numeric arrays being truncated when printed. 
    26 import MA 
    27 MA.set_print_limit(0) 
     27import numpy.oldnumeric.ma as MA 
     28#MA.set_print_limit(0) 
     29import numpy; numpy.set_printoptions(threshold=0) 
    2830 
    2931# Generic mathematical expression solver, required by the raw and image 
    3032# interfaces 
    31 import NumericTransform 
     33import numpy.oldnumeric as NumericTransform 
    3234 
    3335try: 
     
    458460            try: 
    459461                attribValue=self.varobj._FillValue 
    460                 attribValue=attribValue.toscalar() 
     462                attribValue=attribValue.item() 
    461463            except: 
    462464                try: 
    463465                    attribValue=self.varobj.missing_value 
    464                     attribValue=attribValue.toscalar() 
     466                    attribValue=attribValue.item() 
    465467                except: 
    466468                    attribValue = None   
     
    543545                            longitudeAxis=subset1.getAxisIndex(lonkey) 
    544546                            #concatenate arrays along longitude               
    545                             subset = cdms.MV.concatenate([subset2,subset1],axis=longitudeAxis) 
     547                            subset = cdms.MV2.concatenate([subset2,subset1],axis=longitudeAxis) 
    546548                        except: 
    547549                            subset=subset1 
     
    646648        if 'endianess' in kwargs: 
    647649            if ((kwargs['endianness'] == 'little' and not Numeric.LittleEndian) or (kwargs['endianness'] == 'big' and Numeric.LittleEndian)): 
    648                 self.data = self.data.byteswapped()     
     650                self.data = self.data.byteswap()     
    649651        # Declare the shape of the array: 
    650652        dimensions = map(int,kwargs['dimensions']) 
Note: See TracChangeset for help on using the changeset viewer.