def sigmatheta(s, t, p, pr=0): r""" :math:`\\sigma_{\\theta}` is a measure of the density of ocean water where the quantity :math:`\\sigma_{t}` is calculated using the potential temperature (:math:`\\theta`) rather than the in situ temperature and potential density of water mass relative to the specified reference pressure. Parameters ---------- s(p) : array_like salinity [psu (PSS-78)] t(p) : array_like temperature [:math:`^\\circ` C (ITS-90)] p : array_like pressure [db]. The shape can be "broadcasted" pr : number reference pressure [db], default = 0 Returns ------- sgmte : array_like density [kg m :sup:`3`] See Also -------- dens, sigma_t Notes ----- Density of Sea Water using UNESCO 1983 (EOS 80) polynomial. Examples -------- Data from Unesco Tech. Paper in Marine Sci. No. 44, p22 >>> import seawater.extras.sw_extras as swe >>> import seawater.csiro as sw >>> s = [0, 0, 0, 0, 35, 35, 35, 35] >>> t = sw.T90conv([0, 0, 30, 30, 0, 0, 30, 30]) >>> p = [0, 10000, 0, 10000, 0, 10000, 0, 10000] >>> swe.sigmatheta(s, t, p) array([ -0.157406 , -0.20476006, -4.34886626, -3.63884068, 28.10633141, 28.15738545, 21.72863949, 22.59634627]) References ---------- .. [1] Fofonoff, P. and Millard, R.C. Jr UNESCO 1983. Algorithms for computation of fundamental properties of seawater. UNESCO Tech. Pap. in Mar. Sci., No. 44, 53 pp. Eqn.(31) p.39. http://www.scor-int.org/Publications.htm .. [2] Millero, F.J., Chen, C.T., Bradshaw, A., and Schleicher, K. A new high pressure equation of state for seawater. Deap-Sea Research., 1980, Vol27A, pp255-264. doi:10.1016/0198-0149(80)90016-3 Modifications: Filipe Fernandes, 2010 10-01-26. Filipe Fernandes, first version. """ # Convert input to numpy arrays s, t, p, pr = np.asarray(s), np.asarray(t), np.asarray(p), np.asarray(pr) sgmte = sw.pden(s, t, p, pr) - 1000.0 return sgmte
def TS_diagram(ss,ts,ax,dlev=0.1): from seawater import csiro as sw from numpy import linspace,meshgrid,arange from pylab import clabel t= linspace(ts.min(), ts.max(), 30) s= linspace(ss.min(), ss.max(), 30) s2d,t2d = meshgrid(s,t) #ax.scatter(ss,ts,c=colors, s=size, facecolor=facecolor, edgecolor = 'none', marker = marker) h=ax.contour(s2d,t2d,sw.pden(s2d,t2d,s2d*0)-1000,levels=arange(20,30,dlev),colors='k') clabel(h,inline=1,fontsize=9,fmt='%3.1f') return
def TS_diagram(ss, ts, ax, dlev=0.1): from seawater import csiro as sw from numpy import linspace, meshgrid, arange from pylab import clabel t = linspace(ts.min(), ts.max(), 30) s = linspace(ss.min(), ss.max(), 30) s2d, t2d = meshgrid(s, t) #ax.scatter(ss,ts,c=colors, s=size, facecolor=facecolor, edgecolor = 'none', marker = marker) h = ax.contour(s2d, t2d, sw.pden(s2d, t2d, s2d * 0) - 1000, levels=arange(20, 30, dlev), colors='k') clabel(h, inline=1, fontsize=9, fmt='%3.1f') return