Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mortenwh committed Nov 6, 2024
1 parent 62e3160 commit 5fa3371
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 281 deletions.
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,49 @@
# py-sar-wind

Tools for SAR wind processing.

# Installation

Create conda environment:

```
conda env create -f sar-wind.yml
```

Activate the new environment:
```
conda activate sarwind
```

Install remaining dependencies:
```
pip install .
```

# Usage

Sentinel-1 Synthetic Aperture Radar (SAR) data can be found and downloaded from, e.g.,
https://colhub.met.no/#/home provided user registration.

Since wind direction cannot be estimated directly from the SAR Normalized Radar
Cross Section (NRCS), auxiliary wind direction data needs to be provided. This
can be, e.g., numerical weather forecast models such as MEPS and AROME-ARCTIC
in Norwegian areas and NCEP GFS globally, or reanalysis products like ERA5.

The simplest way to use py-sar-wind is to download a Sentinel-1 product, and
use the global NCEP GFS dataset to get wind directions:
```
from sarwind.sarwind import SARWind
model_fn = ("https://pae-paha.pacioos.hawaii.edu/thredds/dodsC/"
"ncep_global/NCEP_Global_Atmospheric_Model_best.ncd")
sar_fn = "S1A_EW_GRDM_1SDV_20241103T024443_20241103T024549_056384_06E87A_B5A4.zip"
w = SARWind(sar_fn, model_fn)
```

Quick look at the data:
```
from swutils.utils import plot_wind_map
plot_wind_map(w)
```
278 changes: 0 additions & 278 deletions nansat.yml

This file was deleted.

4 changes: 1 addition & 3 deletions sarvind.yml → sar-wind.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: nansat
name: sarwind
channels:
- conda-forge
- defaults
Expand Down Expand Up @@ -384,11 +384,9 @@ dependencies:
- ipdb==0.13.13
- ipython==8.12.3
- mccabe==0.7.0
- metvocab==1.1
- pluggy==1.4.0
- prompt-toolkit==3.0.43
- pure-eval==0.2.2
- py-mmd-tools==0.0.0
- pycodestyle==2.11.1
- pyflakes==3.2.0
- pytest==8.1.1
Expand Down
3 changes: 3 additions & 0 deletions swutils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def plot_wind_map(w, vmin=0, vmax=20, title=None):
add_colorbar=cb)
ax1.add_feature(cfeature.LAND, zorder=100, edgecolor='k')
ax1.gridlines(draw_labels=True)
ax1.title.set_text("NRCS")

# Wind direction
dir_from_band_no = w.get_band_number({"standard_name": "wind_from_direction"})
Expand Down Expand Up @@ -100,6 +101,7 @@ def plot_wind_map(w, vmin=0, vmax=20, title=None):
width=0.001)
ax2.add_feature(cfeature.LAND, zorder=100, edgecolor='k')
ax2.gridlines(draw_labels=True)
ax2.title.set_text("Model wind field")

# SAR wind
speed_band_no = w.get_band_number({"standard_name": "wind_speed",
Expand Down Expand Up @@ -128,6 +130,7 @@ def plot_wind_map(w, vmin=0, vmax=20, title=None):

ax3.add_feature(cfeature.LAND, zorder=100, edgecolor='k')
ax3.gridlines(draw_labels=True)
ax3.title.set_text("SAR wind speed")
# if title is None:
# plt.title('Wind on %s' % w.time_coverage_start.strftime('%Y-%m-%d'))

Expand Down

0 comments on commit 5fa3371

Please sign in to comment.