Example plotting following ASP Docs ASTER example for ASTER with mapprojection#

Below are example asp_plot outputs following the processing in the ASP Docs ASTER example.

We diverge from the documentation example data, instead retrieving the example data used in https://github.com/uw-cryo/asp_tutorials:

Note on ASTER L1A data format change: In December 2025, NASA decommissioned the ASTER L1A Version 003 product (distributed as a .zip of GeoTIFF images and text geometry files) and replaced it with Version 004 (distributed as a single HDF-EOS2 .hdf file). The Zenodo archive below preserves the old V003 format. If you are downloading new ASTER data from NASA Earthdata, you will receive V004 HDF files instead. Both formats are supported by aster2asp (HDF support requires ASP build 2026-01-28 or later). See the aster2asp documentation for details.

Option A: V003 data from Zenodo (legacy format)

wget https://zenodo.org/record/7972223/files/AST_L1A_00307312017190728_20200218153629_19952.zip

mkdir dataDir

tar xvf AST_L1A_00307312017190728_20200218153629_19952.zip -C dataDir

Option B: V004 data from NASA Earthdata (current format)

Download an ASTER L1A .hdf file from NASA Earthdata.


Pre-process the images for stereo:

# For V003 directory input:
aster2asp dataDir -o out

# For V004 HDF input:
aster2asp input.hdf -o out

Both produce the same output:

out-Band3B.tif
out-Band3B.xml
out-Band3N.tif
out-Band3N.xml

Run stereo processing and point2dem without initial mapprojection:

parallel_stereo -t aster         \
  --stereo-algorithm asp_mgm     \
  --subpixel-mode 9              \
  --aster-use-csm                \
   out-Band3N.tif out-Band3B.tif \
   out-Band3N.xml out-Band3B.xml \
   out_stereo/run

point2dem -r earth --auto-proj-center \
  --errorimage \
  out_stereo/run-PC.tif

Followed by re-processing with the additional mapprojection step onto a low-res output:

point2dem -r earth --auto-proj-center \
  --tr 200 out_stereo/run-PC.tif      \
  -o out_stereo/run-200m

mapproject --tr 15 --aster-use-csm \
  out_stereo/run-200m-DEM.tif      \
  out-Band3N.tif out-Band3N.xml out-Band3N_proj.tif

mapproject --tr 15 --aster-use-csm \
  out_stereo/run-200m-DEM.tif      \
  out-Band3B.tif out-Band3B.xml out-Band3B_proj.tif

parallel_stereo -t aster                  \
  --stereo-algorithm asp_mgm              \
  --subpixel-mode 9                       \
  --aster-use-csm                         \
  out-Band3N_proj.tif out-Band3B_proj.tif \
  out-Band3N.xml out-Band3B.xml           \
  out_stereo_proj/run                     \
  out_stereo/run-200m-DEM.tif

point2dem -r earth --auto-proj-center \
  --errorimage \
  out_stereo_proj/run-PC.tif

The results with and without mapprojection are displayed below.

Full report#

Example command for full stereo-processing report

No Mapprojection#

directory = "~/Desktop/asp-plot-examples/aster/"
stereo_directory = "out_stereo/"
!asp_report \
  --directory $directory \
  --stereo-directory $stereo_directory \
  --dem-filename run-DEM.tif \
  --subset-km 5 \
  --report-filename ../../reports/ASTER-asp-report.pdf
Processing ASP files in /Users/ben/Desktop/asp-plot-examples/aster/

WARNING:asp_plot.stereo:

No reference DEM found in log files. Please supply the reference DEM you used during stereo processing (or another reference DEM) if you would like to see some difference maps.



ASP DEM: /Users/ben/Desktop/asp-plot-examples/aster/out_stereo/run-DEM.tif


Using map projection from DEM: EPSG:32610
WARNING:asp_plot.utils:Could not find ('*.[Xx][Mm][Ll]',) in /Users/ben/Desktop/asp-plot-examples/aster/out_stereo/. Some plots may be missing.
Figure saved to /Users/ben/Desktop/asp-plot-examples/aster/tmp_asp_report_plots/00.png
Figure saved to /Users/ben/Desktop/asp-plot-examples/aster/tmp_asp_report_plots/01.png
Figure saved to /Users/ben/Desktop/asp-plot-examples/aster/tmp_asp_report_plots/02.png
Figure saved to /Users/ben/Desktop/asp-plot-examples/aster/tmp_asp_report_plots/03.png
Plotting DEM results. This can take a minute for large inputs.
WARNING:asp_plot.utils:Could not find ('*diff.tif',) in /Users/ben/Desktop/asp-plot-examples/aster/out_stereo/. Some plots may be missing.
Figure saved to /Users/ben/Desktop/asp-plot-examples/aster/tmp_asp_report_plots/04.png
Figure saved to /Users/ben/Desktop/asp-plot-examples/aster/tmp_asp_report_plots/05.png

Detected planetary body: earth
WARNING:sliderule.sliderule:Warning, this environment is using an outdated client (v5.3.1). The code will run but some functionality supported by the server (v5.5.0) may not be available.
Time filter: 2018-10-14T00:00:00Z to 2026-07-30T00:00:00Z (all available)

ICESat-2 ATL06 request processing for: all
{'poly': [{'lon': -122.35267767981371, 'lat': 46.69597200416099}, {'lon': -122.35267767981371, 'lat': 47.35581707303874}, {'lon': -121.3377266168241, 'lat': 47.35581707303874}, {'lon': -121.3377266168241, 'lat': 46.69597200416099}, {'lon': -122.35267767981371, 'lat': 46.69597200416099}], 't0': '2018-10-14T00:00:00Z', 't1': '2026-07-30T00:00:00Z', 'res': 20, 'len': 40, 'ats': 20, 'fit': {'maxi': 6}, 'cnf': 'atl03_high', 'srt': -1, 'cnt': 10}
Existing file found, reading in: /Users/ben/Desktop/asp-plot-examples/aster/atl06sr_all.parquet
Filtering ATL06-SR all
  Outlier filter (3σ): all 915160 → 896635 (removed 18525)
Figure saved to /Users/ben/Desktop/asp-plot-examples/aster/tmp_asp_report_plots/06.png
Figure saved to /Users/ben/Desktop/asp-plot-examples/aster/tmp_asp_report_plots/07.png
Figure saved to /Users/ben/Desktop/asp-plot-examples/aster/tmp_asp_report_plots/08.png
Figure saved to /Users/ben/Desktop/asp-plot-examples/aster/tmp_asp_report_plots/09.png
Writing out: /Users/ben/Desktop/asp-plot-examples/aster/out_stereo/run-DEM_pc_align_translated.tif
Wrote out all aligned DEM to /Users/ben/Desktop/asp-plot-examples/aster/out_stereo/run-DEM_pc_align_translated.tif
Figure saved to /Users/ben/Desktop/asp-plot-examples/aster/tmp_asp_report_plots/10.png
Figure saved to /Users/ben/Desktop/asp-plot-examples/aster/tmp_asp_report_plots/11.png
Figure saved to /Users/ben/Desktop/asp-plot-examples/aster/tmp_asp_report_plots/12.png
Figure selections saved to ../../reports/ASTER-asp-report_figure_selections.yml



Report saved to ../../reports/ASTER-asp-report.pdf

Mapprojection#

mp_stereo_directory = "out_stereo_proj/"
reference_dem = f"{directory}{stereo_directory}run-200m-DEM.tif"
!asp_report \
  --directory $directory \
  --stereo-directory $mp_stereo_directory \
  --dem-filename run-DEM.tif \
  --reference-dem $reference_dem \
  --subset-km 5 \
  --reuse-selections ../../reports/ASTER-asp-report_figure_selections.yml \
  --report-filename ../../reports/ASTER_mapproj-asp-report.pdf
Processing ASP files in /Users/ben/Desktop/asp-plot-examples/aster/


Reusing figure selections from: ../../reports/ASTER-asp-report_figure_selections.yml


Reference DEM: /Users/ben/Desktop/asp-plot-examples/aster/out_stereo/run-200m-DEM.tif

WARNING:asp_plot.utils:Could not find ('*-align-L.txt',) in /Users/ben/Desktop/asp-plot-examples/aster/out_stereo_proj/. Some plots may be missing.
WARNING:asp_plot.utils:Could not find ('*-align-R.txt',) in /Users/ben/Desktop/asp-plot-examples/aster/out_stereo_proj/. Some plots may be missing.

ASP DEM: /Users/ben/Desktop/asp-plot-examples/aster/out_stereo_proj/run-DEM.tif


Using map projection from DEM: EPSG:32610
Figure saved to /Users/ben/Desktop/asp-plot-examples/aster/tmp_asp_report_plots/00.png
Figure saved to /Users/ben/Desktop/asp-plot-examples/aster/tmp_asp_report_plots/01.png
Figure saved to /Users/ben/Desktop/asp-plot-examples/aster/tmp_asp_report_plots/02.png
Figure saved to /Users/ben/Desktop/asp-plot-examples/aster/tmp_asp_report_plots/03.png
Plotting DEM results. This can take a minute for large inputs.
WARNING:asp_plot.stereo:

Found a DEM of difference: /Users/ben/Desktop/asp-plot-examples/aster/out_stereo_proj/run-DEM_run-200m-DEM_diff.tif.
Using that for difference map plotting.
Figure saved to /Users/ben/Desktop/asp-plot-examples/aster/tmp_asp_report_plots/04.png
Figure saved to /Users/ben/Desktop/asp-plot-examples/aster/tmp_asp_report_plots/05.png
Detected planetary body: earth

Reusing ICESat-2 ATL06-SR points for 'all' from: /Users/ben/Desktop/asp-plot-examples/aster/atl06sr_all.parquet
Filtering ATL06-SR all
  Outlier filter (3σ): all 915160 → 897266 (removed 17894)
Figure saved to /Users/ben/Desktop/asp-plot-examples/aster/tmp_asp_report_plots/06.png
Figure saved to /Users/ben/Desktop/asp-plot-examples/aster/tmp_asp_report_plots/07.png
Figure saved to /Users/ben/Desktop/asp-plot-examples/aster/tmp_asp_report_plots/08.png
Figure saved to /Users/ben/Desktop/asp-plot-examples/aster/tmp_asp_report_plots/09.png
Writing out: /Users/ben/Desktop/asp-plot-examples/aster/out_stereo_proj/run-DEM_pc_align_translated.tif
Wrote out all aligned DEM to /Users/ben/Desktop/asp-plot-examples/aster/out_stereo_proj/run-DEM_pc_align_translated.tif
Figure saved to /Users/ben/Desktop/asp-plot-examples/aster/tmp_asp_report_plots/10.png
Figure saved to /Users/ben/Desktop/asp-plot-examples/aster/tmp_asp_report_plots/11.png
Figure saved to /Users/ben/Desktop/asp-plot-examples/aster/tmp_asp_report_plots/12.png
Figure selections saved to ../../reports/ASTER_mapproj-asp-report_figure_selections.yml



Report saved to ../../reports/ASTER_mapproj-asp-report.pdf

Individual plots for mapprojected processing#

Example modular usage of asp_plot for this example processing. Only the mapprojected example plots are shown.

directory = "~/Desktop/asp-plot-examples/aster/"
stereo_directory = "out_stereo_proj/"
reference_dem = f"{directory}out_stereo/run-200m-DEM.tif"

Stereo Geometry Analysis#

It’s useful to analyze the stereo acquisition geometry to verify the convergence angle and other geometric properties. ASTER’s gen_aster camera files record no view-angle summary, so asp_plot derives the geometry by intersecting the per-pixel look vectors with the WGS84 ellipsoid — giving the nadir (3N) and backward (3B) footprints, satellite tracks, and the ~31° convergence angle of ASTER’s along-track stereo pair:

from asp_plot.stereo_geometry import StereoGeometryPlotter

sgp = StereoGeometryPlotter(directory)
scene_bounds = sgp.parser.get_scene_bounds()

print(f"Scene extent (lon/lat): {scene_bounds[0]:.6f} {scene_bounds[1]:.6f} "
      f"{scene_bounds[2]:.6f} {scene_bounds[3]:.6f}")

_ = sgp.stereo_geom_plot()
Scene extent (lon/lat): -122.487668 46.605163 -121.250955 47.499986
../../_images/a677d8fde8e8443e2c25a6764ed06bbe4fe2bd574092802832a7851d614dabd8.png

Processing Parameters#

%load_ext autoreload
%autoreload 2

from asp_plot.processing_parameters import ProcessingParameters
processing_parameters = ProcessingParameters(
    processing_directory=directory,
    stereo_directory=stereo_directory
)
processing_parameters_dict = processing_parameters.from_log_files()

print(f"Processed on: {processing_parameters_dict['processing_timestamp']}\n")

print(f"Reference DEM: {processing_parameters_dict['reference_dem']}\n")

print(f"Bundle adjustment ({processing_parameters_dict['bundle_adjust_run_time']}):\n")
print(processing_parameters_dict["bundle_adjust"])

print(f"\nStereo ({processing_parameters_dict['stereo_run_time']}):\n")
print(processing_parameters_dict["stereo"])

print(f"\nPoint2dem ({processing_parameters_dict['point2dem_run_time']}):\n")
print(processing_parameters_dict["point2dem"])
Processed on: 2025-11-07 14:19:59

Reference DEM: out_stereo/run-200m-DEM.tif

Bundle adjustment (N/A):

Bundle adjustment not run

Stereo (0 hours and 14 minutes):

stereo -t aster --stereo-algorithm asp_mgm --subpixel-mode 9 --aster-use-csm out-Band3N_proj.tif out-Band3B_proj.tif out-Band3N.xml out-Band3B.xml out_stereo_proj/run out_stereo/run-200m-DEM.tif --corr-seed-mode 1 --sgm-collar-size 256 --compute-point-cloud-center-only --threads 8

Point2dem (0 hours and 0 minutes):

point2dem -r earth --auto-proj-center --errorimage out_stereo_proj/run-PC.tif

Scene Plots#

from asp_plot.scenes import ScenePlotter
plotter = ScenePlotter(
  directory,
  stereo_directory,
  title="Scenes"
)

plotter.plot_scenes()
[]
../../_images/d3d62ad73ced8d0927cc3b1d48aef4e423f045575172a0124e1effc979d6bea7.png

Stereo Plots#

from asp_plot.stereo import StereoPlotter
plotter = StereoPlotter(
  directory, 
  stereo_directory,
  reference_dem=reference_dem,
)
WARNING:asp_plot.utils:Could not find ('*-align-L.txt',) in /Users/ben/Desktop/asp-plot-examples/aster/out_stereo_proj/. Some plots may be missing.
WARNING:asp_plot.utils:Could not find ('*-align-R.txt',) in /Users/ben/Desktop/asp-plot-examples/aster/out_stereo_proj/. Some plots may be missing.
Reference DEM: /Users/ben/Desktop/asp-plot-examples/aster/out_stereo/run-200m-DEM.tif


ASP DEM: /Users/ben/Desktop/asp-plot-examples/aster/out_stereo_proj/run-DEM.tif
plotter.title = "Hillshade"

plotter.plot_detailed_hillshade(
  subset_km=5
)
../../_images/380acf4326cd620d2d3171b72b9772ee14ff787cbb3409f1f47b5a4d9a40db54.png
plotter.title="Stereo Match Points"

plotter.plot_match_points()
[]
../../_images/b7c827d808ce6be66c8de4e92ea124b54f0f54bfccb3706c2b10c954398ee759.png
plotter.title = "Disparity (meters)"

plotter.plot_disparity(
  unit="meters",
  quiver=True,
)
[]
../../_images/26d4a6f78379a5f888c1c821580dade7052632b2f54f8fc5fd945980e9cf61c4.png
plotter.title = "Disparity (pixels)"

plotter.plot_disparity(
  unit="pixels",
  quiver=True,
)
[]
../../_images/e91fc8b25f27bf0386e486e85ff9c7616e67afce98429cf19b9e0116f15072ae.png
plotter.title = "Stereo DEM Results"

plotter.plot_dem_results()
Plotting DEM results. This can take a minute for large inputs.
WARNING:asp_plot.stereo:

Found a DEM of difference: /Users/ben/Desktop/asp-plot-examples/aster/out_stereo_proj/run-DEM_run-200m-DEM_diff.tif.
Using that for difference map plotting.
../../_images/fece51b91f126a526a2808b98580190c417a86aeb3746c5e612bcb5dbf2db4f9.png

ICESat-2 Altimetry Validation#

import contextily as ctx
from asp_plot.altimetry import Altimetry
from asp_plot.utils import Raster
asp_dem = StereoPlotter(
  directory,
  stereo_directory,
).dem_fn

dem_raster = Raster(asp_dem)
epsg_code = dem_raster.get_epsg_code()
map_crs = f"EPSG:{epsg_code}"

ctx_kwargs = {
    "crs": f"EPSG:{epsg_code}",
    "source": ctx.providers.Esri.WorldImagery,
    "attribution_size": 0,
    "alpha": 0.5,
}
WARNING:asp_plot.utils:Could not find ('*-align-L.txt',) in /Users/ben/Desktop/asp-plot-examples/aster/out_stereo_proj/. Some plots may be missing.
WARNING:asp_plot.utils:Could not find ('*-align-R.txt',) in /Users/ben/Desktop/asp-plot-examples/aster/out_stereo_proj/. Some plots may be missing.
Reference DEM: /Users/ben/Desktop/asp-plot-examples/aster/out_stereo/run-200m-DEM.tif


ASP DEM: /Users/ben/Desktop/asp-plot-examples/aster/out_stereo_proj/run-DEM.tif
icesat = Altimetry(
  directory=directory,
  dem_fn=asp_dem
)
icesat.request_atl06sr_multi_processing(
    processing_levels=["all"],
    save_to_parquet=True,
)

# Time range and buffering options:

# icesat.request_atl06sr_multi_processing(
#     processing_levels=["all"],
#     save_to_parquet=True,
#     time_range="buffered",
#     scene_date="2020-02-18"
# )
WARNING:sliderule.sliderule:Warning, this environment is using an outdated client (v5.3.1). The code will run but some functionality supported by the server (v5.5.0) may not be available.
Time filter: 2018-10-14T00:00:00Z to 2026-07-30T00:00:00Z (all available)

ICESat-2 ATL06 request processing for: all
{'poly': [{'lon': -122.34846522847539, 'lat': 46.699595216327424}, {'lon': -122.34846522847539, 'lat': 47.353178047956256}, {'lon': -121.3512354148296, 'lat': 47.353178047956256}, {'lon': -121.3512354148296, 'lat': 46.699595216327424}, {'lon': -122.34846522847539, 'lat': 46.699595216327424}], 't0': '2018-10-14T00:00:00Z', 't1': '2026-07-30T00:00:00Z', 'res': 20, 'len': 40, 'ats': 20, 'fit': {'maxi': 6}, 'cnf': 'atl03_high', 'srt': -1, 'cnt': 10}
Existing file found, reading in: /Users/ben/Desktop/asp-plot-examples/aster/atl06sr_all.parquet
Parameters don't match request. Regenerating...
ERROR:sliderule.session:Alert <-7>: Failure on resource ATL03_20260217034139_09893006_007_01.h5 beam gt1l: H5Coro::Future read failure on gt1l/geolocation/velocity_sc
ERROR:sliderule.session:Alert <-7>: Failure on resource ATL03_20240915042833_13702406_007_01.h5 beam gt2r: H5Coro::Future read failure on /gt2r/geolocation/segment_ph_cnt
ERROR:sliderule.session:Alert <-7>: Failure on resource ATL03_20240915042833_13702406_007_01.h5 beam gt3r: H5Coro::Future read failure on gt3r/heights/dist_ph_across
ERROR:sliderule.session:Alert <-7>: Failure on resource ATL03_20240211023402_08292202_007_01.h5 beam gt2l: H5Coro::Future read failure on gt2l/heights/lon_ph
ERROR:sliderule.session:Alert <-7>: Failure on resource ATL03_20240211023402_08292202_007_01.h5 beam gt1r: H5Coro::Future read failure on gt1r/heights/dist_ph_along
ERROR:sliderule.session:Alert <-7>: Failure on resource ATL03_20221022133927_04861706_007_01.h5 beam gt1r: H5Coro::Future read failure on gt1r/heights/lon_ph
ERROR:sliderule.session:Alert <-7>: Failure on resource ATL03_20181121213859_08290102_007_01.h5 beam gt1r: H5Coro::Future read failure on gt1r/heights/dist_ph_across
ERROR:sliderule.session:Alert <-7>: Failure on resource ATL03_20221018134749_04251706_007_01.h5 beam gt2r: H5Coro::Future read failure on gt2r/heights/dist_ph_along
ERROR:sliderule.session:Alert <-7>: Failure on resource ATL03_20211115173655_08291302_007_01.h5 beam gt1l: H5Coro::Future read failure on gt1l/geolocation/velocity_sc
ERROR:sliderule.session:Alert <-7>: Failure on resource ATL03_20210616005305_12711102_007_01.h5 beam gt2l: H5Coro::Future read failure on gt2l/heights/dist_ph_along
ERROR:sliderule.session:Alert <-7>: Failure on resource ATL03_20190419143053_03260302_007_01.h5 beam gt3r: H5Coro::Future read failure on /gt3r/geolocation/segment_ph_cnt
  Sampling ESA WorldCover for 949820 points (1 tile(s))...
  WorldCover: 949820/949820 points sampled
Filtering ATL06-SR all
icesat.filter_esa_worldcover(filter_out="water")

No temporal filtering needed for the simplified report workflow. Advanced temporal filtering is still available via notebook/script method calls.

# Map view
icesat.mapview_plot_atl06sr_to_dem(
    key="all",
    map_crs=map_crs,
    **ctx_kwargs,
)

# Histogram with per-landcover-class statistics
icesat.histogram_by_landcover(key="all")

# Profile along the best ICESat-2 track
icesat.plot_atl06sr_dem_profile(key="all")
icesat.plot_best_worst_segments(key="all")
icesat_minus_dem not found in ATL06 dataframe: all. Running differencing first.
  Outlier filter (3σ): all 881480 → 863627 (removed 17853)
../../_images/259c08df109c4af69843cc7938e476a813e66ef6688acb5b7a3ab1cce49d844d.png ../../_images/38ace87acceb3419cca22423bdaa37b01e0ecb4a01689b29da55ebb19210daeb.png ../../_images/9528ae3a7e6c9d63e935b7cbbebff9ac4a0384dde9ec19a2027fc97d1a6c465d.png ../../_images/6773c006876f6a0e1e0428383149353202515fb6871109041ceb594ae03a5ad9.png