Skip to content

Utilities

# SpaceLiDAR.angle!Method.

angle!(table)

Sets the angle column in table as returned from points. See track_angle for details.

source

# SpaceLiDAR.shiftMethod.

shift(longitude, latitude, angle, distance)

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!.

source

# SpaceLiDAR.ToEGM2008Type.

ToEGM2008()

Transform: convert ellipsoidal :height to EGM2008 geoid height (using :longitude, :latitude). Generic — applies to any granule. Equivalent to to_egm2008.

source

# SpaceLiDAR.icesat_qualityMethod.

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 :attitude for GLAH14)
  • i_numPk == 1
  • saturation_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.

source

# SpaceLiDAR.icesat_saturation_correctFunction.

icesat_saturation_correct!(t)
icesat_saturation_correct(t)

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!.

source

# SpaceLiDAR.icesat_saturation_correct!Method.

icesat_saturation_correct!(t)
icesat_saturation_correct(t)

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!.

source

# SpaceLiDAR.to_egm2008Function.

to_egm2008!(t)
to_egm2008(t)

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.

source

# SpaceLiDAR.to_egm2008!Method.

to_egm2008!(t)
to_egm2008(t)

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.

source

# SpaceLiDAR.topex_to_wgs84Function.

topex_to_wgs84!(t)
topex_to_wgs84(t)

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.

source

# SpaceLiDAR.topex_to_wgs84!Method.

topex_to_wgs84!(t)
topex_to_wgs84(t)

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.

source

# SpaceLiDAR.granuleMethod.

granule(filename::AbstractString)

Create a mission specific granule from a local .h5 filepath. For folder usage see granules.

source

# SpaceLiDAR.granulesMethod.

granules(foldername::AbstractString)

Create mission specific granules from a folder with .h5 files, using granule.

source

# SpaceLiDAR.in_bboxMethod.

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.

source

<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.instantiateMethod.

instantiate(granules::Vector{<:Granule}, folder::AbstractString)

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.

source

# SpaceLiDAR.isvalidMethod.

isvalid(g::Granule)

Checks if a granule is has a valid, local and non-corrupt .h5 file. Can be combined with rm(::Granule) to remove invalid granules.

source

# SpaceLiDAR.netrc!Method.

netrc!(username, password)

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.

source


  1. Smith, B., et al. (2020). Pervasive ice sheet mass loss reflects competing ocean and atmosphere processes. Science, 368(6496), 1239-1242.