コード例 #1
0
ファイル: sundriver.py プロジェクト: jadelson/suntanspy
 def _dumpic(self):
     """
     Dump initial condition plots
     
     For each variable (uc,vc,T,S,eta):
         - surface plot
         - seabed plot
     """
     
     varnames = ['uc','vc','temp','salt','eta']
     
     sun = Spatial(self.suntanspath+'/'+self.icfile,klayer=[0])
     
     # Plot the surface variables
     for vv in varnames:
         h=plt.figure()
         sun.variable=vv
         sun.loadData()
         sun.clim = [sun.data.min(),sun.data.max()]
         sun.plot()            
         outfile = '%s/IC_%s_surface.png'%(self.plotdir,vv)
         sun.savefig(outfile)
         del h
         
     # Plot the seabed variables
     sun.klayer=[-1]
     for vv in varnames:
         h=plt.figure()
         sun.variable=vv
         sun.loadData()
         sun.clim = [sun.data.min(),sun.data.max()]
         sun.plot()
         outfile = '%s/IC_%s_seabed.png'%(self.plotdir,vv)
         sun.savefig(outfile)  
         del h
コード例 #2
0
ファイル: sundriver.py プロジェクト: VB6Hobbyst7/suntanspy
    def _dumpic(self):
        """
        Dump initial condition plots
        
        For each variable (uc,vc,T,S,eta):
            - surface plot
            - seabed plot
        """

        varnames = ['uc', 'vc', 'temp', 'salt', 'eta']

        sun = Spatial(self.suntanspath + '/' + self.icfile, klayer=[0])

        # Plot the surface variables
        for vv in varnames:
            h = plt.figure()
            sun.variable = vv
            sun.loadData()
            sun.clim = [sun.data.min(), sun.data.max()]
            sun.plot()
            outfile = '%s/IC_%s_surface.png' % (self.plotdir, vv)
            sun.savefig(outfile)
            del h

        # Plot the seabed variables
        sun.klayer = [-1]
        for vv in varnames:
            h = plt.figure()
            sun.variable = vv
            sun.loadData()
            sun.clim = [sun.data.min(), sun.data.max()]
            sun.plot()
            outfile = '%s/IC_%s_seabed.png' % (self.plotdir, vv)
            sun.savefig(outfile)
            del h
コード例 #3
0
Generates a series of animations
"""

from sunpy import Spatial
import numpy as np
import matplotlib.pyplot as plt

runname='SFBay3D'
ncfile = '%s/%s_0*.nc'%('data',runname)
k = 1 # depth layer

plt.figure()
sun = Spatial(ncfile,klayer=[k],variable='salt')
sun.tstep=np.arange(0,len(sun.time))
sun.loadData()
sun.clim = [28.0,32.0]
sun.animate(vector_overlay=False)
sun.saveanim('plots/%s_salt.mov'%runname)

sun.clim=None
plt.figure()
sun = Spatial(ncfile,klayer=[k],variable='uc')
sun.tstep=np.arange(0,len(sun.time))
sun.loadData()
sun.animate(vector_overlay=False)
sun.saveanim('plots/%s_uc.mov'%runname)

sun.clim=None
plt.figure()
sun = Spatial(ncfile,klayer=[k],variable='eta')
sun.tstep=np.arange(0,len(sun.time))