Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Exploring High-Impact Rainfall from Hurricane Ida’s Remnants with MPAS-Viewer (Part 2)

Overview

This notebook is a continuation of the notebook “Exploring High-Impact Rainfall from Hurricane Ida’s Remnants with MPAS-Viewer”. Here, we’re exploring how to create a spatial plot the temperature field, as well as selecting a single point to visualize different variables.

Imports

Data retrieval

Loading variables

/home/runner/micromamba/envs/mpasviewer-cookbook-dev/lib/python3.14/site-packages/mpasviewer/main.py:101: FutureWarning: In a future version of xarray the default value for data_vars will change from data_vars='all' to data_vars=None. This is likely to lead to different results when multiple datasets have matching variables with overlapping values. To opt in to new defaults and get rid of these warnings now use `set_options(use_new_combine_kwarg_defaults=True) or set data_vars explicitly.
  outgrid = xr.open_mfdataset(allfls, combine='nested', concat_dim='Time', decode_cf=True, mask_and_scale=False)
Loaded grid_file dataset: http://thredds.hydroshare.org/thredds/dodsC/hydroshare/resources/6be754bf29cb488b815810c35f3f0ac9/data/contents/nyc_static/nyc.static.nc

Loading our data

Loading...

Visualizing temperature data and creating a gif

Given that we’re going to plot temperatures, we will first define the colorbar and units we’re going to use.

/home/runner/micromamba/envs/mpasviewer-cookbook-dev/lib/python3.14/site-packages/cartopy/io/__init__.py:263: DownloadWarning: Downloading: https://naturalearth.s3.amazonaws.com/10m_physical/ne_10m_coastline.zip
  warnings.warn(f'Downloading: {url}', DownloadWarning)

Now, we make use of the image module under the Python Imaging Library, and retrieve all the figures we created in our previous step:

Lastly, we go ahead and create our animated image!

<IPython.core.display.Image object>

Figure 1. Two-meter temperature variation from 01 September 2021 00:00 UTC to 02 September 2021 23:00 UTC, with 1 hour step progressions.

Exploring other variables at a set location

Oftentimes, researchers need to compare modelled data with observational data (or data from other sources) for their studies. Therefore, it is important to know how to select a point within an MPAS-A output.

Remember: MPAS-A utilizes an unstructured Voronoi mesh. For mapping information of a specific point (given its latitude and longitude), a cellid can be used. Cellid’s are a unique index number for each of the hexagonal cells that compose the MPAS gridded structure.

The point we want to analyze can be seen through this map:

/home/runner/micromamba/envs/mpasviewer-cookbook-dev/lib/python3.14/site-packages/cartopy/io/__init__.py:263: DownloadWarning: Downloading: https://naturalearth.s3.amazonaws.com/10m_physical/ne_10m_land.zip
  warnings.warn(f'Downloading: {url}', DownloadWarning)
/home/runner/micromamba/envs/mpasviewer-cookbook-dev/lib/python3.14/site-packages/cartopy/io/__init__.py:263: DownloadWarning: Downloading: https://naturalearth.s3.amazonaws.com/10m_physical/ne_10m_ocean.zip
  warnings.warn(f'Downloading: {url}', DownloadWarning)
/home/runner/micromamba/envs/mpasviewer-cookbook-dev/lib/python3.14/site-packages/cartopy/io/__init__.py:263: DownloadWarning: Downloading: https://naturalearth.s3.amazonaws.com/10m_cultural/ne_10m_admin_0_boundary_lines_land.zip
  warnings.warn(f'Downloading: {url}', DownloadWarning)
/home/runner/micromamba/envs/mpasviewer-cookbook-dev/lib/python3.14/site-packages/cartopy/io/__init__.py:263: DownloadWarning: Downloading: https://naturalearth.s3.amazonaws.com/10m_cultural/ne_10m_admin_1_states_provinces_lakes.zip
  warnings.warn(f'Downloading: {url}', DownloadWarning)
<Figure size 800x800 with 1 Axes>

Figure 2. Spatial location of the point under analysis.

We now identify the cellid that’s linked to the longitude and latitude we want to analyze by using the mpasviewer function latlon2cellid:

23160

Rain rate time series

Now that our cell has been identified, we go ahead and retrieve rain rate data for that specific cell:

And now, we can now plot the rain rate for our specific cell!

<Figure size 640x480 with 1 Axes>

Figure 3. Temporal distribution of rain rate for the selected location. On 01 September, two relatively small increments in rain rates can be observed, while a considerable peak is detected on 02 September, with a value nearing the 60 mm mark.

Temperature time series

The same logic can be applied for any other variable that we want to analyze. Here, we will look at the variation in temperatures through time for our specific location:

<Figure size 640x480 with 1 Axes>

Figure 4. Temporal distribution of the 2-meter temperature for the selected location. A considerably large decrease in temperatures is observed on 02 September 04:00 UTC, time at which the largest rain rate (Fig. 3) was observed.

Vertical wind profile

From our dataset, we can also obtain the vertical distribution of zonal winds for our selected location. Here, we first isolate our variable uzonal for our specific cellid:

We can now set our y axis as the pressue levels to obtain a vertical profile:

<Figure size 640x480 with 2 Axes>

Figure 5. Time series of the zonal component of the wind for different pressure levels.

<Figure size 640x480 with 1 Axes>

Figure

Loading...