一個 Python 實用程序,用於從 AWS 上的開放資料註冊表下載 Sentinel-1 Orbit 檔案。
>> > import s1_orbits
>> > orbit_file = s1_orbits . fetch_for_scene ( 'S1A_IW_SLC__1SDV_20230727T075102_20230727T075131_049606_05F70A_AE0A' )
>> > orbit_file
PosixPath ( 'S1A_OPER_AUX_POEORB_OPOD_20230816T080815_V20230726T225942_20230728T005942.EOF' )
為了輕鬆管理依賴項,我們建議透過 Anaconda/Miniconda 或 Python 虛擬環境使用專用專案環境。
s1_orbits
可以安裝到 conda 環境:
conda install -c conda-forge s1_orbits
或進入虛擬環境:
python -m pip install s1_orbits
s1-orbits提供了一個函數 - fetch_for_scene
- 來下載給定場景的「最佳可用」軌道檔。這意味著它將下載AUX_POEORB檔案(如果存在);否則,它將下載AUX_RESORB檔案。有關功能更齊全的 API,請參閱 sentineleof 或 CDSE 的 API。
fetch_for_scene ( scene : str , dir : Union [ pathlib . Path , str ] = '.' ) - > pathlib . Path
"""
For the given scene, downloads the AUX_POEORB file if available, otherwise downloads the AUX_RESORB file.
Args:
scene: The scene name for which to download the orbit file.
dir: The directory that the orbit file should download into.
Raises:
InvalidSceneError: Thrown if the scene name is not a proper Sentinel-1 scene name.
OrbitNotFoundError: Thrown if an orbit cannot be found for the provided scene.
Returns:
download_path: The path to the downloaded file.
"""
git clone [email protected]:ASFHyP3/sentinel1-orbits-py.git
cd sentinel1-orbits-py
conda env create -f environment.yml
conda activate s1-orbits
pytest tests