Exemple #1
0
    def roms2boundary(self,romsfile,setUV=False,seth=False,**kwargs):
        """
        Interpolates ROMS data onto the type-3 boundary cells
        
        """
        import romsio

        # Include type 3 cells only
        roms = romsio.roms_interp(romsfile,self.xv,self.yv,-self.z,self.time,**kwargs)
        
        h, T, S, uc, vc = roms.interp(setUV=setUV,seth=seth)


        self.T+=T
        self.S+=S
        
        if seth:
            self.h+=h
        if setUV:
            self.uc+=uc
            self.vc+=vc

	####added by dongyu####
	#self.T=np.zeros_like(self.T)
	#self.S=np.zeros_like(self.S)
	self.uc=np.zeros_like(self.uc)
	self.vc=np.zeros_like(self.vc)
Exemple #2
0
    def roms2ic(self,romsfile,setUV=False,seth=False,**kwargs):
        """
        Interpolates ROMS data onto the SUNTANS grid
        """
        import romsio
        
        romsi = romsio.roms_interp(romsfile,self.xv.reshape((self.Nc,1)),\
            self.yv.reshape((self.Nc,1)),-self.z_r,[self.time,self.time],**kwargs)

        self.h, self.T, self.S, self.uc, self.vc = romsi.interp()
        
        if not setUV:
            self.uc *= 0 
            self.vc *= 0
        if not seth:
            self.h *= 0