Skip to content

Commit dac75ea

Browse files
author
adelepoulle
committed
merge
2 parents b0fbbf0 + 57c8faa commit dac75ea

File tree

15 files changed

+549
-370
lines changed

15 files changed

+549
-370
lines changed

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
# README #
44

5+
### Method ###
6+
7+
Method was described in :
8+
9+
[Mason, E., A. Pascual, and J. C. McWilliams, 2014: A new sea surface height–based code for oceanic mesoscale eddy tracking.](https://doi.org/10.1002/2016JC012611)
10+
11+
### Use case ###
12+
13+
Method is used in :
14+
15+
[Mason, E., A. Pascual, P. Gaube, S.Ruiz, J. Pelegrí, A. Delepoulle, 2017: Subregional characterization of mesoscale eddies across the Brazil-Malvinas Confluence](https://doi.org/10.1002/2016JC012611)
16+
517
### How do I get set up? ###
618

719
To avoid problems with installation, use of the virtualenv Python virtual environment is recommended.
@@ -35,7 +47,3 @@ EddyTracking tracking.yaml
3547
for tracking.
3648

3749

38-
# Py Eddy Tracker module #
39-
40-
### Grid manipulation ###
41-

setup.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@
77
name="pyEddyTracker",
88
version='3.0.0',
99
description="Py-Eddy-Tracker libraries",
10-
classifiers=['Development Status :: Alpha',
11-
'Topic :: Eddy',
10+
classifiers=['Development Status :: 3 - Alpha',
11+
'Topic :: Scientific/Engineering :: Physics',
1212
'Programming Language :: Python'],
1313
keywords='eddy science',
1414
author='emason',
1515
author_email='[email protected]',
1616
packages=find_packages('src'),
1717
package_dir={'': 'src'},
1818
scripts=[
19+
'src/scripts/GridFiltering',
1920
'src/scripts/EddyId',
2021
'src/scripts/EddyIdentification',
2122
'src/scripts/EddyTracking',
@@ -33,13 +34,16 @@
3334
ext_modules=[Extension("py_eddy_tracker.tools",
3435
["src/py_eddy_tracker/tools.pyx"],
3536
include_dirs=[numpy.get_include()])],
36-
package_data={'py_eddy_tracker.featured_tracking': ['*.nc', ]},
37+
package_data={
38+
'py_eddy_tracker.featured_tracking': ['*.nc'],
39+
'py_eddy_tracker': ['data/*.nc'],
40+
},
3741
setup_requires=[
3842
'numpy>=1.14'],
3943
install_requires=[
4044
'numpy>=1.14',
4145
# Bug with 1.5.1 (slow memory leak)
42-
'matplotlib>=2.0.0',
46+
# 'matplotlib>=2.0.0',
4347
'scipy>=0.15.1',
4448
'netCDF4>=1.1.0',
4549
'opencv-python',

share/fig.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
from matplotlib import pyplot as plt
2+
from py_eddy_tracker.dataset.grid import RegularGridDataset
3+
grid_name, lon_name, lat_name = 'nrt_global_allsat_phy_l4_20190223_20190226.nc', 'longitude', 'latitude'
4+
if False:
5+
6+
h = RegularGridDataset(grid_name, lon_name, lat_name)
7+
8+
fig = plt.figure(figsize=(14, 12))
9+
ax = fig.add_axes([.02, .51, .9, .45])
10+
ax.set_title('ADT (m)')
11+
ax.set_ylim(-75, 75)
12+
ax.set_aspect('equal')
13+
m = h.display(ax, name='adt', vmin=-1, vmax=1)
14+
ax.grid(True)
15+
plt.colorbar(m, cax=fig.add_axes([.94, .51, .01, .45]))
16+
h = RegularGridDataset(grid_name, lon_name, lat_name)
17+
h.bessel_high_filter('adt', 500, order=3)
18+
ax = fig.add_axes([.02, .02, .9, .45])
19+
ax.set_title('ADT Filtered (m)')
20+
ax.set_aspect('equal')
21+
ax.set_ylim(-75, 75)
22+
m = h.display(ax, name='adt', vmin=-.1, vmax=.1)
23+
ax.grid(True)
24+
plt.colorbar(m, cax=fig.add_axes([.94, .02, .01, .45]))
25+
fig.savefig('png/filter.png')
26+
27+
if True:
28+
import logging
29+
logging.getLogger().setLevel('DEBUG') # Values: ERROR, WARNING, INFO, DEBUG
30+
from datetime import datetime
31+
h = RegularGridDataset(grid_name, lon_name, lat_name)
32+
h.bessel_high_filter('adt', 500, order=3)
33+
# h.bessel_high_filter('adt', 300, order=1)
34+
date = datetime(2019, 2, 23)
35+
a, c = h.eddy_identification(
36+
'adt', 'ugos', 'vgos', # Variable to use for identification
37+
date, # Date of identification
38+
0.002, # step between two isolines of detection (m)
39+
# 0.02, # step between two isolines of detection (m)
40+
pixel_limit=(5, 2000), # Min and max of pixel can be include in contour
41+
shape_error=55, # Error maximal of circle fitting over contour to be accepted
42+
bbox_surface_min_degree=.125 ** 2, # degrees surface minimal to take in account contour
43+
)
44+
fig = plt.figure(figsize=(15,7))
45+
ax = fig.add_axes([.03,.03,.94,.94])
46+
ax.set_title('Eddies detected -- Cyclonic(red) and Anticyclonic(blue)')
47+
ax.set_ylim(-75,75)
48+
ax.set_xlim(0,360)
49+
ax.set_aspect('equal')
50+
a.display(ax, color='b', linewidth=.5)
51+
c.display(ax, color='r', linewidth=.5)
52+
ax.grid()
53+
fig.savefig('png/eddies.png')

0 commit comments

Comments
 (0)