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

Add P3 examples #52

Merged
merged 30 commits into from
May 11, 2021
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2f39e0e
A first comparison with P3 humidity data
RobertPincus Apr 27, 2021
2e7e5e3
Further explanations about the P3 humidity comparison
RobertPincus Apr 27, 2021
3dbbe35
Update Python requirements. Add P3 description and photo
RobertPincus Apr 27, 2021
503f696
Add P-3 W-band radar example
RobertPincus Apr 27, 2021
12701c1
jpg -> jpeg. Having a local stack that worked would be helpful.
RobertPincus Apr 27, 2021
dee00e6
Adding figures showing AXBT and SWIFT measurements of ocean temperature
RobertPincus Apr 27, 2021
acac4cc
Adding cartopy for static maps
RobertPincus Apr 27, 2021
fd1a8cc
install cartopy via conda using an environment.yml file. Switch book-…
RobertPincus Apr 27, 2021
2b2e333
Code bug fix and more complete text for AXBTs
RobertPincus Apr 27, 2021
76a3936
Shorten titles
RobertPincus Apr 27, 2021
aa5e288
Add P3 WSRA example, update copyright year
RobertPincus Apr 27, 2021
145679d
Hide cells showing how to set up maps
RobertPincus Apr 27, 2021
31aa0e5
Get conda info to help debug CI
RobertPincus Apr 27, 2021
e3eb9c5
Explicitly activate conda environment
RobertPincus Apr 27, 2021
becf006
conda activate -> source activate
RobertPincus Apr 27, 2021
4830c7b
Need to specify bash perhaps
RobertPincus Apr 27, 2021
eb51a13
pylab inline -> matplotlib inline
RobertPincus Apr 28, 2021
1343992
Updating modules imported in P-3 examples. Not clear how this was wor…
RobertPincus Apr 28, 2021
b4df2c1
Add flight tracks
RobertPincus Apr 28, 2021
6bac1bb
Remove unneeded imports
RobertPincus Apr 30, 2021
9a1f4f7
Add cartopy to requirements.txt
RobertPincus Apr 30, 2021
869045c
Merge branch 'add-citations' into add-p3-examples
RobertPincus May 3, 2021
9bfaa05
Update P-3 page to use citations
RobertPincus May 3, 2021
1a6facc
Update local running info to describe conda use.
RobertPincus May 3, 2021
6d1dc76
Merge pull request #2 from eurec4a/master
RobertPincus May 3, 2021
82c3bee
Use book-wide style where possible
RobertPincus May 4, 2021
b58687c
Limit line lengths to 100 char (from review)
RobertPincus May 4, 2021
d82bef7
More graceful treatment of dates for P-3 flights,
RobertPincus May 4, 2021
c15adb9
Cleanup and one excellent efficiency suggestion from code review, tha…
RobertPincus May 5, 2021
c2d9e62
Merge remote-tracking branch 'upstream/master' into add-p3-examples
RobertPincus May 7, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add P3 WSRA example, update copyright year
RobertPincus committed Apr 27, 2021
commit aa5e288b8f5f064f14ceeafb228d6fe770e713ba
6 changes: 3 additions & 3 deletions how_to_eurec4a/_config.yml
Original file line number Diff line number Diff line change
@@ -5,9 +5,9 @@

#######################################################################################
# Book settings
title : How to EUREC4A # The title of the book. Will be placed in the left navbar.
author : EUREC4A community # The author of the book
copyright : "2020" # Copyright year to be placed in the footer
title : How to EUREC4A # The title of the book. Will be placed in the left navbar.
author : EUREC4A community # The author of the book
copyright : "2021" # Copyright year to be placed in the footer
logo : logo_pyeurec4a.png # A path to the book logo
repository:
url : https://github.com/eurec4a/how_to_eurec4a
1 change: 1 addition & 0 deletions how_to_eurec4a/_toc.yml
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@
- file: p3_humidity_comparison
- file: p3_wband_radar
- file: p3_AXBTs
- file: p3_wsra
- file: meteor
sections:
- file: meteor_cloudradar
127 changes: 127 additions & 0 deletions how_to_eurec4a/p3_wsra.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
---
jupytext:
text_representation:
extension: .md
format_name: myst
format_version: 0.12
jupytext_version: 1.7.1
kernelspec:
display_name: Python 3
language: python
name: python3
---

# WSRA example: surface wave state

During EUREC4A/ATOMIC the P-3 flew with a Wide Swath Radar Altimeter (WSRA),
a digital beam-forming radar altimeter operating at 16 GHz in the Ku band. It
generates 80 narrow beams spread over 30 deg to produce a topographic map of the
sea surface waves and their backscattered power. These measurements allow for
continuous reporting of directional ocean wave spectra and quantities derived from
this including significant wave height, sea surface mean square slope, and the
height, wavelength, and direction of propagation of primary and secondary wave fields.
WSRA measurements are processed by the private company [ProSensing](https://www.prosensing.com),
which designed and built the instrument.

The WSRA also produces rainfall rate estimates from path-integrated attenuation but
we won't look at those here.

The data are available through the EUREC4A intake catalog.

```{code-cell} ipython3
import xarray as xr
import matplotlib.pyplot as plt
import seaborn as sns
import colorcet as cc
%pylab inline

import eurec4a
cat = eurec4a.get_intake_catalog()
```

Mapping takes quite some setup. Maybe this should become part of the `eurec4a` Python module.

```{code-cell} ipython3
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
from matplotlib.offsetbox import AnchoredText

import cartopy as cp
import cartopy.crs as ccrs
import cartopy.feature as cfeature
from cartopy.feature import LAND
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER

from mpl_toolkits.axes_grid1.inset_locator import inset_axes
from mpl_toolkits.axes_grid1 import make_axes_locatable
def set_up_map(plt, lon_w = -60.5, lon_e = -49, lat_s = 10, lat_n = 16.5):
ax = plt.axes(projection=ccrs.PlateCarree())
# Defining boundaries of the plot
ax.set_extent([lon_w,lon_e,lat_s,lat_n]) # lon west, lon east, lat south, lat north
ax.coastlines(resolution='10m',linewidth=1.5,zorder=1);
ax.add_feature(LAND,facecolor='0.9')
return(ax)

def ax_to_map(ax, lon_w = -60.5, lon_e = -49, lat_s = 10, lat_n = 16.5):
# Defining boundaries of the plot
ax.set_extent([lon_w,lon_e,lat_s,lat_n]) # lon west, lon east, lat south, lat north
ax.coastlines(resolution='10m',linewidth=1.5,zorder=1);
ax.add_feature(LAND,facecolor='0.9')

def add_gridlines(ax):
# Assigning axes ticks
xticks = np.arange(-65,0,2.5)
yticks = np.arange(0,25,2.5)
gl = ax.gridlines(crs=ccrs.PlateCarree(), draw_labels=True,linewidth=1, color='black', alpha=0.5, linestyle='dotted')
gl.xlocator = mticker.FixedLocator(xticks)
gl.ylocator = mticker.FixedLocator(yticks)
gl.xformatter = LONGITUDE_FORMATTER
gl.yformatter = LATITUDE_FORMATTER
gl.xlabel_style = {'size': 10, 'color': 'k'}
gl.ylabel_style = {'size': 10, 'color': 'k'}
gl.right_labels = False
gl.bottom_labels = False
gl.xlabel = {'Latitude'}
```

We'll select an hour's worth of observations from a single flight day. WSRA data
are stored as "trajectories" - discrete times with associated positions and
observations.

```{code-cell} ipython3
wsra_example = cat.P3.wsra["P3-0119"].to_dask().sel(trajectory=slice(0,293))
```
Now it's interesting to see how the wave slope (top panel) and the wave height (bottom)
vary spatially on a given day.

```{code-cell} ipython3
fig, (ax1, ax2) = plt.subplots(nrows=2, sharex = True, figsize = (12,8), subplot_kw={'projection': ccrs.PlateCarree()})

#
# Mean square slope
#
ax_to_map(ax1, lon_e=-50, lon_w=-54.5, lat_s = 13, lat_n = 16)
add_gridlines(ax1)
pts = ax1.scatter(wsra_example.longitude,wsra_example.latitude,
c=wsra_example.sea_surface_mean_square_slope_median,
vmin = 0.02, vmax=0.04,
cmap=cc.cm.fire,
alpha=0.5,
transform=ccrs.PlateCarree(),zorder=7)
fig.colorbar(pts, ax=ax1, shrink=0.75, aspect=10, label="Mean Square Slope (rad$^2$)")
#
# Significant wave height
#
ax_to_map(ax2, lon_e=-50, lon_w=-54.5, lat_s = 13, lat_n = 16)
add_gridlines(ax2)
pts = ax2.scatter(wsra_example.longitude,wsra_example.latitude,
c=wsra_example.sea_surface_wave_significant_height,
vmin = 1, vmax=5,
cmap=cc.cm.bgy,
alpha=0.5,
transform=ccrs.PlateCarree(),zorder=7)
fig.colorbar(pts, ax=ax2, shrink=0.75, aspect=10, label="Significant Wave Height (m)")

plt.tight_layout()
```