Example #1
0
    def roms2boundary(self,romsfile,setUV=False,seth=False,**kwargs):
        """
        Interpolates ROMS data onto the type-3 boundary cells
        
        """
        # Include type 3 cells 
	if self.N3>0:
	    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

        # Include type 2 cells 
	if self.N2 > 0:
	    roms = romsio.roms_interp(romsfile,self.xe,self.ye,-self.z,self.time,**kwargs)
	    
	    h, T, S, uc, vc = roms.interp(setUV=setUV,seth=False)

	    self.boundary_T+=T
	    self.boundary_S+=S
	    
	    if setUV:
		self.boundary_u += uc
		self.boundary_v += vc
Example #2
0
    def roms2ic(self,romsfile,setUV=False,seth=False,**kwargs):
        """
        Interpolates ROMS data onto the SUNTANS grid
        """
        romsi = romsio.roms_interp(romsfile,self.xv.reshape((self.Nc,1)),\
            self.yv.reshape((self.Nc,1)),-self.z_r,[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