Esempio n. 1
0
    def testVert(self):

        f = cdms2.open(
            os.path.join(cdat_info.get_sampledata_path(), 'vertical.nc'))
        Ps = f('PS')
        U = f('U')
        B = f('hybm')
        A = f('hyam')
        Po = f('variable_2')
        P = cdutil.reconstructPressureFromHybrid(Ps, A, B, Po)

        U2 = cdutil.logLinearInterpolation(U, P)
        U2b = cdutil.logLinearInterpolation(U, P, axis='0')
        self.assertTrue(numpy.ma.allclose(U2, U2b))
        U2b = cdutil.logLinearInterpolation(U, P, axis='(lev)')
        self.assertTrue(numpy.ma.allclose(U2, U2b))
Esempio n. 2
0
#!/usr/bin/env python
# Adapted for numpy/ma/cdms2 by convertcdms.py


import cdutil

import cdms2 as cdms,vcs,sys,os
import vcs.test.support
bg = vcs.test.support.bg

f = cdms.open(os.path.join(cdms.__path__[0],'..','..','..','..','sample_data','vertical.nc'))
Ps=f('PS')
U=f('U')
B=f('hybm')
A=f('hyam')
Po=f('variable_2')
P=cdutil.reconstructPressureFromHybrid(Ps,A,B,Po)

U2=cdutil.logLinearInterpolation(U,P)

x=vcs.init()
x.plot(U2,bg=bg)
vcs.test.support.check_plot(x)
Esempio n. 3
0
def create_P(ps,a,b,p0):
        P=cdu.reconstructPressureFromHybrid(ps,a,b,p0)
        return P
Esempio n. 4
0
#!/usr/bin/env python
# Adapted for numpy/ma/cdms2 by convertcdms.py

import cdutil, cdat_info

import cdms2
import os
bg = 0

f = cdms2.open(os.path.join(cdat_info.get_sampledata_path(), 'vertical.nc'))
Ps = f('PS')
U = f('U')
B = f('hybm')
A = f('hyam')
Po = f('variable_2')
P = cdutil.reconstructPressureFromHybrid(Ps, A, B, Po)

U2 = cdutil.logLinearInterpolation(U, P)

#x=vcs.init()
#x.plot(U2,bg=bg)
#raw_input()