From ea31ad93ccfcbbce927201e4b4c51595b41fbe8b Mon Sep 17 00:00:00 2001 From: xhong Date: Mon, 18 May 2026 19:19:51 +0800 Subject: [PATCH] =?UTF-8?q?chore(raw=5Fto=5Frgba.py):=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=85=83=E4=BF=A1=E6=81=AF=E3=80=81=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E5=AF=BC=E5=85=A5=E9=A1=BA=E5=BA=8F=E4=B8=8E=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除未使用的sys导入语句,重新调整导入包的排版顺序,同时更新示例代码中的本地测试路径注释 --- src/utils/raw_to_rgba.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/utils/raw_to_rgba.py b/src/utils/raw_to_rgba.py index 8077a32..500a240 100644 --- a/src/utils/raw_to_rgba.py +++ b/src/utils/raw_to_rgba.py @@ -13,18 +13,18 @@ ------------------------------------------------------------------------------- Authors: CVEO Team -Last Updated: 2025-01-08 +Last Updated: 2026-05-18 =============================================================================== """ import os -import sys from pathlib import Path from typing import List, Optional + import numpy as np -from PIL import Image -from osgeo import gdal import xarray as xr +from osgeo import gdal +from PIL import Image from rioxarray import open_rasterio gdal.UseExceptions() @@ -239,7 +239,7 @@ def combine_bands_to_rgb( if __name__ == "__main__": - # tif_dir = "D:\\Open_EarthData_Tools\\data\\HLS\\2024\\2024012" + # tif_dir = "D:\\open-earthdata-cli\\data\\HLS\\2024\\2024012" # red_path = os.path.join( # tif_dir, "HLS.S30.T49RGP.2024012T031101.v2.0.RED.subset.tif" # ) @@ -251,7 +251,7 @@ if __name__ == "__main__": # ) # output_path = os.path.join(tif_dir, "HLS.S30.T49RGP.2024012T031101.v2.0.RGB.tif") - # tif_dir = "D:\\Open_EarthData_Tools\\data\\HLS\\2025\\2025011" + # tif_dir = "D:\\open-earthdata-cli\\data\\HLS\\2025\\2025011" # red_path = os.path.join( # tif_dir, "HLS.S30.T49RGP.2025011T031009.v2.0.RED.subset.tif" # )