Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenWind incompatible with Nansat #37

Open
knutfrode opened this issue Apr 5, 2018 · 8 comments
Open

OpenWind incompatible with Nansat #37

knutfrode opened this issue Apr 5, 2018 · 8 comments

Comments

@knutfrode
Copy link
Contributor

I have made two local changes in sar_wind.py to be able to process wind:

  • replaced except OptionError: with except: after calls to aux_wind._get_band_number()
  • changed look_dir = self[self._get_band_number({'standard_name': 'sensor_azimuth_angle'})] to
    look_dir = self[self._get_band_number({'name':'look_direction'})] as standard_name sensor_azimuth_angle seems no more to be present for S1 files.

Wind is now produced, but results look very wrong, and sometimes gives coredumps.

@akorosov
Copy link
Member

akorosov commented Apr 5, 2018

I was comparing the output before and after the changes but I think they were identical.
I will take a close look at that.

@knutfrode
Copy link
Contributor Author

In the wind files we are using, wind components have standard_name x_wind, y_wind, whereas OpenWind first looks for eastwards_wind, northwards_wind and then falls back to test for x_wind, y_wind. It could be that these fallback tests are not robust enough in OpenWind(?)

@akorosov
Copy link
Member

akorosov commented Apr 5, 2018

The only difference I noticed was that in the band 'look_direction' these metadata have disappeared:

  units: degrees
  colormap: jet
  short_name: sensor_azimuth
  long_name: Sensor Azimuth Angle
  standard_name: sensor_azimuth_angle
  minmax: 0 360

This is obviously a bug. But is it this bug which causes problems in OpenWind now?

@knutfrode
Copy link
Contributor Author

This seems to be one part of the problem, as OpenWind expects metadata "standard_name: sensor_azimuth_angle"

But there seems also to be some issues around "eastwards_wind"/"x_wind". I tried to make a workaround, which apparently works, but erroneous output is produced (see attachment).
Processing worked fine until recently, so this must be due to some recent change in either OpenWind or Nansat.

openwind_wind_suspicious

@mortenwh
Copy link
Contributor

Regarding metadata; I have now checked two different datasets, and the get_metadata method fails for band metadata:

In [35]: n.get_metadata(1)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-35-1ea8cc3a52f2> in <module>()
----> 1 n.get_metadata(1)

/home/vagrant/miniconda/lib/python2.7/site-packages/nansat/nansat.pyc in get_metadata(self, key, band_id, bandID)
   1067                 metadata = metadata[key]
   1068             except KeyError:
-> 1069                 raise ValueError('%s does not have metadata %s' % (self.filename, key))
   1070 
   1071         return metadata

Serious Nansat bug needing immediate action..... I am working on some wind retrieval now, so will look for possible other issues as well but won't have time to look into s1...

@mortenwh
Copy link
Contributor

Forget the last comment. get_metadata works - just need to properly follow the docs...

@akorosov
Copy link
Member

I've fixed the issue with wkv and standard names. It is soon coming into the master version.

@knutfrode
Copy link
Contributor Author

knutfrode commented May 18, 2018

I tried again now with the latest master version of Nansat, and the develop-version of OpenWind, but keep getting errors like:
Cannot find band {'standard_name': 'eastward_wind'}! band_number is from 1 to 2

Does calculation of wind with OpenWind work for you, for wind files which contain x_wind instead of eastward_wind?
E.g. this dataset containing wind may be used for testing: http://thredds.met.no/thredds/catalog/meps25files/catalog.html?dataset=meps25files/meps_det_extracted_2_5km_latest.nc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants