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.

Loading bed picks and layer data

For workflows that primarily need surface, bed, or internal layer picks, this notebook demonstrates how to work with OPR layer picking information.

This example shows how to load bed picks for a region and grid them onto a regular grid using Verde.

(If your primary use case is plotting layers on top of a radargram you’ve already loaded, the demo_notebook.ipynb may be more useful to you.)

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

We’ll setup some useful backgrounds for context on our maps:

For this example, we’ll focus on a specific region. Feel free to try swapping this region out for any other, of course.

The Vincennes Bay area has some deep troughs that run across flow, making it an interesting area to loop at bed topography. This region is covered more extensively by UTIG data, which has only recently become available through OPR. Keep in mind that not all of this data yet has bed picks, as we’ll see below.

Loading...

Querying for bed picks starts the same as any other radar query. We’ll begin by fetching the STAC items corresponding to the radar data we want. As a reminder, this step doesn’t load any actual radar data yet -- we’re just getting the paths along which the radar data was collected.

Found 260 radar frames in the selected region.
Loading...
Loading...

Getting bed picks

Now that we’ve got our frames selected, we can load layer information for them. Layer information includes surface and bed and might come from the OPS API or from layerdata files hosted on OPR servers and indexed in the STAC catalog.

See https://gitlab.com/openpolarradar/opr/-/wikis/Layer-File-Guide

xOPR tries to abstract away the difference between the layer database and the layer files by formatting both to look like the layer files.

Loading...

We can now combine all of the layers to get a pointwise list of bed picks:

Loading...
Loading...

As you can see, many of the radar lines are (as of the time of writing) missing bed picks.

If you’re looking at the Vincennes Bay region, you’ll see the very deep trough running roughly grid top to bottom in the radar bed picks.

Gridding

What you want to do with the bed picks is, of course, up to you. One use case might be to aggregate these picks onto a common grid. We’ll show an example of that below:

Loading...

Bedmap Data Integration

The BedMap(1/2/3) datasets contain an enormous catalog of surface and bed picks. BedMap includes data from surveys that aren’t yet in the OPR catalog, while OPR has some radar data that hasn’t made it into BedMap. xopr provides unified access to bed picks from both sources.

The bedmap data is hosted on Source Cooperative at s3://us-west-2.opendata.source.coop/englacial/bedmap/. The query process works in two stages:

  1. STAC Catalog Query: Find GeoParquet files that intersect with the query geometry/time

  2. DuckDB Partial Reads: Fetch only relevant rows from those files using SQL pushdown

This approach minimizes data transfer - only the data you need is downloaded!

Querying STAC catalog for matching bedmap files...
Downloading bedmap catalogs to /home/runner/.cache/xopr/catalogs/bedmap...
Bedmap catalogs cached successfully

Found 12 matching files:
  - INGV_2003_Talos-Dome_AIR_BM3: 2,659,478 rows
  - NASA_2019_ICEBRIDGE_AIR_BM3: 1,395,747 rows
  - PRIC_2015_CHA1_AIR_BM3: 1,847,620 rows
  - PRIC_2016_CHA2_AIR_BM3: 1,003,471 rows
  - PRIC_2018_CHA4_AIR_BM3: 564,231 rows
  - RNRF_2004_Mirny-Vostok_AIR_BM3: 113,574 rows
  - RNRF_2006_Komsom-Vostok_AIR_BM3: 50,335 rows
  - RNRF_2010_RAE_AIR_BM3: 284,963 rows
  - RNRF_2019_RAE_AIR_BM3: 109,642 rows
  - UTIG_2010_ICECAP_AIR_BM3: 9,372,658 rows
  ... and 2 more

The cell above is a metadata query, and is optional-- you can just call query_bedmap by itself, which will automatically call query_bedmap_catalog to determine which files to access.

Querying bedmap data from cloud GeoParquet files...
Query region bounds: (93.52229764569263, -74.50810756296374, 120.28672809364954, -65.85007329101462)
Timing cloud-based query...
Found 12 matching files in catalog
Querying 12 GeoParquet files...
Retrieved 2,621,430 rows
Cloud query: 43.06s for 2,621,430 rows

Retrieved 2,621,430 points from bedmap

Columns available:
['trajectory_id', 'trace_number', 'surface_altitude (m)', 'land_ice_thickness (m)', 'bedrock_altitude (m)', 'two_way_travel_time (m)', 'aircraft_altitude (m)', 'along_track_distance (m)', 'timestamp', 'source_file', 'row', 'lon', 'lat']

First 5 rows:
Loading...

Cloud vs Local Cache Performance

For repeated queries or large datasets, you can use the local_cache option to download the GeoParquet files once and query them locally. This can provide significant speedups for subsequent queries-- though the exact speed up depends on your network connection and local disk speed.

Fetching bedmap catalogs to local cache...
bedmap3: Reading STAC catalog to get data file locations...
bedmap3: Found 84 data files to download
  Downloaded: AWI_2013_GEA-IV_AIR_BM3.parquet
  Downloaded: AWI_2014_Recovery-Glacier_AIR_BM3.parquet
  Downloaded: AWI_2015_GEA-DML_AIR_BM3.parquet
  Downloaded: AWI_2016_OIR_AIR_BM3.parquet
  Downloaded: AWI_2018_ANIRES_AIR_BM3.parquet
  Downloaded: AWI_2018_DML-Coast_AIR_BM3.parquet
  Downloaded: AWI_2018_JURAS_AIR_BM3.parquet
  Downloaded: AWI_2019_JURAS_AIR_BM3.parquet
  Downloaded: BAS_2007_Lake-Ellsworth_GRN_BM3.parquet
  Downloaded: BAS_2007_Rutford_GRN_BM3.parquet
  Downloaded: BAS_2008_Lake-Ellsworth_GRN_BM3.parquet
  Downloaded: BAS_2010_IMAFI_AIR_BM3.parquet
  Downloaded: BAS_2011_Adelaide_AIR_BM3.parquet
  Downloaded: BAS_2012_Castle_GRN_BM3.parquet
  Downloaded: BAS_2012_ICEGRAV_AIR_BM3.parquet
  Downloaded: BAS_2013_ISTAR_GRN_BM3.parquet
  Downloaded: BAS_2015_FISS_AIR_BM3.parquet
  Downloaded: BAS_2015_POLARGAP_AIR_BM3.parquet
  Downloaded: BAS_2016_FISS_AIR_BM3.parquet
  Downloaded: BAS_2017_English-Coast_AIR_BM3.parquet
  Downloaded: BAS_2018_Thwaites_AIR_BM3.parquet
  Downloaded: BAS_2019_Thwaites_AIR_BM3.parquet
  Downloaded: CECS_2006_Subglacial-Lake-CECs_GRN_BM3.parquet
  Downloaded: CRESIS_2009_AntarcticaTO_AIR_BM3.parquet
  Downloaded: CRESIS_2009_Thwaites_AIR_BM3.parquet
  Downloaded: CRESIS_2013_Siple-Coast_AIR_BM3.parquet
  Downloaded: INGV_1997_Talos-Dome_AIR_BM3.parquet
  Downloaded: INGV_1999_Talos-Dome_AIR_BM3.parquet
  Downloaded: INGV_2001_Talos-Dome_AIR_BM3.parquet
  Downloaded: INGV_2003_Talos-Dome_AIR_BM3.parquet
  Downloaded: KOPRI_2017_KRT1_AIR_BM3.parquet
  Downloaded: KOPRI_2018_KRT2_AIR_BM3.parquet
  Downloaded: LDEO_2015_ROSETTA_AIR_BM3.parquet
  Downloaded: NASA_2013_ICEBRIDGE_AIR_BM3.parquet
  Downloaded: NASA_2014_ICEBRIDGE_AIR_BM3.parquet
  Downloaded: NASA_2016_ICEBRIDGE_AIR_BM3.parquet
  Downloaded: NASA_2017_ICEBRIDGE_AIR_BM3.parquet
  Downloaded: NASA_2018_ICEBRIDGE_AIR_BM3.parquet
  Downloaded: NASA_2019_ICEBRIDGE_AIR_BM3.parquet
  Downloaded: NIPR_1992_JARE33_GRN_BM3.parquet
  Downloaded: NIPR_1996_JARE37_GRN_BM3.parquet
  Downloaded: NIPR_1999_JARE40_GRN_BM3.parquet
  Downloaded: NIPR_2007_JARE49_GRN_BM3.parquet
  Downloaded: NIPR_2007_JASE_GRN_BM3.parquet
  Downloaded: NIPR_2012_JARE54_GRN_BM3.parquet
  Downloaded: NIPR_2017_JARE59_GRN_BM3.parquet
  Downloaded: NIPR_2018_JARE60_GRN_BM3.parquet
  Downloaded: NPI_2012_ICERISES_GRN_BM3.parquet
  Downloaded: NPI_2015_POLARGAP_AIR_BM3.parquet
  Downloaded: NPI_2016_MADICE_GRN_BM3.parquet
  Downloaded: PRIC_2015_CHA1_AIR_BM3.parquet
  Downloaded: PRIC_2016_CHA2_AIR_BM3.parquet
  Downloaded: PRIC_2017_CHA3_AIR_BM3.parquet
  Downloaded: PRIC_2018_CHA4_AIR_BM3.parquet
  Downloaded: RNRF_1971_Lambert-Amery_SEI_BM3.parquet
  Downloaded: RNRF_1975_Filchner-Ronne_SEI_BM3.parquet
  Downloaded: RNRF_1975_Lazarev_SEI_BM3.parquet
  Downloaded: RNRF_2003_AMSap5_AIR_BM3.parquet
  Downloaded: RNRF_2004_AMSap5_AIR_BM3.parquet
  Downloaded: RNRF_2004_Mirny-Vostok_AIR_BM3.parquet
  Downloaded: RNRF_2005_AMSap5_AIR_BM3.parquet
  Downloaded: RNRF_2006_Komsom-Vostok_AIR_BM3.parquet
  Downloaded: RNRF_2006_RAEap5_AIR_BM3.parquet
  Downloaded: RNRF_2007_AMSap5_AIR_BM3.parquet
  Downloaded: RNRF_2008_AMSap5_AIR_BM3.parquet
  Downloaded: RNRF_2009_RAEap5_AIR_BM3.parquet
  Downloaded: RNRF_2010_RAE_AIR_BM3.parquet
  Downloaded: RNRF_2011_RAE_AIR_BM3.parquet
  Downloaded: RNRF_2013_RAE_AIR_BM3.parquet
  Downloaded: RNRF_2014_RAE_AIR_BM3.parquet
  Downloaded: RNRF_2015_RAE_AIR_BM3.parquet
  Downloaded: RNRF_2016_RAE_AIR_BM3.parquet
  Downloaded: RNRF_2017_RAE_AIR_BM3.parquet
  Downloaded: RNRF_2018_RAE_AIR_BM3.parquet
  Downloaded: RNRF_2019_RAE_AIR_BM3.parquet
  Downloaded: STANFORD_1971_SPRI-NSF-TUD_AIR_BM3.parquet
  Downloaded: ULB_2012_BEWISE_GRN_BM3.parquet
  Downloaded: ULB_2012_ICECON_GRN_BM3.parquet
  Downloaded: UTIG_2009_Darwin-Hatherton_AIR_BM3.parquet
  Downloaded: UTIG_2010_ICECAP_AIR_BM3.parquet
  Downloaded: UTIG_2013_GIMBLE_AIR_BM3.parquet
  Downloaded: UTIG_2015_EAGLE_AIR_BM3.parquet
  Downloaded: UTIG_2016_OLDICE_AIR_BM3.parquet
  Downloaded: UWASHINGTON_2018_South-Pole-Lake_GRN_BM3.parquet
bedmap3: 84 files cached in radar_cache/bedmap
Local cache: 103.76s to download
Timing local cache query...
Local query: 4.07s for 2,621,430 rows

Speedup: 10.6x faster with local cache
Points with bed elevation: 1,284,270 of 2,621,430
Loading...