surface op• 資料種類:depth → image2d
• 呼叫: import fullseye as fs; fs.ledger.dem_slope(dem, cell_size, method='horn', units='degrees')(要直接呼叫實作,import demops; demops.dem_slope(dem, cell_size, method='horn', units='degrees');從台帳取用則 opsdem.get("dem_slope"))
坡度角。units 為 "degrees" / "radians" / "percent"。
對平面與閉合式 atan(|grad|) 一致(實測 1e-13 以下)。
步驟:從 3x3 鄰域取 dz/dx(朝東)與 dz/dy(朝北 = 列號減小的方向), 得 g = hypot(dz/dx, dz/dy)。"degrees" 以度為單位給出 atan(g), "radians" 為弧度,"percent" 為 100 g(45 度 = 100 %)。邊緣以複製邊界值填補(pad mode="edge"),因此最外圈 1 個單元比內側偏緩。
• dem:(H, W) 的高程 [m],3x3 以上,實數,不可含 inf。缺測以 nan 傳入 ―― 若 -9999 之類的哨兵值原樣留在其中(存在 <= -9000 且沒有 nan)則拒絕。nan 會傳播到 3x3 範圍。
• cell_size:單元邊長 [m],正的有限值。拒絕 bool / 字串。經緯度網格請改用 dem_geodetic_slope。
• method:"horn"(Horn 1981 的 3x3 加權差分,預設)/ "central" (Zevenbergen–Thorne 的中心差分)。
• 回傳值:(H, W) float64。degrees 在 [0, 90) 內。
• 所有失敗皆為 ValueError(形狀、哨兵值、cell_size、選項)。
與 dem_aspect 成對使用。dem_hillshade 由這 2 者產生地形陰影。
• 範例資料目錄(下載 URL / 授權) —— 2-D 用 skimage.data(BSD/公有領域)加合成圖,3-D 給出真實資料源(Stanford/PDS 等)的下載 URL。
• 運算子來歷與參考文獻 —— 該運算子族所依據的研究/方法出處。
• 演算法的正典(作者、年份)與用途見上面的族使用指南。
• dem_geodesy_tour — py -3.11 examples/dem_geodesy_tour.py
• poc_crop_phenotyping — py -3.11 examples/poc_crop_phenotyping.py
• poc_dem_terrain — py -3.11 examples/poc_dem_terrain.py
• poc_geodetic_height_frames — py -3.11 examples/poc_geodetic_height_frames.py
• poc_lidar_terrain_change — py -3.11 examples/poc_lidar_terrain_change.py
• poc_multibeam_bathymetry — py -3.11 examples/poc_multibeam_bathymetry.py
• poc_stockpile_volume — py -3.11 examples/poc_stockpile_volume.py
image2d 作為輸入)—
surface)dem_aspect · dem_curvature · dem_roughness · dem_tpi
*Provenance: demops.py — DEM 運算子登記表。本條目由 tools/opdocs.py md 自動產生(請勿手動編輯)。*
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.