# database parameters
tiledb:
  storage_type: 'local'
  local_path: 'path/to/your/database'     # TileDB URI for storing data
  overwrite: true                                  # Whether to overwrite existing arrays
  time_range:                                      # Global time range for data
    start_time: "2018-01-01"
    end_time: "2030-12-31"
  spatial_range:                                   # Global spatial range (bounding box)
    lat_min: -90.0
    lat_max: 90.0
    lon_min: -180.0
    lon_max: 180.0
  dimensions: ['latitude', 'longitude', 'time']
  consolidation_settings:
   fragment_size: 200_000_000_000 # 100GB fragment size
   memory_budget: "150000000000"  # 150GB total memory budget
   memory_budget_var: "50000000000"  # 50GB for variable-sized attributes
  cell_order: "hilbert"
  capacity: 100000

# Data directory for downloading GEDI data
data_dir: 'path/to/your/downloading/folder'

# Configuration for accessing NASA's Earthdata Search API to query granule data.
earth_data_info:
 CMR_URL: "https://cmr.earthdata.nasa.gov/search/granules.json"
 CMR_PRODUCT_IDS:
  ATL08: 'C3565574177-NSIDC_CPRD'

# Variables list for each IceSat2 level product - SDS_Name is science dataset name the native h5 file retrieved from the NASA API
level_atl08:
  variables:
    asr:
      SDS_Name: "land_segments/asr"
      dtype: "float32"
      description: "Apparent surface reflectance"
      long_name: "apparent surface reflectance"
      units: "1"

    atlas_pa:
      SDS_Name: "land_segments/atlas_pa"
      dtype: "float32"
      description: "Off nadir pointing angle (in radians) of the satellite to increase spatial sampling in the non-polar regions. ATLAS_PA =radians(90degs-beam_coelev)."
      long_name: "atlas pointing angle"
      units: "radians"

    beam_azimuth:
      SDS_Name: "land_segments/beam_azimuth"
      dtype: "float32"
      description: "Azimuth(in radians) of the unit pointing vector for the reference photon in the local ENU frame in radians.  The angle is measured from north and positive towards East."
      long_name: "beam azimuth"
      units: "radians"

    beam_coelev:
      SDS_Name: "land_segments/beam_coelev"
      dtype: "float32"
      description: "Co-elevation (CE) is direction from vertical of the laser beam as seen by an observer located at the laser ground spot."
      long_name: "beam co-elevation"
      units: "radians"

    brightness_flag:
      SDS_Name: "land_segments/brightness_flag"
      dtype: "int8"
      description: "Flag indicating that the ground surface is bright (e.g. snow-covered or other bright surfaces)"
      long_name: "brightness flag"
      units: "1"

    can_noise:
      SDS_Name: "land_segments/canopy/can_noise"
      dtype: "float32"
      description: "Number of noise photons calculated that fall within the canopy height for each 100 m segment based on ATL03 background rate parameters."
      long_name: "canopy noise rate"
      units: "count/meter"
      valid_min: "0.0"

    canopy_h_metrics:
      SDS_Name: "land_segments/canopy/canopy_h_metrics"
      dtype: "float32"
      description: "Height metrics based on the cumulative distribution of relative canopy heights above the interpolated ground surface.  The height metrics are calculated at the following percentiles: 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95%."
      long_name: "canopy height metrics"
      units: "meters"
      is_profile: True
      profile_length: 18
      profile_labels: [10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95]
      profile_label_name: "percentile"

    canopy_h_metrics_abs:
      SDS_Name: "land_segments/canopy/canopy_h_metrics_abs"
      dtype: "float32"
      description: "Height metrics based on the cumulative distribution of absolute canopy heights above the WGS84 Ellipsoid.  The height metrics are calculated at the following percentiles: 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95%."
      long_name: "canopy absolute height metrics"
      units: "meters"
      is_profile: True
      profile_length: 18
      profile_labels: [10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95]
      profile_label_name: "percentile"

    canopy_openness:
      SDS_Name: "land_segments/canopy/canopy_openness"
      dtype: "float32"
      description: "Standard Deviation of all photons classified as canopy photons within the segment to provide inference of canopy openness."
      long_name: "canopy openness"
      units: "1"

    canopy_rh_conf:
      SDS_Name: "land_segments/canopy/canopy_rh_conf"
      dtype: "int8"
      description: "Canopy relative height confidence flag based on percentage of ground and canopy photons within a segment: 0 (<5% canopy), 1 (>5% canopy, <5% ground), 2 (>5% canopy, >5% ground)."
      long_name: "canopy relative height confidence"
      units: "1"

    centroid_height:
      SDS_Name: "land_segments/canopy/centroid_height"
      dtype: "float32"
      description: "Optical centroid of all photons classified as either canopy or ground points within the segment.  The heights used in this calculation are absolute heights above the reference ellipsoid. This parameter is equivalent to the centroid height produced ICESat GLA14."
      long_name: "centroid height"
      units: "meters"

    h_canopy:
      SDS_Name: "land_segments/canopy/h_canopy"
      dtype: "float32"
      description: "98% height of all the individual canopy relative heights for the segment above the estimated terrain surface. Relative canopy heights have been computed by differencing the canopy photon height from the estimated terrain surface."
      long_name: "height canopy"
      units: "meters"

    h_canopy_20m:
      SDS_Name: "land_segments/canopy/h_canopy_20m"
      dtype: "float32"
      description: "Canopy height for each 20m geosegment with each 100m land segment."
      long_name: "canopy height 20m"
      units: "m"
      is_subsegment: True
      subsegment_length: 5
      subsegment_labels: [10, 30, 50, 70, 90]
      subsegment_label_name: "along_track_offset_m"

    h_canopy_abs:
      SDS_Name: "land_segments/canopy/h_canopy_abs"
      dtype: "float32"
      description: "The 98% height of all the absolute individual canopy heights referenced above the WGS84 ellipsoid."
      long_name: "absolute segment canopy height"
      units: "meters"

    h_canopy_quad:
      SDS_Name: "land_segments/canopy/h_canopy_quad"
      dtype: "float32"
      description: "The quadratic mean height of individual classified relative canopy photon heights above the estimated terrain surface."
      long_name: "canopy quadratic mean"
      units: "meters"

    h_canopy_uncertainty:
      SDS_Name: "land_segments/canopy/h_canopy_uncertainty"
      dtype: "float32"
      description: "Uncertainty of the relative canopy heights for the segment. Incorporates all systematic uncertainties as well as uncertainty from errors of identified photons. See section 1 and equations 1.4 and 1.5 in the Land ATBD"
      long_name: "segment canopy height uncertainty"
      units: "meters"

    h_dif_canopy:
      SDS_Name: "land_segments/canopy/h_dif_canopy"
      dtype: "float32"
      description: "Difference between h_canopy and h_median_canopy"
      long_name: "canopy diff to median height"
      units: "meters"

    h_max_canopy:
      SDS_Name: "land_segments/canopy/h_max_canopy"
      dtype: "float32"
      description: "Relative maximum of individual canopy heights within segment. Relative canopy heights have been computed by differencing the canopy photon height from the estimated terrain surface. Should be equivalent to RH100 metric reported in the literature."
      long_name: "maximum canopy height"
      units: "meters"

    h_max_canopy_abs:
      SDS_Name: "land_segments/canopy/h_max_canopy_abs"
      dtype: "float32"
      description: "Maximum of individual absolute canopy heights within segment referenced above the WGS84 ellipsoid."
      long_name: "absolute maximum canopy height"
      units: "meters"

    h_mean_canopy:
      SDS_Name: "land_segments/canopy/h_mean_canopy"
      dtype: "float32"
      description: "Mean of individual relative canopy heights within segment.  Relative canopy heights have been computed by differencing the canopy photon height from the estimated terrain surface."
      long_name: "mean canopy height"
      units: "meters"

    h_mean_canopy_abs:
      SDS_Name: "land_segments/canopy/h_mean_canopy_abs"
      dtype: "float32"
      description: "Mean of the individual absolute canopy heights within segment referenced above the WGS84 Ellipsoid."
      long_name: "absolute mean canopy height"
      units: "meters"

    h_median_canopy:
      SDS_Name: "land_segments/canopy/h_median_canopy"
      dtype: "float32"
      description: "The median of individual relative canopy heights within segment. Relative canopy heights have been computed by differencing the canopy photon height from the estimated terrain surface. This parameter should be equivalent to RH50 reported in the literature."
      long_name: "median canopy height"
      units: "meters"

    h_median_canopy_abs:
      SDS_Name: "land_segments/canopy/h_median_canopy_abs"
      dtype: "float32"
      description: "The median of individual absolute canopy heights within segment referenced above the WGS84 Ellipsoid."
      long_name: "absolute segment median canopy height"
      units: "meters"

    h_min_canopy:
      SDS_Name: "land_segments/canopy/h_min_canopy"
      dtype: "float32"
      description: "The minimum of relative individual canopy heights within segment. Relative canopy heights have been computed by differencing the canopy photon height from the estimated terrain surface."
      long_name: "minimum canopy height"
      units: "meters"

    h_min_canopy_abs:
      SDS_Name: "land_segments/canopy/h_min_canopy_abs"
      dtype: "float32"
      description: "The minimum of absolute individual canopy heights within segment referenced above the WGS84 Ellipsoid."
      long_name: "absolute minimum canopy height"
      units: "meters"

    n_ca_photons:
      SDS_Name: "land_segments/canopy/n_ca_photons"
      dtype: "int32"
      description: "The number of photons classified as canopy within the segment."
      long_name: "number canopy photons"
      units: "1"

    n_toc_photons:
      SDS_Name: "land_segments/canopy/n_toc_photons"
      dtype: "int32"
      description: "The number of photons classified as top of canopy within the segment."
      long_name: "number top of canopy photons"
      units: "1"

    photon_rate_can:
      SDS_Name: "land_segments/canopy/photon_rate_can"
      dtype: "float32"
      description: "Calculated photon rate of canopy photons within each 100m segment"
      long_name: "Canopy photon rate"
      units: "s^-1"

    photon_rate_can_nr:
      SDS_Name: "land_segments/canopy/photon_rate_can_nr"
      dtype: "float32"
      description: "Noise removed photon canopy rate within each 100 m segment."
      long_name: "noise reduced number of canopy photons"
      units: "s^-1"

    segment_cover:
      SDS_Name: "land_segments/canopy/segment_cover"
      dtype: "int16"
      description: "Average percentage value of the valid (value <= 100) Copernicus fractional cover product for each 100 m segment"
      long_name: "canopy cover percentage"
      units: "1"

    subset_can_flag:
      SDS_Name: "land_segments/canopy/subset_can_flag"
      dtype: "int8"
      description: "Quality flag indicating the canopy photons populating the 100 m segment statistics are derived from less than 100 m worth of photons and/or less than 5 20m ATL03 segments."
      long_name: "subset canopy flag"
      units: "1"
      is_subsegment: True
      subsegment_length: 5
      subsegment_labels: [10, 30, 50, 70, 90]
      subsegment_label_name: "along_track_offset_m"

    toc_roughness:
      SDS_Name: "land_segments/canopy/toc_roughness"
      dtype: "float32"
      description: "Standard deviation of the relative heights of all photons classified as top of canopy within the segment"
      long_name: "top of canopy roughness"
      units: "meters"

    cloud_flag_atm:
      SDS_Name: "land_segments/cloud_flag_atm"
      dtype: "int8"
      description: "Cloud confidence flag from ATL09 that indicates the number of cloud or aerosol layers identified in each 25Hz atmospheric profile. If the flag is greater than 0, aerosols or clouds could be present. Valid range is 0 - 10."
      long_name: "cloud flag atm"
      units: "1"

    cloud_fold_flag:
      SDS_Name: "land_segments/cloud_fold_flag"
      dtype: "int8"
      description: "Flag that indicates this profile likely contains cloud signal folded down from above 15 km to the last 2-3 km of the profile. See ATL09 ATBD Table 3.9 for detailed flag value meanings."
      long_name: "cloud folding flag"
      units: "1"

    delta_time:
      SDS_Name: "land_segments/delta_time"
      dtype: "float64"
      description: "Mean time for the segment in number of GPS seconds since the ATLAS SDP epoch. The ATLAS Standard Data Products (SDP) epoch offset is defined within /ancillary_data/atlas_sdp_gps_epoch as the number of GPS seconds between the GPS epoch (1980-01-06T00:00:00.000000Z UTC) and the ATLAS SDP epoch. By adding the offset contained within atlas_sdp_gps_epoch to delta time parameters, the time in gps_seconds relative to the GPS epoch can be computed."
      long_name: "mean_pass_time"
      standard_name: "time"
      units: "seconds since 2018-01-01"

    delta_time_beg:
      SDS_Name: "land_segments/delta_time_beg"
      dtype: "float64"
      description: "Time of the first photon contained within the data segment, in seconds since the ATLAS SDP GPS Epoch. The ATLAS Standard Data Products (SDP) epoch offset is defined within /ancillary_data/atlas_sdp_gps_epoch as the number of GPS seconds between the GPS epoch (1980-01-06T00:00:00.000000Z UTC) and the ATLAS SDP epoch. By adding the offset contained within atlas_sdp_gps_epoch to delta time parameters, the time in gps_seconds relative to the GPS epoch can be computed."
      long_name: "delta time begin"
      units: "seconds since 2018-01-01"

    delta_time_end:
      SDS_Name: "land_segments/delta_time_end"
      dtype: "float64"
      description: "Time of the last photon contained within the data segment, in seconds since the ATLAS SDP epoch. The ATLAS Standard Data Products (SDP) epoch offset is defined within /ancillary_data/atlas_sdp_gps_epoch as the number of GPS seconds between the GPS epoch (1980-01-06T00:00:00.000000Z UTC) and the ATLAS SDP epoch. By adding the offset contained within atlas_sdp_gps_epoch to delta time parameters, the time in gps_seconds relative to the GPS epoch can be computed."
      long_name: "delta time end"
      units: "seconds since 2018-01-01"

    dem_flag:
      SDS_Name: "land_segments/dem_flag"
      dtype: "int8"
      description: "Indicates source of the DEM height. Values: 0=None, 1=Arctic, 2=Global, 3=MSS, 4=Antarctic."
      long_name: "dem source flag"
      units: "1"

    dem_h:
      SDS_Name: "land_segments/dem_h"
      dtype: "float32"
      description: "Best available DEM (in priority of Arctic/Antarctic/Global/MSS) value at the geolocation point.  Height is in meters above the WGS84 Ellipsoid."
      long_name: "dem height"
      units: "meters"

    dem_removal_flag:
      SDS_Name: "land_segments/dem_removal_flag"
      dtype: "int8"
      description: "Flag indicating more than dem_removal_percent_limit (default 20.0) removed from land segment due to failing DEM-QA tests"
      long_name: "dem removal flag"
      units: "1"

    h_dif_ref:
      SDS_Name: "land_segments/h_dif_ref"
      dtype: "float32"
      description: "Difference between h_te_median and ref_DEM"
      long_name: "h dif from reference"
      units: "meters"

    last_seg_extend:
      SDS_Name: "land_segments/last_seg_extend"
      dtype: "float32"
      description: "The distance (km) that the last ATL08 processing segment in a file is either extended or overlapped with the previous ATL08 processing segment."
      long_name: "last segment extended"
      standard_name: "last_seg_extend"
      units: "kilometers"

    latitude_20m:
      SDS_Name: "land_segments/latitude_20m"
      dtype: "float32"
      description: "Center latitude of 20m geosegments within each 100m land segment."
      long_name: "latitude of 20m segments"
      units: "degree"
      is_subsegment: True
      subsegment_length: 5
      subsegment_labels: [10, 30, 50, 70, 90]
      subsegment_label_name: "along_track_offset_m"

    layer_flag:
      SDS_Name: "land_segments/layer_flag"
      dtype: "int8"
      description: "This flag is a combination of multiple flags (cloud_flag_atm, cloud_flag_asr, and bsnow_con) and takes daytime/nighttime into consideration. A value of 1 means clouds or blowing snow are likely present. A value of 0 indicates the likely absence of clouds or blowing snow."
      long_name: "consolidated cloud flag"
      units: "1"

    longitude_20m:
      SDS_Name: "land_segments/longitude_20m"
      dtype: "float32"
      description: "Center longitude of 20m geosegments within each 100m land segment."
      long_name: "longitude of 20m segments"
      units: "degree"
      is_subsegment: True
      subsegment_length: 5
      subsegment_labels: [10, 30, 50, 70, 90]
      subsegment_label_name: "along_track_offset_m"

    msw_flag:
      SDS_Name: "land_segments/msw_flag"
      dtype: "int8"
      description: "Multiple Scattering warning flag. The multiple scattering warning flag (ATL09 parameter msw_flag) has values from -1 to 5 where zero means no multiple scattering and 5 the greatest. If no layers were detected, then msw_flag = 0. If blowing snow is detected and its estimated optical depth is greater than or equal to 0.5, then msw_flag = 5. If the blowing snow optical depth is less than 0.5, then msw_flag = 4. If no blowing snow is detected but there are cloud or aerosol layers detected, the msw_flag assumes values of 1 to 3 based on the height of the bottom of the lowest layer: < 1 km, msw_flag = 3; 1-3 km, msw_flag = 2; > 3km, msw_flag = 1. A value of -1 indicates that the signal to noise of the data was too low to reliably ascertain the presence of cloud or blowing snow. We expect values of -1 to occur only during daylight."
      long_name: "multiple scattering warning flag"
      units: "1"

    n_seg_ph:
      SDS_Name: "land_segments/n_seg_ph"
      dtype: "int32"
      description: "Number of photons within each land segment."
      long_name: "number of photons"
      units: "1"

    night_flag:
      SDS_Name: "land_segments/night_flag"
      dtype: "int32"
      description: "Flag indicating the data were acquired in night conditions: 0=day, 1=night.  Flag is derived from solar elevation at the geolocated segment.  IF solar elevation is above threshold it is day, if not then it is night.  Threshold is set in atlas_l3a_const_mod."
      long_name: "night flag"
      units: "1"

    ph_ndx_beg:
      SDS_Name: "land_segments/ph_ndx_beg"
      dtype: "int64"
      description: "Index (1-based) within the photon-rate data (/land_segments/photons) of the first photon within this each land segment."
      long_name: "photon index begin"
      units: "1"

    ph_removal_flag:
      SDS_Name: "land_segments/ph_removal_flag"
      dtype: "int8"
      description: "Flag indicating more than ph_removal_percent_limit (default 50.0) removed from land segment due to failing QA tests"
      long_name: "ph removal flag"
      units: "1"

    psf_flag:
      SDS_Name: "land_segments/psf_flag"
      dtype: "int8"
      description: "Flag is set to 1 if the point spread function (computed as sigma_atlas_land) has exceeded the threshold (1 m)"
      long_name: "point spread function flag"
      units: "1"

    rgt:
      SDS_Name: "land_segments/rgt"
      dtype: "int16"
      description: "The reference ground track (RGT) is the track on the earth at which a specified unit vector within the observatory is pointed. Under nominal operating conditions, there will be no data collected along the RGT, as the RGT is spanned by GT3 and GT4.  During slews or off-pointing, it is possible that ground tracks may intersect the RGT. The ICESat-2 mission has 1387 RGTs."
      long_name: "reference ground track"
      units: "1"

    sat_flag:
      SDS_Name: "land_segments/sat_flag"
      dtype: "int8"
      description: "Flag derived from full_sat_fract on the ATL03 data product, averaged over 5 geosegments in 100m land segment"
      long_name: "saturation flag"
      units: "1"

    segment_id_beg:
      SDS_Name: "land_segments/segment_id_beg"
      dtype: "int32"
      description: "Geolocation segment number of the first photon in the land segment."
      long_name: "begin geolocation segment bin"
      units: "1"

    segment_id_end:
      SDS_Name: "land_segments/segment_id_end"
      dtype: "int32"
      description: "Geolocation segment number of the last photon in the land segment."
      long_name: "end geolocation segment bin"
      units: "1"

    segment_landcover:
      SDS_Name: "land_segments/segment_landcover"
      dtype: "int16"
      description: "UN-FAO Land Cover Surface type classification as reference from Copernicus Land Cover(ANC18) at the 100m resolution."
      long_name: "segment landcover"
      units: "1"

    segment_snowcover:
      SDS_Name: "land_segments/segment_snowcover"
      dtype: "int8"
      description: "Daily snow/ice cover from ATL09 at the 25 Hz rate(275m) indicating likely presence of snow and ice within each segment. 0=ice free water; 1=snow free land;  2=snow; 3=ice."
      long_name: "segment snowcover"
      units: "1"

    segment_watermask:
      SDS_Name: "land_segments/segment_watermask"
      dtype: "int32"
      description: "Water mask(i.e. flag) indicating inland water as referenced from the Global Raster Water Mask(ANC33) at 250 m spatial resolution."
      long_name: "segment watermask"
      units: "1"

    sigma_across:
      SDS_Name: "land_segments/sigma_across"
      dtype: "float32"
      description: "Total cross-track uncertainty due to PPD and POD knowledge.  Read from ATL03 product gtx/geolocation/sigma_across. Sigma_atlas_y is reported on ATL08 as the uncertainty of the center-most reference photon of the 100m ATL08 segment."
      long_name: "sigma atlas y"
      units: "1"

    sigma_along:
      SDS_Name: "land_segments/sigma_along"
      dtype: "float32"
      description: "Total along-track uncertainty due to PPD and POD knowledge.  Read from ATL03 product gtx/geolocation/sigma_along. Sigma_atlas_x is reported on ATL08 as the uncertainty of the center-most reference photon of the 100m ATL08 segment."
      long_name: "sigma atlas x"
      units: "1"

    sigma_atlas_land:
      SDS_Name: "land_segments/sigma_atlas_land"
      dtype: "float32"
      description: "Total vertical geolocation error due to ranging and local surface slope.  The parameter is computed for ATL08 as described in equation 1.2."
      long_name: "sigma atlas land"
      units: "1"

    sigma_h:
      SDS_Name: "land_segments/sigma_h"
      dtype: "float32"
      description: "Estimated uncertainty for the reference photon bounce point ellipsoid height: 1- sigma (m) provided at the geolocation segment rate on ATL03.  Sigma_h is reported on ATL08 as the uncertainty of the center-most reference photon of the 100m ATL08 segment."
      long_name: "height uncertainty"
      units: "1"

    sigma_topo:
      SDS_Name: "land_segments/sigma_topo"
      dtype: "float32"
      description: "Total uncertainty that include sigma_h plus geolocation uncertainty due to local slope (equation 1.3).  The local slope is multiplied by the geolocation uncertainty factor. This will be used to determine the total vertical geolocation error due to ranging and local slope."
      long_name: "sigma atlas topo"
      units: "1"

    snr:
      SDS_Name: "land_segments/snr"
      dtype: "float32"
      description: "The signal to noise ratio of geolocated photons as determined by the ratio of the superset of ATL03 signal and DRAGANN found signal photons used for processing the ATL08 segments to the background photons (i.e. noise) within the same ATL08 segments."
      long_name: "signal to noise ratio"
      units: "1"

    solar_azimuth:
      SDS_Name: "land_segments/solar_azimuth"
      dtype: "float32"
      description: "The direction, eastwards from north, of the sun vector as seen by an observer at the laser ground spot."
      long_name: "solar azimuth"
      units: "degrees_east"

    solar_elevation:
      SDS_Name: "land_segments/solar_elevation"
      dtype: "float32"
      description: "Solar Angle above or below the plane tangent to the ellipsoid surface at the laser spot. Positive values mean the sun is above the horizon, while  negative values mean it is below the horizon. The effect of atmospheric refraction is not included. This is a low precision value, with approximately TBD degree accuracy."
      long_name: "solar elevation"
      units: "degrees"

    surf_type:
      SDS_Name: "land_segments/surf_type"
      dtype: "int8"
      description: "Flags describing which surface types this interval is associated with. 0=not type, 1=is type. Order of array is land, ocean, sea ice, land ice, inland water."
      long_name: "surface type"
      units: "1"
      is_subsegment: True
      subsegment_length: 5

    h_te_best_fit:
      SDS_Name: "land_segments/terrain/h_te_best_fit"
      dtype: "float32"
      description: "The best fit terrain elevation at the the mid-point location of each 100m segment. The mid-segment terrain elevation is determined by selecting the best of three fits- linear, 3rd order and 4th order polynomials - to the terrain photons and interpolating the elevation at the mid-point location of the 100 m segment. For the linear fit, a slope correction and weighting is applied to each ground photon based on the distance to the slope height at the center of the segment."
      long_name: "segment terrain height best fit"
      units: "meters"

    h_te_best_fit_20m:
      SDS_Name: "land_segments/terrain/h_te_best_fit_20m"
      dtype: "float32"
      description: "Best fit terrain height to center of each 20m geosegment within each 100m land segment."
      long_name: "best fit 20m"
      units: "m"
      is_subsegment: True
      subsegment_length: 5
      subsegment_labels: [10, 30, 50, 70, 90]
      subsegment_label_name: "along_track_offset_m"

    h_te_interp:
      SDS_Name: "land_segments/terrain/h_te_interp"
      dtype: "float32"
      description: "Interpolated terrain surface height above the WGS84 Ellipsoid at the midpoint of the segment."
      long_name: "interpolated terrain surface height"
      units: "meters"

    h_te_max:
      SDS_Name: "land_segments/terrain/h_te_max"
      dtype: "float32"
      description: "The maximum of the photon heights above the WGS84 Ellipsoid, classified as terrain within the segment."
      long_name: "maximum terrain height"
      units: "meters"

    h_te_mean:
      SDS_Name: "land_segments/terrain/h_te_mean"
      dtype: "float32"
      description: "The mean of the photon heights above the WGS84 Ellipsoid, classified as terrain within the segment."
      long_name: "mean terrain height"
      units: "meters"

    h_te_median:
      SDS_Name: "land_segments/terrain/h_te_median"
      dtype: "float32"
      description: "The median of the photon heights above the WGS84 Ellipsoid, classified as terrain within the segment."
      long_name: "median terrain height"
      units: "meters"

    h_te_min:
      SDS_Name: "land_segments/terrain/h_te_min"
      dtype: "float32"
      description: "The minimum of the photon heights above the WGS84 Ellipsoid, classified as terrain within the segment."
      long_name: "minimum terrain height"
      units: "meters"

    h_te_mode:
      SDS_Name: "land_segments/terrain/h_te_mode"
      dtype: "float32"
      description: "The mode of the photon heights above the WGS84 Ellipsoid, classified as terrain within the segment."
      long_name: "mode of terrain heights"
      units: "meters"

    h_te_rh25:
      SDS_Name: "land_segments/terrain/h_te_rh25"
      dtype: "float32"
      description: "The terrain elevation from the 25% height. The classified ground photons are sorted into a cumulative distribution and the height associated with the 25% height for that segment is reported."
      long_name: "Terrain height 25% percentile"
      units: "meters"

    h_te_skew:
      SDS_Name: "land_segments/terrain/h_te_skew"
      dtype: "float32"
      description: "The skewness of the photon heights above the WGS84 Ellipsoid, classified as terrain within the segment."
      long_name: "skew of terrain heights"
      units: "meters"

    h_te_std:
      SDS_Name: "land_segments/terrain/h_te_std"
      dtype: "float32"
      description: "The standard deviation of the photon heights above the WGS84 Ellipsoid, classified as terrain within the segment."
      long_name: "segment terrain roughness"
      units: "meters"

    h_te_uncertainty:
      SDS_Name: "land_segments/terrain/h_te_uncertainty"
      dtype: "float32"
      description: "Uncertainty of the mean terrain height for the segment. This uncertainty incorporates all systematic uncertainties(e.g. timing orbits, geolocation,etc.) as well as uncertainty from errors of identified photons.  This parameter is described in section 1, equation 1.4"
      long_name: "uncertainty of h_te_mean"
      units: "meters"

    n_te_photons:
      SDS_Name: "land_segments/terrain/n_te_photons"
      dtype: "int32"
      description: "The number of the photons classified as terrain within the segment."
      long_name: "number of ground photons"
      units: "1"

    photon_rate_te:
      SDS_Name: "land_segments/terrain/photon_rate_te"
      dtype: "float32"
      description: "Calculated photon rate of terrain photons within each 100m segment"
      long_name: "Terrain photon rate"
      units: "s^-1"

    subset_te_flag:
      SDS_Name: "land_segments/terrain/subset_te_flag"
      dtype: "int8"
      description: "Quality flag indicating the terrain photons populating the 100 m segment statistics are derived from less than 100 m worth of photons and/or less than 5 20m ATL03 segments."
      long_name: "subset terrain flag"
      units: "1"
      is_subsegment: True
      subsegment_length: 5
      subsegment_labels: [10, 30, 50, 70, 90]
      subsegment_label_name: "along_track_offset_m"

    terrain_slope:
      SDS_Name: "land_segments/terrain/terrain_slope"
      dtype: "float32"
      description: "The along-track slope of terrain, within each segment;computed by a linear fit of terrain classified photons. Slope is in units of delta height over delta along track distance."
      long_name: "segment terrain slope"
      units: "1"

    terrain_flg:
      SDS_Name: "land_segments/terrain_flg"
      dtype: "int32"
      description: "Terrain flag quality check to indicate a deviation above a threshold from the reference DEM height reported on the product."
      long_name: "terrain flag"
      units: "1"

    urban_flag:
      SDS_Name: "land_segments/urban_flag"
      dtype: "int32"
      description: "The urban flag indicates that a segment is likely located over an urban area."
      long_name: "segment urban flag"
      units: "1"

    # additional parameter segment_id, constructed from the delta_time, latitude and longitude. This will be added as a reference information parameter.
    segment_id:
      SDS_Name: "segment_id"
      description: "Unique segment id"
      dtype: "U30"