nansencenter / sea_ice_drift

Sea ice drift from Sentinel-1 SAR imagery using open source feature tracking
GNU General Public License v3.0
44 stars 18 forks source link

Vectors direction #8

Closed SAMPHY86 closed 7 years ago

SAMPHY86 commented 7 years ago

Hi, Thank you for resolving the last issue. Now I tried running sea_ice_drift with the supplied test data but it shows all vectors for FT and PM in one (u) direction

sea_ice_drift_ft_img1 sea_ice_drift_pm_img2

But when i multiplied the vft and vpm by a factor say 10, then it resembles the results provided on website

sea_ice_drift_ft_img3 sea_ice_drift_pm_img4

So is there any factor involves when try to plot the vectors? Many thanks, Usama

akorosov commented 7 years ago

Yes, there is. Please see the simple.py file in folder examples. https://github.com/nansencenter/sea_ice_drift/blob/add_mcc_functions/examples/simple.py It shows hot to correctly do quiver plot when lon and lat have different scales:

plt.quiver(lon1ft, lat1ft, uft, vft, color='r', angles='xy', scale_units='xy', scale=0.5)

On Aug 4, 2017 08:19, "SAMPHY86" notifications@github.com wrote:

Hi, Thank you for resolving the last issue. Now I tried running sea_ice_drift with the supplied test data but it shows all vectors for FT and PM in one (u) direction (see attachments) [image: sea_ice_drift_ft_img1] https://user-images.githubusercontent.com/29968261/28956019-7c530904-793e-11e7-98a6-2f8e6d4189ae.png [image: sea_ice_drift_pm_img2] https://user-images.githubusercontent.com/29968261/28956028-8570bd92-793e-11e7-8aa2-a9b447dc2fbe.png

But when i multiplied the vft and vpm by a factor say 10, then it resembles the results provided on website(see attachments) [image: sea_ice_drift_ft_img3] https://user-images.githubusercontent.com/29968261/28956104-05c9b444-793f-11e7-95e9-c7a1940487c7.png [image: sea_ice_drift_pm_img4] https://user-images.githubusercontent.com/29968261/28956111-0b4f5234-793f-11e7-989b-1acf761c13ff.png

So is there any scaling factor involve when try to plot the vectors? Many thanks, Usama

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nansencenter/sea_ice_drift/issues/8, or mute the thread https://github.com/notifications/unsubscribe-auth/AE_OY96glAT6jdOghiwfUsps74TDLbCmks5sUrfYgaJpZM4OtUeo .

SAMPHY86 commented 7 years ago

Many thanks for your response! I got everything to work with the test data. Now I downloaded sentinel-1 data from ESA and I did a calibration using the SNAP software. Having it exported as a geotiff, I realized that the header information is different from the one provided in the sample data. So when I run the program I get the error below. Can I use SNAP to export the data in the right format, or did you use a different software?

Traceback (most recent call last):
File "", line 1, in File "/home/ufa11/miniconda/lib/python2.7/site-packages/sea_ice_drift/seaicedrift.py", line 40, in init self.n1 = get_n(self.filename1, **kwargs) File "/home/ufa11/miniconda/lib/python2.7/site-packages/sea_ice_drift/lib.py", line 212, in get_n img = n[bandName] File "/home/ufa11/miniconda/lib/python2.7/site-packages/nansat/nansat.py", line 195, in getitem band = self.get_GDALRasterBand(bandID) File "/home/ufa11/miniconda/lib/python2.7/site-packages/nansat/nansat.py", line 1012, in get_GDALRasterBand bandNumber = self._get_band_number(bandID) File "/home/ufa11/miniconda/lib/python2.7/site-packages/nansat/nansat.py", line 1785, in _get_band_number % (str(bandID), self.vrt.dataset.RasterCount)) nansat.tools.OptionError: Cannot find band {'name': 'sigma0_HV'}! bandNumber is from 1 to 1

akorosov commented 7 years ago

It is better to have it as a separate issue. Nonetheless I can reply that I use Nansat for calibration of Sentinel-1 data. I'd also like to add that it is not strictly compulsory to use the SeaIceDrift class. In fact it was designed more for demonstration. You can use the function from ftlib and pmlib directly and be very flexible.