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.

NISAR Pixel Conversion

NISAR Pixel Conversion

This notebook converts sample ground truth data coordinates (latitude and longitude) into corresponding NISAR raster pixel indices. Identifying the correct pixel location for each site allows direct extraction of NISAR data values at field observation points.

The workflow includes transforming geographic coordinates into the NISAR product’s coordinate system, locating the nearest raster pixel, and storing the associated row and column indices for analysis. The resulting site locations and pixel footprints are also visualized on an interactive Folium map to confirm alignment between ground sites and the NISAR raster grid.

Ground Truth Site

About Lake Afrera

Location and Setting

Lake Afrera (also known as Lake Giulietti) is located in northeastern Ethiopia within the Danakil Depression, one of the lowest and hottest places on Earth. The lake sits in the Afar Region, near the border with Eritrea, at an elevation of approximately −100 meters below sea level.

The Danakil Depression lies within the Afar Triple Junction, where the African, Arabian, and Somali tectonic plates are actively pulling apart. This rifting environment creates intense volcanic and geothermal activity throughout the region.

Why Lake Afrera Is Hypersaline?

Lake Afrera is a hypersaline lake, meaning its salinity is significantly higher than that of normal seawater. Its high salinity results from several factors:

  • Closed basin hydrology: The lake has no outlet to the ocean, so dissolved salts accumulate over time.

  • Extreme evaporation: The Danakil Depression experiences very high temperatures and low rainfall, causing water to evaporate rapidly.

  • Hydrothermal inputs: Nearby geothermal systems and volcanic activity contribute mineral-rich fluids.

As water evaporates, salts such as halite (sodium chloride) precipitate and form crusts and salt flats around the lake margins. These processes create strong contrasts in surface roughness and reflectivity, which are visible in radar imagery.

Surface Features and Radar Relevance

Lake Afrera and its surrounding landscape display strong contrasts in surface texture that are particularly visible in radar data. The region includes open water (typically dark in radar imagery), bright salt crusts and evaporite deposits, mud flats that vary seasonally, and geometric salt extraction ponds.

The lake is also bordered by volcanic cones, basaltic lava flows, and geothermal areas associated with the Afar rift system. This mix of water, salt, sediment, and volcanic rock creates a highly heterogeneous surface within a relatively small area.

These sharp contrasts in roughness, moisture, and dielectric properties make Lake Afrera an excellent natural laboratory for studying radar backscatter variability and polarization-dependent scattering behavior.

Optical satellite image of Lake Afrera and surrounding geolgical features

Optical satellite image of Lake Afrera and surrounding geolgical features: https://science.nasa.gov/photojournal/lake-afrera-ethiopia/

2. Download a NISAR GCOV HDF5 file and Define Sites

2a. Search for NISAR data

EDL Username aflewandowski
EDL Password ········
['https://nisar.asf.earthdatacloud.nasa.gov/NISAR/NISAR_L2_GCOV_PROVISIONAL_V1/NISAR_L2_PR_GCOV_006_172_A_008_2005_DHDH_A_20251204T024618_20251204T024653_P05023_N_F_J_001/NISAR_L2_PR_GCOV_006_172_A_008_2005_DHDH_A_20251204T024618_20251204T024653_P05023_N_F_J_001.h5']

2b. Retain only the URL for the most recent version of each product in the search results

Data is occasionally re-released with an updated version. Versions are recorded as a Composite Release Identifier (CRID) in a product’s filename. We can use the CRID to retain only the most recent version of each product in the list of URLs.

Retained 1 GCOV products:
['https://nisar.asf.earthdatacloud.nasa.gov/NISAR/NISAR_L2_GCOV_PROVISIONAL_V1/NISAR_L2_PR_GCOV_006_172_A_008_2005_DHDH_A_20251204T024618_20251204T024653_P05023_N_F_J_001/NISAR_L2_PR_GCOV_006_172_A_008_2005_DHDH_A_20251204T024618_20251204T024653_P05023_N_F_J_001.h5']

2c. Download the data

data_dir: /Users/aflewandowski/GCOV_data_pixel_conversion_example

3. Locate Relevant GCOV data

Navigate to the grids group in the HDF5 file to select frequency and polarization.

File: /Users/aflewandowski/GCOV_data_pixel_conversion_example/NISAR_L2_PR_GCOV_006_172_A_008_2005_DHDH_A_20251204T024618_20251204T024653_P05023_N_F_J_001.h5
Grid group: /science/LSAR/GCOV/grids/frequencyA
Current raster layer: /science/LSAR/GCOV/grids/frequencyA/HHHH

Available GCOV datasets:
  HHHH
  HVHV
  inputDataExceptionMask
  listOfCovarianceTerms
  listOfPolarizations
  mask
  numberOfLooks
  numberOfSubSwaths
  projection
  rtcGammaToSigmaFactor
  xCoordinateSpacing
  xCoordinates
  yCoordinateSpacing
  yCoordinates

4. Identify the coordinate system used by GCOV

Extract coordinate system, raster size, and pixel size.

GCOV coordinate system (EPSG): 32637
Raster size: 16704 rows x 17064 columns
Pixel size: 20.0 m (x) × -20.0 m (y)

5. Convert ground truth site locations to GCOV pixel coordinates

5a. Define ground truth site coordinates

5b. Convert Lake Afrera site coordinates to GCOV pixel coordinates.

{'Salt_Ponds': (6090, 4823), 'Hypersaline_Lake': (6080, 5087), 'Afdera_Volcano': (7034, 4838), 'Sand_Plains': (5978, 4583), 'Afdera_Lava_Field': (7017, 4151), 'Borawli_Caldera': (5835, 5573), 'Borawli_Lava_Field': (6309, 5527)}

6. Create Folium map

This map will contain:

  • HHHH overlay + HVHV overlay

  • ground truth site markers (blue)

  • GCOV pixel footprints (yellow)

  • Additional tools: measure tool, mouse coordinates, layer toggle

This code uses the following variables from previous cells:

  • h5_path, grid_grp, epsg, x, y, dx, dy, sites, site_pixels

Stretched display range (2–98% percentile):
vmin = 0.0013829511404037475
vmax = 0.3670799255371082

Loading...
Loading...

Summary

You have now opened and navigated an HDF5 file, and converted ground truth coordinates to pixel coordinates. Lastly, you have created a Folium map showing ground truth points, pixel footprints and two radar backscatter layers.

12. Resources and references

Authors: Julia White, Alex Lewandowski

References
  1. Bonatti, E., Gasperini, E., Vigliotti, L., Lupi, L., Vaselli, O., Polonia, A., & Gasperini, L. (2017). Lake Afrera, a structural depression in the Northern Afar Rift (Red Sea). Heliyon, 3(5), e00301. 10.1016/j.heliyon.2017.e00301