A python wrapper around the HyP3 API
Project description
HyP3 SDK
A python wrapper around the HyP3 API
>>> from hyp3_sdk import HyP3
>>> hyp3 = HyP3(username='MyUsername', password='MyPassword')
>>> granule = 'S1A_IW_SLC__1SSV_20150621T120220_20150621T120232_006471_008934_72D8'
>>> job = hyp3.submit_rtc_job(granule=granule, name='MyNewJob')
>>> job = hyp3.watch(job)
>>> job.download_files()
Install
In order to easily manage dependencies, we recommend using dedicated project environments via Anaconda/Miniconda or Python virtual environments.
The HyP3 SDK can be installed into a conda environment with
conda install -c conda-forge hyp3_sdk
or into a virtual environment with
python -m pip install hyp3_sdk
Quick Usage
There are 3 main classes that the SDK exposes:
HyP3to perform HyP3 operations (find jobs, refresh job information, submitting new jobs)Jobto perform operations on single jobs (downloading products, check status)Batchto perform operations on multiple jobs at once (downloading products, check status)
An instance of the HyP3 class will be needed to interact with the external HyP3 API.
>>> from hyp3_sdk import HyP3
>>> hyp3 = HyP3(username='MyUsername', password='MyPassword')
>>> granule = 'S1A_IW_SLC__1SSV_20150621T120220_20150621T120232_006471_008934_72D8'
>>> job = hyp3.submit_rtc_job(granule=granule, name='MyNewJob')
>>> job = hyp3.watch(job)
>>> job.download_files()
Connect to the HyP3 API
Create a connection to the HyP3 API using the HyP3 class:
import hyp3_sdk as sdk
hyp3 = sdk.HyP3()
This connects to the HyP3 Basic deployment by default. To connect to an
alternate deployment such as HyP3+, specify the corresponding api_url:
hyp3_plus = sdk.HyP3(api_url='https://hyp3-plus.asf.alaska.edu')
Submitting Jobs
hyp3 has member functions for submitting new jobs:
rtc_job = hyp3.submit_rtc_job('granule_id', 'job_name')
insar_job = hyp3.submit_insar_job('reference_granule_id', 'secondary_granule_id', 'job_name')
insar_burst_job = hyp3.submit_insar_isce_burst_job('reference_granule_id', 'secondary_granule_id', 'job_name')
insar_multi_burst_job = hyp3.submit_insar_isce_multi_burst_job(['ref_id_1', 'ref_id_2'], ['sec_id_1', 'sec_id_2'], 'job_name')
autorift_job = hyp3.submit_autorift_job('reference_granule_id', 'secondary_granule_id', 'job_name')
aria_s1_gunw_job = hyp3.submit_aria_s1_gunw_job('ref_date', 'sec_date', 'frame_id', 'job_name')
opera_rtc_s1_job = hyp3.submit_opera_rtc_s1_job('granule_id')
Each of these functions will return an instance of the Job class that represents a new HyP3 job request.
Finding Existing Jobs
To find HyP3 jobs that were run previously, you can use the hyp3.find_jobs()
batch = hyp3.find_jobs()
This will return a Batch instance representing all jobs owned by you. You can also pass parameters to
query to a specific set of jobs
Operations on Job and Batch
If your jobs are not complete you can use the HyP3 instance to update them, and wait from completion
batch = hyp3.find_jobs()
if not batch.complete():
# to get updated information
batch = hyp3.refresh(batch)
# or to wait until completion and get updated information (which will take a fair bit)
batch = hyp3.watch(batch)
Once you have complete jobs you can download the products to your machine
batch.download_files()
These operations also work on Job objects
job = hyp3.submit_rtc_job('S1A_IW_SLC__1SSV_20150621T120220_20150621T120232_006471_008934_72D8', 'MyJobName')
job = hyp3.watch(job)
job.download_files()
Documentation
For the full SDK API Reference, see the HyP3 documentation
Contact Us
Want to talk about the HyP3 SDK? We would love to hear from you!
Found a bug? Want to request a feature? Open an issue
General questions? Suggestions? Or just want to talk to the team? Chat with us on Gitter
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hyp3_sdk-7.7.6.tar.gz.
File metadata
- Download URL: hyp3_sdk-7.7.6.tar.gz
- Upload date:
- Size: 42.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c30502328951c1e047c58a216ba26a0e5f64e192f7e89fe28301bfd7a7fe04cd
|
|
| MD5 |
e9b9c607ec2e196728b82097bc9b8472
|
|
| BLAKE2b-256 |
d70fce288cd97107b487b10cf04ca513e766dc02fda2006b762b227c00e41c3f
|
File details
Details for the file hyp3_sdk-7.7.6-py3-none-any.whl.
File metadata
- Download URL: hyp3_sdk-7.7.6-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c40ca7753c9474ad24699b3da90431c186023a37b0ffab370424f3fa1d5d69c5
|
|
| MD5 |
93ff14c52e5c0db7d821e6a22ba7f3e9
|
|
| BLAKE2b-256 |
59370fd7132353559f8901d44a1304d54359252eb670388af80d66516dbfcd48
|