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.

Developers:

Other contributors:

What is UAVSAR?

UAVSAR is a low frequency plane-based synthetic aperture radar. UAVSAR stands for “Uninhabited Aerial Vehicle Synthetic Aperture Radar”. It captures imagery using a L-band radar. This low frequency means it can penetrate into and through clouds, vegetation, and snow.

frequency (cm)resolution (rng x azi m)Swath Width (km)PolarizationsLaunch date
L-band 231.8 x 5.516VV, VH, HV, HH2007

NASA SnowEx 2020 and 2021 UAVSAR Campaigns

During the winter of 2020 and 2021, NASA conducted an L-band InSAR timeseries across the Western US with the goal of tracking changes in SWE. Field teams in 13 different locations in 2020, and in 6 locations in 2021, deployed on the date of the flight to perform calibration and validation observations.


The site locations from the above map along with the UAVSAR defined campaign name and currently processed pairs of InSAR images for each site. Note that the image pair count may contain multiple versions of the same image and may increase as more pairs of images are processed by JPL. Also note that the Lowman campaign name is the wrong state when searching.

Site LocationCampaign NameImage Pairs
Grand MesaGrand Mesa, CO13
Boise River BasinLowman, CO17
Frazier Experimental ForestFraser, CO16
Senator Beck BasinIronton, CO9
East RiverPeeler Peak, CO4
Cameron PassRocky Mountains NP, CO15
Reynold CreekSilver City, ID1
Central Agricultral Research CenterUtica, MT2
Little Cottonwoody CanyonSalt Lake City, UT21
Jemez RiverLos Alamos, NM3
American River BasinEldorado National Forest, CA4
Sagehen CreekDonner Memorial State Park, CA4
Lakes BasinSierra National Forest, CA3

Why would I use UAVSAR?

UAVSAR works with low frequency radar waves. These low frequencies (< 3 GHz) can penetrate clouds and maintain coherence (a measure of radar image quality) over long periods. For these reasons, time series was captured over 13 sites as part of the winter of 2019-2020 and 2020-2021 for snow applications. Additionally the UAVSAR is awesome!

Accessing UAVSAR Images

UAVSAR imagery can be downloaded from both the JPL and Alaska Satellite Facility. However both provide the imagery in a binary format that is not readily usable or readable by GIS software or python libraries.

Data Download and Conversion with uavsar_pytools

uavsar_pytools (Github) is a Python package developed out of work started at SnowEx Hackweek 2021. It nativiely downloads, formats, and converts this data in analysis ready rasters projected in WSG-84 Lat/Lon (EPSG:4326. The data traditionally comes in a binary format, which is not injestible by traditional geospatial analysis software (Python, R, QGIS, ArcGIS). It can download and convert either individual images - UavsarScene or entire collections of images - UavsarCollection.

Netrc Authorization

In order to download uavsar images you will need a netrc file that contains your earthdata username and password. If you need to register for a NASA earthdata account use this link. A netrc file is a hidden file, it won’t appear in the your file explorer, that is in your home directory and that programs can access to get the appropriate usernames and passwords. While you’ll have already done this for the Hackweek virtual machines, uavsar_pytools has a tool to create this netrc file on a local computer. You only need to create this file once and then it should be permanently stored on your computer.

Downloading and converting a single UAVSAR interferogram scene

You can find urls for UAVSAR images at the ASF vertex website. Make sure to change the platform to UAVSAR and you may also want to filter to ground projected interferograms.

/home/runner/micromamba/envs/snow-observations-cookbook/lib/python3.14/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
  from .autonotebook import tqdm as notebook_tqdm

Downloading and converting a full UAVSAR collection

If you want to download and convert an entire Uavsar collection for a larger analysis you can use UavsarCollection. The collection names for the SnowEx campaign are listed in the table in the introduction. The UavsarCollection can download either InSAR pairs and PolSAR images.

UAVSAR Data Products

UAVSAR has a variety of different type of images:

Repeat Pass Interferometric images contain:

UAVSAR repeat pass interferometry uses two images of the same place but separated in time. Phase changes between the two aquistions are calculated, creating a wrapped interferogram. These phase changes are due to either the wave traveling a longer distance (ground movement or refraction) or change wave speeds (atmospheric water vapor and snow).

  • GRD files (.grd): products projected to the ground in geographic coordinates (latitude, longitude) Finally all images can be in radar slant range or projected into WGS84. Images that have already been projected to ground range will have the extension .grd appended to their file type extension.

For instance a image of unwrapped phase that has not been georefenced would end with .unw, while one that was georeferenced would end with .unw.grd. You will generally want to use .grd files for most analysis.

Polarimetric PolSAR images contain:

  • ANN file (.ann): a text annotation file with metadata

  • Polsar file (HHVV.grd): all the rest of the files will be a pair of polarizations pushed together

Polsar files have a pair of polarizations (VV, VH, HV, HH) combined in their file name. These files are the phase difference between polarization XX and polarization YY. For instance HHHV is the phase difference between HH and HV polarizations. HVVV is the phase difference between HV and VV and so one. There are 6 of these pairs since order is irrelevant. These 6 images are combined to calculate various metrics that tell you about the types of scattering occurring.

Import Libraries

Loading...
Loading...
Loading...
Loading...

Interferometric Imagery

In this section we’ll be plotting and comparing dirrerent types of SAR and InSAR data with optical imagery and a digital elevation model. For this example we’ll be taking a subet of the Lowman flight (Boise, ID) line encompassing Banner Summit.

Access Tutorial Data from S3

The tutorial data is hosted on AWS S3 and can be accessed directly without downloading. The data will be streamed as needed using rioxarray.

Load in Rasters

Here we’ll load our rasters into the environemtns using rioxarray or rxa, we will then convert to a np.array to be able to use matplotlib.pyplot or plt for plotting

Optical Data

We will be using Haromized Landsat Sentinel (HLS) dataset from January 13th, 2021. This date was selected because it is mostly cloud free, which is uncommon in mountain environments during the winter.

What do we see in this image? Any notable features?

<Figure size 1500x1500 with 1 Axes>

InSAR and SAR Data

Here we’ll be using five different data products related to InSAR and SAR: unwrapped phase (unw), coherence (cor), amplitude (amp), elevation (dem), and incidence angle (inc).

<Figure size 1500x1500 with 2 Axes>
<Figure size 1500x1500 with 2 Axes>
<Figure size 1500x1500 with 2 Axes>
<Figure size 1500x1500 with 2 Axes>
<Figure size 1500x1500 with 2 Axes>

Comparison Plot

<Figure size 3000x1900 with 10 Axes>
<Figure size 700x700 with 1 Axes>

What are some notable similarities between images? Differences?

In the next section we’ll go into more detail about the features that impact coherence, phase, and how they’re related

Sagehen Creek Example

What topographic features seem to impact coherence?

Take a moment to chat with the people around you about this. Some features to get you thinking:

  • lakes

  • aspect (south vs north, east vs west)

  • elevation

  • trees

  • roads

  • others?

Loading...
<Figure size 1200x800 with 1 Axes>

UNW vs. Coherence

Loading...

Why would I use UAVSAR for snow?

L-band SAR penetrates through the snowpack. However when it crosses into the snowpack from the air it refracts at an angle, similar to light entering water. This refraction leads to a phase shift relative to an image with no or less snow. Using this difference in phase between two images we can calculate the change in snow height between flights using:

Δd=−Δϕλ4π1cos⁡α−ϵs−sin⁡2α\Delta d = - \frac{\Delta \phi \lambda}{4 \pi} \frac{1}{\cos^{ } \alpha - \sqrt{\epsilon_{s} - \sin^{2} \alpha}}

Where Δ\Delta d is the change in snow height, Δϕ\Delta \phi is the phase shift between two SAR images, λ\lambda is the radar wavelength, α\alpha is the incidence angle, and ϵs\epsilon_{s} is the dielectric constant of snow which is dependent on the density and liquid water content.

Set variables

Phase Change between February 1st and 13th UAVSAR Image Pairs

You learned in the first section how to access and download UAVSAR imagery. For this section the data has already been downloaded, converted to GeoTiffs and cropped down to an area of interest that overlaps the main field sites of Grand Mesa. Lets take a look at the coherence and unwrapped phase between these two flights. If you don’t remember what these two represent check out the previous section of this tutorial.

<Figure size 1200x800 with 4 Axes>
---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
File ~/micromamba/envs/snow-observations-cookbook/lib/python3.14/site-packages/contextily/tile.py:488, in _retryer(tile_url, wait, max_retries, headers, timeout)
    484 request = requests.get(
    485     tile_url, 
    486     headers={"user-agent": USER_AGENT, **headers},
    487     timeout=timeout)
--> 488 request.raise_for_status()
    489 with io.BytesIO(request.content) as image_stream:

File ~/micromamba/envs/snow-observations-cookbook/lib/python3.14/site-packages/requests/models.py:1167, in Response.raise_for_status(self)
   1166 if http_error_msg:
-> 1167     raise HTTPError(http_error_msg, response=self)

HTTPError: 404 Client Error: Not Found for url: https://basemap.nationalmap.gov/arcgis/rest/services/USGSImageryTopo/MapServer/tile/11/780/407

During handling of the above exception, another exception occurred:

HTTPError                                 Traceback (most recent call last)
Cell In[23], line 16
     12 ax.set_xlim(-108.4,-107.75)
     13 ax.set_ylim(38.75, 39.3)
     14 
     15 # Add background map
---> 16 cx.add_basemap(ax, crs='EPSG:4326', alpha = 0.8, source = cx.providers.USGS.USImageryTopo)
     17 plt.title('Overview Map')
     18 plt.show()

File ~/micromamba/envs/snow-observations-cookbook/lib/python3.14/site-packages/contextily/plotting.py:143, in add_basemap(ax, zoom, source, headers, interpolation, attribution, attribution_size, reset_extent, crs, resampling, zoom_adjust, timeout, **extra_imshow_args)
    139     left, right, bottom, top = _reproj_bb(
    140         left, right, bottom, top, crs, "epsg:3857"
    141     )
    142 # Download image
--> 143 image, extent = bounds2img(
    144     left,
    145     bottom,
    146     right,
    147     top,
    148     zoom=zoom,
    149     source=source,
    150     headers=headers,
    151     ll=False,
    152     zoom_adjust=zoom_adjust,
    153     timeout=timeout
    154 )
    155 # Warping
    156 if crs is not None:

File ~/micromamba/envs/snow-observations-cookbook/lib/python3.14/site-packages/contextily/tile.py:309, in bounds2img(w, s, e, n, zoom, source, headers, ll, wait, max_retries, n_connections, use_cache, zoom_adjust, timeout)
    305 preferred_backend = (
    306     "threads" if (n_connections == 1 or not use_cache) else "processes"
    307 )
    308 fetch_tile_fn = memory.cache(_fetch_tile) if use_cache else _fetch_tile
--> 309 arrays = Parallel(n_jobs=n_connections, prefer=preferred_backend)(
    310     delayed(fetch_tile_fn)(tile_url, wait, max_retries, headers, timeout=timeout) for tile_url in tile_urls
    311 )
    312 # merge downloaded tiles
    313 merged, extent = _merge_tiles(tiles, arrays)

File ~/micromamba/envs/snow-observations-cookbook/lib/python3.14/site-packages/joblib/parallel.py:2012, in Parallel.__call__(self, iterable)
   2010     output = self._get_sequential_output(iterable)
   2011     next(output)
-> 2012     return output if self.return_generator else list(output)
   2014 # Let's create an ID that uniquely identifies the current call. If the
   2015 # call is interrupted early and that the same instance is immediately
   2016 # reused, this id will be used to prevent workers that were
   2017 # concurrently finalizing a task from the previous call to run the
   2018 # callback.
   2019 with self._lock:

File ~/micromamba/envs/snow-observations-cookbook/lib/python3.14/site-packages/joblib/parallel.py:1940, in Parallel._get_sequential_output(self, iterable)
   1938 self.n_dispatched_batches += 1
   1939 self.n_dispatched_tasks += 1
-> 1940 res = func(*args, **kwargs)
   1941 self.n_completed_tasks += 1
   1942 self.print_progress()

File ~/micromamba/envs/snow-observations-cookbook/lib/python3.14/site-packages/joblib/memory.py:616, in MemorizedFunc.__call__(self, *args, **kwargs)
    614 def __call__(self, *args, **kwargs):
    615     # Return the output, without the metadata
--> 616     return self._cached_call(args, kwargs, shelving=False)[0]

File ~/micromamba/envs/snow-observations-cookbook/lib/python3.14/site-packages/joblib/memory.py:571, in MemorizedFunc._cached_call(self, args, kwargs, shelving)
    565     self.warn(
    566         f"Computing func {func_name}, argument hash {args_id} "
    567         f"in location {location}"
    568     )
    570 # Returns the output but not the metadata
--> 571 return self._call(call_id, args, kwargs, shelving)

File ~/micromamba/envs/snow-observations-cookbook/lib/python3.14/site-packages/joblib/memory.py:841, in MemorizedFunc._call(self, call_id, args, kwargs, shelving)
    839 self._before_call(args, kwargs)
    840 start_time = time.time()
--> 841 output = self.func(*args, **kwargs)
    842 return self._after_call(call_id, args, kwargs, shelving, output, start_time)

File ~/micromamba/envs/snow-observations-cookbook/lib/python3.14/site-packages/contextily/tile.py:339, in _fetch_tile(tile_url, wait, max_retries, headers, timeout)
    338 def _fetch_tile(tile_url, wait, max_retries, headers: dict[str, str], timeout=None):
--> 339     array = _retryer(tile_url, wait, max_retries, headers, timeout=timeout)
    340     return array

File ~/micromamba/envs/snow-observations-cookbook/lib/python3.14/site-packages/contextily/tile.py:498, in _retryer(tile_url, wait, max_retries, headers, timeout)
    496 except (requests.HTTPError, UnidentifiedImageError):
    497     if request.status_code == 404:
--> 498         raise requests.HTTPError(
    499             "Tile URL resulted in a 404 error. "
    500             "Double-check your tile url:\n{}".format(tile_url)
    501         )
    502     else:
    503         if max_retries > 0:

HTTPError: Tile URL resulted in a 404 error. Double-check your tile url:
https://basemap.nationalmap.gov/arcgis/rest/services/USGSImageryTopo/MapServer/tile/11/780/407
<Figure size 1200x800 with 1 Axes>

Using the SnowEx SQL Database to collect snow depth and lidar datasets

Lets explore how many overlapping depth observations we have between these two days. First we establish a connection to the database:

Next, we will find snow depth data in a 1 day window around our two campaign dates of Feb 1 and Feb 12, 2020:

Getting the remaining parameters

Incidence Angle

We can recall the formula to calculate snow depth change from incidence angle, phase change, and the snow permittivity.

Δd=−Δϕλ4π1cos⁡α−ϵs−sin⁡2α\Delta d = - \frac{\Delta \phi \lambda}{4 \pi} \frac{1}{\cos^{ } \alpha - \sqrt{\epsilon_{s} - \sin^{2} \alpha}}

We have two of these variables already: incidence angle and phase change.

Getting Permittivity

We have two ways of getting the ese_{s}, or the real part of the snow’s dielectric permittivity. One is by estimating from the snow density. For dry snow we can estimate the permittivity using the density. There are a number of equations for calculating this value, but we will use the equation from Guneriussen et al. 2001:

es=1+0.0016ρ+1.81e−9ρ3e_{s} = 1 + 0.0016 \rho + 1.8 1\mathrm{e}{-9} \rho^{3}

where ese_{s} is the real part of the snow’s dielectric permittivity and ρ\rho is the density of the new snow accumulated between the two images in kgm3\frac{kg}{m^{3}}.

The other method is to use the directly measured values for permittivity from the field and averaging the top layer.

Now we have a new snow permittivity (either from density or directly measured) and we can use that along with our unwrapped phase to calculate the Uavsar snow depth change.

Take a moment to code up the formula for snow depth change from phase and incidence angle:

Δd=−Δϕλ4π1cos⁡α−ϵs−sin⁡2α\Delta d = - \frac{\Delta \phi \lambda}{4 \pi} \frac{1}{\cos^{ } \alpha - \sqrt{\epsilon_{s} - \sin^{2} \alpha}}

Where Δ\Delta d is the change in snow height, Δϕ\Delta \phi is the phase shift between two SAR images, λ\lambda is the radar wavelength, α\alpha is the incidence angle, and ϵs\epsilon_{s} is the dielectric constant of snow which is dependent on the density and liquid water content.

Numerical Comparison

We can now extract the snow depth change at each measured point and compare them to the pit values of snow depth change.

Comparison to Lidar