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.

Grid QC’d Dataset - Surface QUantitatIve pRecipitation Estimation (SQUIRE)

Imports


## You are using the Python ARM Radar Toolkit (Py-ART), an open source
## library for working with weather radar data. Py-ART is partly
## supported by the U.S. Department of Energy as part of the Atmospheric
## Radiation Measurement (ARM) Climate Research Facility, an Office of
## Science user facility.
##
## If you use this software to prepare a publication, please cite:
##
##     JJ Helmus and SM Collis, JORS 2016, doi: 10.5334/jors.119

ERROR 1: PROJ: proj_create_from_database: Open of /ccsopen/home/mgrover/mgrover/sail-radar-dev/share/proj failed

Retrieve List of Files (QC’d Data)

Load Data into Py-ART and Plot

(-20.0, 20.0)
<Figure size 360x360 with 2 Axes>

Grid Using Nearest Neighbor Interpolation

Setup a Helper Function and Configure our Grid

Once we setup our interpolation, we can compute the number of points for each extent

18 160 160

Create our Grid using grid_from_radars

Visualize our Grid

We start by converting our grid to xarray

<Figure size 432x288 with 2 Axes>

Determine the Lowest Height in Each Column

We plotted the lowest level (500 m) in the plot above. It would be more helpful to have data from the lowest data point (lowest z) in each column (across time, latitude, and longitude)

We start first by creating a new field in our dataset, height_expanded, which is a four-dimensional (time, z, x, y) vertical coordinate, with nan values where we have missing snow rate values.

Next, we find the index of the lowest value in this column, using the .argmin method, looking over the column (z)

Here is a plot of the lowest value height in the column for our domain:

**Notice how some values are the top of the column - 5000 m, whereas some of the values are close lowest vertical level, 500 m

<Figure size 432x288 with 2 Axes>

Apply this to our snow fields

We first check for snow fields in our dataset, by using the following list comprehension line:

['snow_rate_ws88diw', 'snow_rate_m2009_1', 'snow_rate_m2009_2', 'snow_rate_ws2012']

Next, we subset our dataset for only these fields and select our lowest z value (using the index we built before)

Visualize our closest-to-ground snow value

Now that we have the lowest vertical level in each column, let’s plot our revised maps, which only have dimensions:

  • time

  • latitude

  • longitude

<Figure size 432x288 with 2 Axes>
<Figure size 432x288 with 2 Axes>
<Figure size 432x288 with 2 Axes>
<Figure size 432x288 with 2 Axes>

Wrap this Up into a Function

Now that we have the full pipeline, let’s wrap this into a function!

Loop Through and Apply this Workflow

Now that we have our helper functions, we can apply our workflow to each file.

Finished writing: gridded-for-dan/gucxprecipradarcmacM1.c1.20220314-030920.gridded.nc
Finished writing: gridded-for-dan/gucxprecipradarcmacM1.c1.20220314-032520.gridded.nc
Finished writing: gridded-for-dan/gucxprecipradarcmacM1.c1.20220314-033040.gridded.nc
Finished writing: gridded-for-dan/gucxprecipradarcmacM1.c1.20220314-033600.gridded.nc
Finished writing: gridded-for-dan/gucxprecipradarcmacM1.c1.20220314-034120.gridded.nc
Finished writing: gridded-for-dan/gucxprecipradarcmacM1.c1.20220314-034640.gridded.nc
Finished writing: gridded-for-dan/gucxprecipradarcmacM1.c1.20220314-035720.gridded.nc