In [28]:
%matplotlib inline
import matplotlib.pyplot as plt
plt.rcParams['figure.figsize']=(15,15)

In [7]:
from nansat import Nansatmap
from openwind.sar_wind import SARWind

In [3]:
w = SARWind('/home/vagrant/data/S1A_EW_GRDM_1SDH_20150702T172954_20150702T173054_006635_008DA5_55D1.zip',
            pixel_size=5000, eResampleAlg=0)


06:25:13|40|nansat|_get_mapper|GDAL could not open /vagrant/S1A_EW_GRDM_1SDH_20150702T172954_20150702T173054_006635_008DA5_55D1.zip, trying to read with Nansat mappers...
ERROR:Nansat:GDAL could not open /vagrant/S1A_EW_GRDM_1SDH_20150702T172954_20150702T173054_006635_008DA5_55D1.zip, trying to read with Nansat mappers...
06:25:24|40|nansat|_get_mapper|GDAL could not open ncep_wind_online:201507021729, trying to read with Nansat mappers...
ERROR:Nansat:GDAL could not open ncep_wind_online:201507021729, trying to read with Nansat mappers...
2015-07-02 17:29:00
NRT GRIB file not available: ftp://ftp.ncep.noaa.gov/pub/data/nccf/com/gfs/prod/gfs.2015070218/gfs.t18z.master.grbf000.10m.uv.grib2
Downloading http://nomads.ncdc.noaa.gov/data/gfs4/201507/20150702/gfs_4_20150702_1800_000.grb2
Downloaded gfs_4_20150702_1800_000.grb2 to /home/vagrant/ncep_gfs_downloads
Time difference between SAR image and wind direction: 0.50 hours
SAR image time: 2015-07-02 17:29:54.066281
Wind dir time: 2015-07-02 18:00:00
Resizing SAR image to 500 m pixel size
Calculating SAR wind with CMOD...
Calculation time: 0:01:14.476225

In [4]:
print w


----------------------------------------
/vagrant/S1A_EW_GRDM_1SDH_20150702T172954_20150702T173054_006635_008DA5_55D1.zip
----------------------------------------
Mapper: s1a_l1
----------------------------------------
Band : 1 DN_HH
  SourceTransferType: UInt16
  name: DN_HH
  dataType: 6
  SourceFilename: /vsimem/O0EUFJTBZ1.vrt
  time: 2015-07-02T17:29:54.066281
  SourceBand: 1
Band : 2 DN_HV
  SourceTransferType: UInt16
  name: DN_HV
  dataType: 6
  SourceFilename: /vsimem/O0EUFJTBZ1.vrt
  time: 2015-07-02T17:29:54.066281
  SourceBand: 2
Band : 3 LUT_sigmaNought_HH
  dataType: 7
  SourceBand: 3
  name: LUT_sigmaNought_HH
  SourceFilename: /vsimem/O0EUFJTBZ1.vrt
  time: 2015-07-02T17:29:54.066281
Band : 4 LUT_noise_HH
  dataType: 7
  SourceBand: 4
  name: LUT_noise_HH
  SourceFilename: /vsimem/O0EUFJTBZ1.vrt
  time: 2015-07-02T17:29:54.066281
Band : 5 LUT_sigmaNought_HV
  dataType: 7
  SourceBand: 5
  name: LUT_sigmaNought_HV
  SourceFilename: /vsimem/O0EUFJTBZ1.vrt
  time: 2015-07-02T17:29:54.066281
Band : 6 LUT_noise_HV
  dataType: 7
  SourceBand: 6
  name: LUT_noise_HV
  SourceFilename: /vsimem/O0EUFJTBZ1.vrt
  time: 2015-07-02T17:29:54.066281
Band : 7 look_direction
  units: degrees
  colormap: jet
  short_name: sensor_azimuth
  dataType: 6
  long_name: Sensor Azimuth Angle
  standard_name: sensor_azimuth_angle
  SourceFilename: /vsimem/O0EUFJTBZ1.vrt
  time: 2015-07-02T17:29:54.066281
  minmax: 0 360
  SourceBand: 7
  wkv: sensor_azimuth_angle
  name: look_direction
Band : 8 sigma0_HH
  units: m/m
  colormap: gray
  short_name: sigma0
  dataType: 6
  polarization: HH
  long_name: Normalized Radar Cross Section
  standard_name: surface_backwards_scattering_coefficient_of_radar_wave
  suffix: HH
  SourceFilename: /vsimem/O0EUFJTBZ1.vrt
  time: 2015-07-02T17:29:54.066281
  minmax: 0 0.1
  SourceBand: 8
  wkv: surface_backwards_scattering_coefficient_of_radar_wave
  name: sigma0_HH
Band : 9 beta0_HH
  units: m/m
  colormap: gray
  short_name: beta0
  dataType: 6
  polarization: HH
  long_name: Reflectivity per unit area in slant range
  standard_name: surface_backwards_brightness_coefficient_of_radar_wave
  suffix: HH
  SourceFilename: /vsimem/O0EUFJTBZ1.vrt
  time: 2015-07-02T17:29:54.066281
  minmax: 0 0.1
  SourceBand: 9
  wkv: surface_backwards_brightness_coefficient_of_radar_wave
  name: beta0_HH
Band : 10 sigma0_HV
  units: m/m
  colormap: gray
  short_name: sigma0
  dataType: 6
  polarization: HV
  long_name: Normalized Radar Cross Section
  standard_name: surface_backwards_scattering_coefficient_of_radar_wave
  suffix: HV
  SourceFilename: /vsimem/O0EUFJTBZ1.vrt
  time: 2015-07-02T17:29:54.066281
  minmax: 0 0.1
  SourceBand: 10
  wkv: surface_backwards_scattering_coefficient_of_radar_wave
  name: sigma0_HV
Band : 11 beta0_HV
  units: m/m
  colormap: gray
  short_name: beta0
  dataType: 6
  polarization: HV
  long_name: Reflectivity per unit area in slant range
  standard_name: surface_backwards_brightness_coefficient_of_radar_wave
  suffix: HV
  SourceFilename: /vsimem/O0EUFJTBZ1.vrt
  time: 2015-07-02T17:29:54.066281
  minmax: 0 0.1
  SourceBand: 11
  wkv: surface_backwards_brightness_coefficient_of_radar_wave
  name: beta0_HV
Band : 12 incidence_angle
  units: degrees
  colormap: jet
  short_name: incidence_angle
  dataType: 7
  long_name: Incidence Angle
  standard_name: angle_of_incidence
  SourceFilename: /vsimem/O0EUFJTBZ1.vrt
  time: 2015-07-02T17:29:54.066281
  minmax: 0 90
  SourceBand: 12
  wkv: angle_of_incidence
  name: incidence_angle
Band : 13 elevation_angle
  name: elevation_angle
  dataType: 7
  SourceFilename: /vsimem/O0EUFJTBZ1.vrt
  time: 2015-07-02T17:29:54.066281
  SourceBand: 13
  wkv: angle_of_elevation
Band : 14 sigma0_VV
  units: m/m
  colormap: gray
  short_name: sigma0
  dataType: 6
  polarization: VV
  long_name: Normalized Radar Cross Section
  standard_name: surface_backwards_scattering_coefficient_of_radar_wave
  suffix: VV
  SourceFilename: /vsimem/O0EUFJTBZ1.vrt
  time: 2015-07-02T17:29:54.066281
  minmax: 0 0.1
  SourceBand: 14
  wkv: surface_backwards_scattering_coefficient_of_radar_wave
  name: sigma0_VV
Band : 15 winddirection
  units: degrees
  colormap: jet
  short_name: D
  dataType: 7
  long_name: Wind direction (from)
  standard_name: wind_from_direction
  SourceFilename: /vsimem/O0EUFJTBZ1.vrt
  time: 2015-07-02 18:00:00
  minmax: 0 360
  SourceBand: 15
  wkv: wind_from_direction
  name: winddirection
Band : 16 model_windspeed
  units: m s-1
  colormap: jet
  short_name: W
  dataType: 7
  long_name: Wind speed
  standard_name: wind_speed
  SourceFilename: /vsimem/O0EUFJTBZ1.vrt
  time: 2015-07-02 18:00:00
  minmax: 0 18
  SourceBand: 16
  wkv: wind_speed
  name: model_windspeed
Band : 17 windspeed
  units: m s-1
  colormap: jet
  short_name: W
  dataType: 7
  long_name: Wind speed
  standard_name: wind_speed
  wind_direction_time: 2015-07-02 18:00:00
  SourceFilename: /vsimem/O0EUFJTBZ1.vrt
  time: 2015-07-02 17:29:54.066281
  minmax: 0 18
  SourceBand: 17
  wkv: wind_speed
  name: windspeed
Band : 18 U
  units: m s-1
  colormap: jet
  short_name: U
  dataType: 7
  long_name: Eastward wind velocity
  standard_name: eastward_wind
  SourceFilename: /vsimem/O0EUFJTBZ1.vrt
  time: 2015-07-02 18:00:00
  minmax: -10 10
  SourceBand: 18
  wkv: eastward_wind
  name: U
Band : 19 V
  units: m s-1
  colormap: jet
  short_name: V
  dataType: 7
  long_name: Northward wind velocity
  standard_name: northward_wind
  SourceFilename: /vsimem/XL2W7ZZW8K.vrt
  time: 2015-07-02 18:00:00
  minmax: -10 10
  SourceBand: 1
  wkv: northward_wind
  name: V
----------------------------------------
Domain:[839 x 800]
----------------------------------------
Projection:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["unnamed",6378137,298.257223560493]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433]]
----------------------------------------
Corners (lon, lat):
	 ( -8.72,  69.54)  (  1.87,  70.48)
	 (-12.89,  72.95)  ( -0.28,  74.03)


In [26]:
u = w['U']
v = w['V']

In [38]:
nmap = Nansatmap(w)
nmap.quiver(u, v, step=(40, 20), scale=20)
nmap.drawgrid()