diff --git a/examples/sea_ice_drift_FT_img1.png b/examples/sea_ice_drift_FT_img1.png index 757f710..6c36b9d 100644 Binary files a/examples/sea_ice_drift_FT_img1.png and b/examples/sea_ice_drift_FT_img1.png differ diff --git a/examples/sea_ice_drift_PM_img2.png b/examples/sea_ice_drift_PM_img2.png index f33faab..5e40771 100644 Binary files a/examples/sea_ice_drift_PM_img2.png and b/examples/sea_ice_drift_PM_img2.png differ diff --git a/examples/simple.py b/examples/simple.py index d502c20..b8cf864 100755 --- a/examples/simple.py +++ b/examples/simple.py @@ -67,13 +67,14 @@ # plot the projected image from the first SAR scene plt.imshow(s01, extent=[-3, 2, 86.4, 86.8], cmap='gray', aspect=12) # plot vectors of sea ice drift from Feature Tracking -plt.quiver(lon1ft, lat1ft, uft, vft, color='r', scale=0.7) +plt.quiver(lon1ft, lat1ft, uft, vft, color='r', + angles='xy', scale_units='xy', scale=0.5) # plot border of the second SAR scene plt.plot(lon2, lat2, '.-r') # set X/Y limits of figure plt.xlim([-3, 2]) plt.ylim([86.4, 86.8]) -plt.savefig('sea_ice_drift_FT_img1.png', dpi=75, bbox_inches='tight', pad_inches=0) +plt.savefig('sea_ice_drift_FT_img1.png', dpi=150, bbox_inches='tight', pad_inches=0) plt.close('all') # plot the projected image from the second SAR scene @@ -81,11 +82,12 @@ # filter only high quality pixels gpi = rpm > 0.4 # plot vectors of sea ice drift from Feature Tracking, color by MCC -plt.quiver(lon1pm[gpi], lat1pm[gpi], upm[gpi], vpm[gpi], rpm[gpi], scale=0.7) +plt.quiver(lon1pm[gpi], lat1pm[gpi], upm[gpi], vpm[gpi], rpm[gpi], + angles='xy', scale_units='xy', scale=0.5) # plot border of the first SAR scene plt.plot(lon1, lat1, '.-r') # set X/Y limits of figure plt.xlim([-3, 2]) plt.ylim([86.4, 86.8]) -plt.savefig('sea_ice_drift_PM_img2.png', dpi=75, bbox_inches='tight', pad_inches=0) +plt.savefig('sea_ice_drift_PM_img2.png', dpi=150, bbox_inches='tight', pad_inches=0) plt.close('all') diff --git a/sea_ice_drift/lib.py b/sea_ice_drift/lib.py index a4b230c..d09037e 100755 --- a/sea_ice_drift/lib.py +++ b/sea_ice_drift/lib.py @@ -247,7 +247,7 @@ def get_drift_vectors(n1, x1, y1, n2, x2, y2, nsr=NSR(), **kwargs): lon2, lat2 = n2.transform_points(x2, y2) # create domain that converts lon/lat to units of the projection - d = Domain(nsr, '-te -100 -100 100 100 -tr 1 1') + d = Domain(nsr, '-te -10 -10 10 10 -tr 1 1') # find displacement in needed units x1, y1 = d.transform_points(lon1, lat1, 1) diff --git a/sea_ice_drift/tests.py b/sea_ice_drift/tests.py index 844695b..4066b99 100755 --- a/sea_ice_drift/tests.py +++ b/sea_ice_drift/tests.py @@ -186,7 +186,7 @@ def test_get_drift_vectors(self): def test_fill_gpi(self): a = np.array([[1,2,3],[1,2,3],[1,2,3]]) gpi = (a > 2) - b = _fill_gpi(a.shape, a[gpi].flatten(), gpi.flatten()) + b = _fill_gpi(a.shape, gpi.flatten(), a[gpi].flatten()) self.assertEqual(a.shape, b.shape) @@ -340,7 +340,8 @@ def test_integrated(self): s02 = sid.n2['sigma0_HV'] plt.imshow(s01, extent=[-3, 2, 86.4, 86.8], cmap='gray', aspect=12) - plt.quiver(lon1ft, lat1ft, uft, vft, color='r') + plt.quiver(lon1ft, lat1ft, uft, vft, color='r', + angles='xy', scale_units='xy', scale=0.5) plt.plot(lon2, lat2, '.-r') plt.xlim([-3, 2]) plt.ylim([86.4, 86.8]) @@ -350,7 +351,8 @@ def test_integrated(self): plt.imshow(s02, extent=[-3, 2, 86.4, 86.8], cmap='gray', aspect=12) gpi = rpm > 0.4 - plt.quiver(lon1pm[gpi], lat1pm[gpi], upm[gpi], vpm[gpi], rpm[gpi]) + plt.quiver(lon1pm[gpi], lat1pm[gpi], upm[gpi], vpm[gpi], rpm[gpi], + angles='xy', scale_units='xy', scale=0.5) plt.plot(lon1, lat1, '.-r') plt.xlim([-3, 2]) plt.ylim([86.4, 86.8]) diff --git a/setup.py b/setup.py index 46ba6b1..84427bb 100755 --- a/setup.py +++ b/setup.py @@ -1,10 +1,8 @@ from setuptools import setup -import_error_msg = "Sea Ice Drift requires %s, which should be installed separately" - setup( name = "sea_ice_drift", - version = "0.4", + version = "0.5", author = ('Anton Korosov', 'Stefan Muckenhuber'), author_email = "anton.korosov@nersc.no", description = ("Drift of sea ice from satellite data using feature tracking and pattern matching methods"), @@ -12,7 +10,7 @@ license = "GNU General Public License v3", keywords = "sar, feature tracking, pattern matching, ice drift", url = "https://github.com/nansencenter/sea_ice_drift", - download_url='https://github.com/nansencenter/sea_ice_drift/archive/v0.4.tar.gz', + download_url='https://github.com/nansencenter/sea_ice_drift/archive/v0.5.tar.gz', packages=['sea_ice_drift'], test_suite="sea_ice_drift.tests", classifiers=[