diff --git a/how_to_eurec4a/_toc.yml b/how_to_eurec4a/_toc.yml index 06c00eb..ee48950 100644 --- a/how_to_eurec4a/_toc.yml +++ b/how_to_eurec4a/_toc.yml @@ -13,6 +13,7 @@ chapters: - file: wales - file: hamp_comparison - file: cloudmasks + - file: specmacs_cloud_geometry - file: pthree sections: - file: p3_flight_tracks diff --git a/how_to_eurec4a/references.bib b/how_to_eurec4a/references.bib index c517c8d..477046a 100644 --- a/how_to_eurec4a/references.bib +++ b/how_to_eurec4a/references.bib @@ -154,3 +154,27 @@ @article{Gorsdorf:2015 issn = {0739-0572, 1520-0426}, doi = {10.1175/JTECH-D-14-00066.1} } + +@Article{Koelling:2019, + AUTHOR = {K\"olling, T. and Zinner, T. and Mayer, B.}, + TITLE = {Aircraft-based stereographic reconstruction of 3-D cloud geometry}, + JOURNAL = {Atmospheric Measurement Techniques}, + VOLUME = {12}, + YEAR = {2019}, + NUMBER = {2}, + PAGES = {1155--1166}, + URL = {https://amt.copernicus.org/articles/12/1155/2019/}, + DOI = {10.5194/amt-12-1155-2019} +} + +@Article{Poertge:2023, + AUTHOR = {P\"ortge, V. and K\"olling, T. and Weber, A. and Volkmer, L. and Emde, C. and Zinner, T. and Forster, L. and Mayer, B.}, + TITLE = {High-spatial-resolution retrieval of cloud droplet size distribution from polarized observations of the cloudbow}, + JOURNAL = {Atmospheric Measurement Techniques}, + VOLUME = {16}, + YEAR = {2023}, + NUMBER = {3}, + PAGES = {645--667}, + URL = {https://amt.copernicus.org/articles/16/645/2023/}, + DOI = {10.5194/amt-16-645-2023} +} diff --git a/how_to_eurec4a/specmacs_cloud_geometry.md b/how_to_eurec4a/specmacs_cloud_geometry.md index fde55ee..5697aec 100644 --- a/how_to_eurec4a/specmacs_cloud_geometry.md +++ b/how_to_eurec4a/specmacs_cloud_geometry.md @@ -1,15 +1,31 @@ +--- +jupytext: + text_representation: + extension: .md + format_name: myst + format_version: 0.13 + jupytext_version: 1.14.7 +kernelspec: + display_name: Python 3 + language: python + name: python3 +--- + # specMACS cloud geometry ++++ + In the following, an example of how to use the specMACS cloud geometry dataset will be shown. -The cloud geometry is retrieved by a stereographic feature matching method described by Kölling et al. 2019. -The algorithm is applied to the data of the two polarization resolving cameras of the instrument covering a large combined field of view of about $\pm 45° \times \pm 59°$ (along track $\times$ across track) (Pörtge et al. 2023). It is important to mention that no points found does not necessarily mean that no cloud has been observed as this can also happen if the cloud lacks in contrasts or due to a bad tracking of features. +The cloud geometry is retrieved by a stereographic feature matching method described by {cite:t}`Koelling:2019`. +The algorithm is applied to the data of the two polarization resolving cameras of the instrument covering a large combined field of view of about $\pm 45° \times \pm 59°$ (along track $\times$ across track) {cite:p}`Poertge:2023`. It is important to mention that no points found does not necessarily mean that no cloud has been observed as this can also happen if the cloud lacks in contrasts or due to a bad tracking of features. + ++++ ## Obtaining data In the following, we will use the `eurec4a` python package as well as `xarray` and `numpy`. - -```python +```{code-cell} ipython3 import eurec4a import xarray as xr import numpy as np @@ -20,13 +36,11 @@ import numpy as np The cloud geometry data were calculated for each of the flight segments flown by HALO seperately. The flight segmentation can be found in the respective [github repository](https://github.com/Smpljack/halo-flight-phase-separation). Therefore, we will start by extracting all the flight segments of HALO and load an example dataset for the straight leg `HALO-0205_sl1` flown on 2020-02-05. - -```python +```{code-cell} ipython3 all_flight_segments = eurec4a.get_flight_segments() ``` - -```python +```{code-cell} ipython3 segments_by_segment_id = { s["segment_id"]: { **s, @@ -39,446 +53,36 @@ segments_by_segment_id = { } ``` - -```python +```{code-cell} ipython3 segment = segments_by_segment_id['HALO-0205_sl1'] segment ``` - - - - {'segment_id': 'HALO-0205_sl1', - 'name': 'leg 1 outbound towards NTAS buoy', - 'start': datetime.datetime(2020, 2, 5, 12, 53, 40), - 'end': datetime.datetime(2020, 2, 5, 13, 19, 37), - 'kinds': ['straight_leg'], - 'irregularities': [], - 'dropsondes': {'GOOD': ['HALO-0205_s39'], 'BAD': [], 'UGLY': []}, - 'platform_id': 'HALO', - 'flight_id': 'HALO-0205'} - - - - -```python +```{code-cell} ipython3 cat = eurec4a.get_intake_catalog() ds = cat.HALO.specMACS.cloud_geometry[segment['segment_id']].to_dask() ds ``` - - - -
- - - - - - - - - - - - - - -
<xarray.Dataset>
-Dimensions:             (sample: 2392497, v: 3)
-Dimensions without coordinates: sample, v
-Data variables:
-    time                (sample) datetime64[ns] ...
-    lat                 (sample) float64 ...
-    lon                 (sample) float64 ...
-    height              (sample) float64 ...
-    height_above_geoid  (sample) float64 ...
-    loc                 (sample, v) float64 ...
-    viewpoint           (sample, v) float64 ...
-    max_misspointing    (sample) float32 ...
-Attributes:
-    _NCProperties:                   version=2,netcdf=4.7.3,hdf5=1.10.4
-    title:                           Stereographic retrieved cloud geometry b...
-    institution:                     Meteorological Institut, Ludwig-Maximili...
-    source:                          specMACS polcameras
-    history:                         Created 2023-05-13T18:57:20
-    references:                      Kölling, T., Zinner, T., and Mayer, B.: ...
-    comment:                         This dataset contains stereographically ...
-    contact:                         Lea Volkmer, L.Volkmer@physik.uni-muench...
-    DODS_EXTRA.Unlimited_Dimension:  sample
- - - ## Simple plots We will start to do some first simple scatter plots of the cloud top heights (CTH). There are two CTH variables in the dataset: A normal 'height' variable and a variable called 'height_above_geoid'. The first is defined with respect to the WGS84 ellipsoid and the second with respect to the EGM2008 geoid. Although there is not a large difference between both in the EUREC4A area, we will exemplarily plot both. - -```python +```{code-cell} ipython3 +%matplotlib inline import matplotlib.pyplot as plt import matplotlib from mpl_toolkits.axes_grid1 import make_axes_locatable ``` - -```python +```{code-cell} ipython3 #select only every 100th data point for a quick overview #(Attention: depending on the clouds there might be a lot of points in the dataset or not #such that this step might be useful or not) ds_sel = ds.isel(sample=np.arange(0, ds.sizes['sample'], 100)) ``` - -```python +```{code-cell} ipython3 #load the data variables lat = ds_sel['lat'].values lon = ds_sel['lon'].values @@ -486,8 +90,7 @@ height = ds_sel['height'].values height_above_geoid = ds_sel['height_above_geoid'].values ``` - -```python +```{code-cell} ipython3 #create norm for scatter plot cmap = 'OrRd' vmin = np.min([np.min(height), np.min(height_above_geoid)]) @@ -496,8 +99,7 @@ norm = matplotlib.colors.Normalize(vmin=vmin, vmax=vmax) sm = matplotlib.cm.ScalarMappable(norm=norm, cmap=cmap) ``` - -```python +```{code-cell} ipython3 fig, axs = plt.subplots(nrows=2, ncols=1, figsize=(20, 8), sharex=True) axs[0].scatter(lon, lat, c=height, marker='o', s=2, edgecolor=None, linewidth=0, norm=norm, cmap=cmap) axs[0].set_title('cloud top height above WGS84 in m') @@ -523,26 +125,15 @@ ax.legend() plt.colorbar(sm, ax=axs) ``` - - - - - -![png](specmacs_cloud_geometry_1.png) - - - ## Make a 3D plot As the stereo points are points on the cloud surface located in 3D space, we can also do a 3D plot. We will use a few different viewing settings, which can also be individually adjusted using the `elev` and `azim` arguments of the `ax.view_init` setting. - -```python +```{code-cell} ipython3 import matplotlib.ticker as ticker ``` - -```python +```{code-cell} ipython3 #settings for plots s = 0.1 #markersize cmap = 'viridis' #colormap @@ -552,8 +143,7 @@ norm = matplotlib.colors.Normalize(vmin=vmin, vmax=vmax) sm = matplotlib.cm.ScalarMappable(norm=norm, cmap=cmap) ``` - -```python +```{code-cell} ipython3 fig, axs = plt.subplots(2, 2, figsize=(14,12), subplot_kw=dict(projection='3d')) ax = axs[0,0] @@ -593,30 +183,22 @@ cax = plt.axes([0.95, 0.15, 0.05, 0.7]) fig.colorbar(sm, cax=cax, label='height above WGS84 [m]', fraction=0.02, shrink=2.0, aspect=40) ``` - - - - -![png](specmacs_cloud_geometry_2.png) - - - The 3D plots show the scene from different perspectives. It can be seen that the tracking algorithm finds points in both cloud layers down to a base height of approximately 1000m. Below, there are also some points which are probably outliers due to some wrong identifications. ++++ + ## Project points to specMACS measurements We will start to project the points found from the stereographic reconstruction to the specMACS maps which can be found [here](https://macsserver.physik.uni-muenchen.de/campaigns/EUREC4A/maps/). To do so, we need to import some further packages and we will define two functions to get the maps from the server. - -```python +```{code-cell} ipython3 from cartopy.io.img_tiles import GoogleWTS from PIL import Image import six import cartopy.crs as ccrs ``` - -```python +```{code-cell} ipython3 class DefaultTileWTS(GoogleWTS): def get_image(self, tile): if six.PY3: @@ -652,14 +234,12 @@ class specMACSPTiles(DefaultTileWTS): return f"https://macsserver.physik.uni-muenchen.de/campaigns/EUREC4A/maps/tiles/{self.flight_segment_id}/{z}/{x}/{y}.png" ``` - -```python +```{code-cell} ipython3 #get specMACS tile specmacs = specMACSPTiles(segment['segment_id']) ``` - -```python +```{code-cell} ipython3 #get vmin and vmax using quantiles such that outliers will not influence the colorbar too much q = 0.98 vmin = np.quantile(height, (1-q)/2) @@ -670,8 +250,7 @@ norm = matplotlib.colors.Normalize(vmin=vmin, vmax=vmax) sm = matplotlib.cm.ScalarMappable(norm=norm, cmap=cmap) ``` - -```python +```{code-cell} ipython3 fig = plt.figure(figsize=(16, 8), constrained_layout=True) ax = fig.add_subplot(1, 2, 1, projection=ccrs.PlateCarree()) ax.set_extent([np.floor(np.min(lon)), np.ceil(np.max(lon)), np.floor(np.min(lat)), np.ceil(np.max(lat))], crs=ccrs.PlateCarree()) @@ -685,17 +264,4 @@ im = ax.scatter(lon, lat, c=height, marker="o", s=0.4, edgecolor=None, linewidth fig.colorbar(im, label='height above WGS84 [m]', extend='both', shrink=0.4) ``` - - - - - -![png](specmacs_cloud_geometry_3.png) - - - The projection of the points to the specMACS map on the right shows that most of the clouds, in particular the small cumulus clouds are well identified and located by the stereographic reconstruction method. The only exception is the higher and thicker cloud toward the end of the leg. This cloud lacks contrasts such that only its edges are identified well by the tracking algorithm. - -### References: -- Kölling, T., Zinner, T., and Mayer, B.: Aircraft-based stereographic reconstruction of 3-D cloud geometry, Atmos. Meas. Tech., 12, 1155–1166, https://doi.org/10.5194/amt-12-1155-2019, 2019. -- Pörtge, V., Kölling, T., Weber, A., Volkmer, L., Emde, C., Zinner, T., Forster, L., and Mayer, B.: High-spatial-resolution retrieval of cloud droplet size distribution from polarized observations of the cloudbow, Atmos. Meas. Tech., 16, 645–667, https://doi.org/10.5194/amt-16-645-2023, 2023. diff --git a/how_to_eurec4a/specmacs_cloud_geometry_1.png b/how_to_eurec4a/specmacs_cloud_geometry_1.png deleted file mode 100644 index e32ea49..0000000 Binary files a/how_to_eurec4a/specmacs_cloud_geometry_1.png and /dev/null differ diff --git a/how_to_eurec4a/specmacs_cloud_geometry_2.png b/how_to_eurec4a/specmacs_cloud_geometry_2.png deleted file mode 100644 index 7fde3c8..0000000 Binary files a/how_to_eurec4a/specmacs_cloud_geometry_2.png and /dev/null differ diff --git a/how_to_eurec4a/specmacs_cloud_geometry_3.png b/how_to_eurec4a/specmacs_cloud_geometry_3.png deleted file mode 100644 index 55ba3ab..0000000 Binary files a/how_to_eurec4a/specmacs_cloud_geometry_3.png and /dev/null differ