Skip to main content

A python wrapper around the HyP3 API

Project description

HyP3 SDK

A python wrapper around the HyP3 API

Usage

The HyP3 object

The HyP3 object interactions with the HyP3 API are done using an instance of the HyP3 class

from hyp3_sdk import HyP3

api = HyP3()  # Must have credentials for urs.earthdata.nasa.gov in a .netrc file for this to work

If you want to use an API other then the one at https://hyp3-api.asf.alaska.edu, you may provide the URL (including scheme) as a parameter

from hyp3_sdk import HyP3

api = HyP3('https://hyp3.example.com')

If you want to pass in a Requests Session object for the API to use, it must first be authenticated and then it can be passed into the API

import requests
from hyp3_sdk import HyP3

session = requests.Session()
session.get(...)  # Authenticate

api = HyP3(authenticated_session=session)

Getting jobs

The get_jobs method with request all jobs from the API and return them in a list of dictionaries

from hyp3_sdk import HyP3

api = HyP3()

response = api.get_jobs()
Parameters:
  • start: datetime -> requests only jobs submitted after given time
  • end: datetime -> requests only jobs submitted before given time
  • status: str -> request based on status (SUCCEEDED, FAILED, RUNNING, PENDING)
  • name: str -> requests only jobs that have this name

Submitting jobs

The submit_jobs method will submit jobs to the API for processing

from hyp3_sdk import HyP3, make_rtc_gamma_job

api = HyP3()

jobs = [make_rtc_gamma_job('job_name', 'granule_name')]

response = api.submit_jobs(jobs)
Parameters
  • jobs: list[Job] -> list of job objects to submit to API

The Job object

Job objects represent a job to be submitted to the API, they are made by calling factory functions

Job factories

  • make_rtc_gamma_job

    Parameters
    • job_name: str -> name of job
    • granule: str -> name of granule to process
    • extra_parameters: dict -> extra parameters and processing options
  • make_insar_gamma_job

    Parameters
    • job_name: str -> name of job
    • granule1: str -> name of primary granule to process
    • granule2: str -> name of secondary granule to process
    • extra_parameters: dict -> extra parameters and processing options
  • make_autorift_job

    Parameters
    • job_name: str -> name of job
    • granule1: str -> name of primary granule to process
    • granule2: str -> name of secondary granule to process
    • extra_parameters: dict -> extra parameters and processing options

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hyp3_sdk-0.2.1.tar.gz (14.8 kB view hashes)

Uploaded Source

Built Distribution

hyp3_sdk-0.2.1-py3-none-any.whl (5.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page