Utilities¶
#
SpaceLiDAR.angle! — Method.
Sets the angle column in table as returned from points. See track_angle for details.
#
SpaceLiDAR.shift — Method.
Shift longitude and latitude with distance in [m] in direction angle, where North is 0°. Returns a tuple of the shifted coordinates: (longitude, latitude). Useful for offsetting SpaceLiDAR points to the left or right of the track, in combination with angle!.
#
SpaceLiDAR.ToEGM2008 — Type.
Transform: convert ellipsoidal :height to EGM2008 geoid height (using :longitude, :latitude). Generic — applies to any granule. Equivalent to to_egm2008.
#
SpaceLiDAR.icesat_quality — Method.
icesat_quality(t) -> BitVector
icesat_quality(elev_use_flg, sigma_att_flg_or_nothing, i_numPk_or_nothing, saturation_correction_or_nothing) -> BitVector
Compute the ICESat quality mask following Smith et al. (2020)1:
elev_use_flg == "valid"(HDF5 flag value 0)sigma_att_flg == "good"(or:attitudefor GLAH14)i_numPk == 1saturation_correction < 3
Missing values map to false. Returns a fresh BitVector suitable for filtering (e.g. t.height[icesat_quality(t)]). Pass nothing for any optional column to skip that predicate.
#
SpaceLiDAR.icesat_saturation_correct — Function.
Add :saturation_correction to :height. Missing corrections (the original ICESat fill sentinel, mapped to missing by table()) leave the height untouched. Missing heights stay missing because missing + x === missing.
Only meaningful for ICESat granules (GLAH06/GLAH14). Call before topex_to_wgs84!.
#
SpaceLiDAR.icesat_saturation_correct! — Method.
Add :saturation_correction to :height. Missing corrections (the original ICESat fill sentinel, mapped to missing by table()) leave the height untouched. Missing heights stay missing because missing + x === missing.
Only meaningful for ICESat granules (GLAH06/GLAH14). Call before topex_to_wgs84!.
#
SpaceLiDAR.to_egm2008 — Function.
Convert ellipsoid heights to EGM2008 geoid heights. Mutates / returns a copy with :height overwritten. Rows where any of :latitude, :longitude, :height is missing are left untouched.
If t carries "GEOINTERFACE:crs" metadata equal to EPSG(4326, 3855), the projection is skipped (idempotent — calling twice will not double-subtract the geoid undulation). After a successful projection, the new CRS is written to t's metadata if writable.
t is any Tables.jl-compatible table whose :height column is a mutable AbstractVector (e.g. DataFrame, NamedTuple of vectors, SpaceLiDAR.Table). For read-only H5Table / PartitionedH5Table, only the non-mutating to_egm2008(t) is defined.
#
SpaceLiDAR.to_egm2008! — Method.
Convert ellipsoid heights to EGM2008 geoid heights. Mutates / returns a copy with :height overwritten. Rows where any of :latitude, :longitude, :height is missing are left untouched.
If t carries "GEOINTERFACE:crs" metadata equal to EPSG(4326, 3855), the projection is skipped (idempotent — calling twice will not double-subtract the geoid undulation). After a successful projection, the new CRS is written to t's metadata if writable.
t is any Tables.jl-compatible table whose :height column is a mutable AbstractVector (e.g. DataFrame, NamedTuple of vectors, SpaceLiDAR.Table). For read-only H5Table / PartitionedH5Table, only the non-mutating to_egm2008(t) is defined.
#
SpaceLiDAR.topex_to_wgs84 — Function.
Convert ICESat coordinates from the TOPEX/Poseidon ellipsoid to WGS84. Transforms :height (and :height_reference if present). Latitude/longitude differences are below instrument precision (~1e-6°) and are not modified.
If t carries "GEOINTERFACE:crs" metadata equal to EPSG(4979) (or already in EGM2008), the projection is skipped — applying it twice would corrupt heights. After a successful projection, the new CRS is written to t's metadata if writable.
Only meaningful for ICESat granules (GLAH06/GLAH14). Rows with missing inputs are left untouched.
#
SpaceLiDAR.topex_to_wgs84! — Method.
Convert ICESat coordinates from the TOPEX/Poseidon ellipsoid to WGS84. Transforms :height (and :height_reference if present). Latitude/longitude differences are below instrument precision (~1e-6°) and are not modified.
If t carries "GEOINTERFACE:crs" metadata equal to EPSG(4979) (or already in EGM2008), the projection is skipped — applying it twice would corrupt heights. After a successful projection, the new CRS is written to t's metadata if writable.
Only meaningful for ICESat granules (GLAH06/GLAH14). Rows with missing inputs are left untouched.
#
SpaceLiDAR.granule — Method.
Create a mission specific granule from a local .h5 filepath. For folder usage see granules.
#
SpaceLiDAR.granules — Method.
Create mission specific granules from a folder with .h5 files, using granule.
#
SpaceLiDAR.in_bbox — Method.
in_bbox(xyz::DataFrame, bbox::NamedTuple)
in_bbox(g::Granule, bbox::NamedTuple)
in_bbox(g::Vector{<:Granule}, bbox::NamedTuple)
Filter to what falls inside the bounding box bbox, given as a NamedTuple with fields (min_x, min_y, max_x, max_y).
For a DataFrame of points, return the subset of rows whose :longitude and :latitude fall within bbox. For a single Granule, return true if the granule's bounds overlap bbox. For a vector of granules, return the granules whose bounds overlap bbox.
Warning
The granule methods open each .h5 file to read its bounds, so they are slow. See bounds.
<a id='SpaceLiDAR.instantiate-Union{Tuple{T}, Tuple{Vector{T}, AbstractString}} where T<:SpaceLiDAR.Granule' href='#SpaceLiDAR.instantiate-Union{Tuple{T}, Tuple{Vector{T}, AbstractString}} where T<:SpaceLiDAR.Granule'>#
SpaceLiDAR.instantiate — Method.
For a given list of granules from search, match the granules to the local files and return a new list of granules with the local filepaths if they exist.
#
SpaceLiDAR.isvalid — Method.
Checks if a granule is has a valid, local and non-corrupt .h5 file. Can be combined with rm(::Granule) to remove invalid granules.
#
SpaceLiDAR.netrc! — Method.
Writes/updates a .netrc file for ICESat-2 and GEDI downloads. A .netrc is a plaintext file containing your username and password for NASA EarthData and DAACs, and can be automatically used by Julia using Downloads and tools like wget, curl among others.
-
Smith, B., et al. (2020). Pervasive ice sheet mass loss reflects competing ocean and atmosphere processes. Science, 368(6496), 1239-1242. ↩