一个 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