diff --git a/CHANGES.txt b/CHANGES.txt index 2d57bb8..b7afafd 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,9 +1,14 @@ Changelog --------- +Version 0.2.4, 05-May-2015. + +* Added `woa_profile`. +* Re-write of `woa_subset` to use iris instead of Pandas. +* Deprecate 'state' option in soundspeed. + Version 0.2.3, 23-Jan-2015. -* Unpinned version in setup.py. * Several small bugs and typos fixes. Version 0.2.2, 18-Aug-2014. diff --git a/oceans/__init__.py b/oceans/__init__.py index 4a986f8..18e0ab2 100644 --- a/oceans/__init__.py +++ b/oceans/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -__version__ = '0.2.3' +__version__ = '0.2.4' __all__ = ['RPSstuff', 'datasets', diff --git a/oceans/datasets/datasets.py b/oceans/datasets/datasets.py index 36741bd..05d2495 100644 --- a/oceans/datasets/datasets.py +++ b/oceans/datasets/datasets.py @@ -7,7 +7,7 @@ # e-mail: ocefpaf@gmail # web: http://ocefpaf.tiddlyspot.com/ # created: 09-Sep-2011 -# modified: Mon 04 May 2015 02:30:43 PM BRT +# modified: Mon 04 May 2015 05:44:40 PM BRT # # obs: some Functions were based on: # http://www.trondkristiansen.com/?page_id=1071 @@ -92,8 +92,6 @@ def woa_subset(bbox=[2.5, 357.5, -87.5, 87.5], variable='temperature', ... gl.yformatter = LATITUDE_FORMATTER ... return fig, ax >>> # Extract a 2D surface -- Annual temperature climatology: - >>> import numpy as np - >>> import numpy.ma as ma >>> import matplotlib.pyplot as plt >>> from oceans.ff_tools import wrap_lon180 >>> from oceans.colormaps import cm, get_color @@ -154,7 +152,7 @@ def woa_subset(bbox=[2.5, 357.5, -87.5, 87.5], variable='temperature', cubes = iris.load_raw(url) cubes = [cube.intersection(longitude=(bbox[0], bbox[1]), latitude=(bbox[2], bbox[3])) for cube in cubes] - + cubes = iris.cube.CubeList(cubes) if full: return cubes else: @@ -225,7 +223,7 @@ def woa_profile(lon, lat, variable='temperature', clim_type='00', cubes = [extract_nearest_neighbour(cube, [('longitude', lon), ('latitude', lat)]) for cube in cubes] - + cubes = iris.cube.CubeList(cubes) if full: return cubes else: diff --git a/oceans/sw_extras/sw_extras.py b/oceans/sw_extras/sw_extras.py index a4d2d2a..00baa82 100644 --- a/oceans/sw_extras/sw_extras.py +++ b/oceans/sw_extras/sw_extras.py @@ -620,14 +620,6 @@ def psu2ppt(psu): psu ** 2 + a[6] * psu ** 2.5) -def swstate(): - pass - - -def adiabattempgrad(): - pass - - def soundspeed(S, T, D, equation='mackenzie'): """Various sound-speed equations. 1) soundspeed(s, t, d) returns the sound speed (m/sec) given vectors @@ -721,20 +713,6 @@ def soundspeed(S, T, D, equation='mackenzie'): C = ((C3 * P + C2) * P + C1) * P + C0 # SOUND SPEED RETURN. ssp = C + (A + B * SR + D * S) * S - elif equation == 'state': - raise TypeError("Not implemented!") - P = D - # Copied somewhat from program EOSSPEED.F - svan, sigma = swstate(S, T, P) - VOL = (1.) / (1000. + sigma) - # DV/DP|ADIA = (DV/DP) AT CONSTANT T + ADIA.LAPSE RATE * - # (DV/DT) AT CONSTANT P - # Note: factor of 10 is convert pressure from dB to Bars. - dVdP = swstate(S, T, P, 'dP') - dVdT = swstate(S, T, P, 'dT') - dVdPad = (dVdP + adiabattempgrad(S, T, P) * dVdT) * 10 - # C = V * SQRT ( 1/DV/DP| ADIA) - ssp = VOL * np.sqrt(np.abs((1.e5) / dVdPad)) else: raise TypeError('Unrecognizable equation specified: %s' % equation) return ssp