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
.zipof GeoTIFF images and text geometry files) and replaced it with Version 004 (distributed as a single HDF-EOS2.hdffile). 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 byaster2asp(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
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()
[]
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
)
plotter.title="Stereo Match Points"
plotter.plot_match_points()
[]
plotter.title = "Disparity (meters)"
plotter.plot_disparity(
unit="meters",
quiver=True,
)
[]
plotter.title = "Disparity (pixels)"
plotter.plot_disparity(
unit="pixels",
quiver=True,
)
[]
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.
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)