hyp3_sdk
v2.1.1 API Reference¶
hyp3_sdk
¶
A python wrapper around the HyP3 API
Batch
¶
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/jobs.py
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
|
any_expired()
¶
Check succeeded jobs for expiration
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/jobs.py
244 245 246 247 248 249 250 251 252 |
|
complete()
¶
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/jobs.py
209 210 211 212 213 214 215 216 |
|
download_files(location='.', create=True)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
location |
Union[Path, str]
|
Directory location to put files into |
'.'
|
create |
bool
|
Create |
True
|
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/jobs.py
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
|
filter_jobs(succeeded=True, running=True, failed=False, include_expired=True)
¶
Filter jobs by status. By default, only succeeded and still running jobs will be in the returned batch.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
succeeded |
bool
|
Include all succeeded jobs |
True
|
running |
bool
|
Include all running jobs |
True
|
failed |
bool
|
Include all failed jobs |
False
|
include_expired |
bool
|
Include expired jobs in the result |
True
|
Returns:
Name | Type | Description |
---|---|---|
batch |
Batch
|
A batch object containing jobs matching all the selected statuses |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/jobs.py
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
|
succeeded()
¶
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/jobs.py
218 219 220 221 222 223 224 225 |
|
HyP3
¶
A python wrapper around the HyP3 API.
Warning: All jobs submitted to HyP3 are publicly visible. For more information, see https://hyp3-docs.asf.alaska.edu/#public-visibility-of-jobs
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 |
|
__init__(api_url=PROD_API, username=None, password=None, prompt=False)
¶
If username and password are not provided, attempts to use credentials from a .netrc
file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
api_url |
str
|
Address of the HyP3 API |
PROD_API
|
username |
Optional[str]
|
Username for authenticating to |
None
|
password |
Optional[str]
|
Password for authenticating to |
None
|
prompt |
bool
|
Prompt for username and/or password interactively when they are not provided as keyword parameters |
False
|
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
check_quota()
¶
Returns:
Type | Description |
---|---|
Optional[int]
|
The number of jobs left in your quota, or None if you have no quota |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
423 424 425 426 427 428 429 |
|
find_jobs(start=None, end=None, status_code=None, name=None, job_type=None, user_id=None)
¶
Gets a Batch of jobs from HyP3 matching the provided search criteria
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start |
Optional[datetime]
|
only jobs submitted after given time |
None
|
end |
Optional[datetime]
|
only jobs submitted before given time |
None
|
status_code |
Optional[str]
|
only jobs matching this status (SUCCEEDED, FAILED, RUNNING, PENDING) |
None
|
name |
Optional[str]
|
only jobs with this name |
None
|
job_type |
Optional[str]
|
only jobs with this job_type |
None
|
user_id |
Optional[str]
|
only jobs submitted by this user (defaults to the current user) |
None
|
Returns:
Type | Description |
---|---|
Batch
|
A Batch object containing the found jobs |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
|
get_job_by_id(job_id)
¶
Get job by job ID
Parameters:
Name | Type | Description | Default |
---|---|---|---|
job_id |
str
|
A job ID |
required |
Returns:
Type | Description |
---|---|
Job
|
A Job object |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
92 93 94 95 96 97 98 99 100 101 102 103 104 |
|
my_info()
¶
Returns:
Type | Description |
---|---|
dict
|
Your user information |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
414 415 416 417 418 419 420 421 |
|
prepare_autorift_job(granule1, granule2, name=None)
classmethod
¶
Submit an autoRIFT job
Parameters:
Name | Type | Description | Default |
---|---|---|---|
granule1 |
str
|
The first granule (scene) to use |
required |
granule2 |
str
|
The second granule (scene) to use |
required |
name |
Optional[str]
|
A name for the job |
None
|
Returns:
Type | Description |
---|---|
dict
|
A dictionary containing the prepared autoRIFT job |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
|
prepare_insar_job(granule1, granule2, name=None, include_look_vectors=False, include_los_displacement=False, include_inc_map=False, looks='20x4', include_dem=False, include_wrapped_phase=False, apply_water_mask=False, include_displacement_maps=False)
classmethod
¶
Submit an InSAR job
Parameters:
Name | Type | Description | Default |
---|---|---|---|
granule1 |
str
|
The first granule (scene) to use |
required |
granule2 |
str
|
The second granule (scene) to use |
required |
name |
Optional[str]
|
A name for the job |
None
|
include_look_vectors |
bool
|
Include the look vector theta and phi files in the product package |
False
|
include_los_displacement |
bool
|
Include a GeoTIFF in the product package containing displacement values
along the Line-Of-Sight (LOS). This parameter has been deprecated in favor of
|
False
|
include_inc_map |
bool
|
Include the local and ellipsoidal incidence angle maps in the product package |
False
|
looks |
Literal['20x4', '10x2']
|
Number of looks to take in range and azimuth |
'20x4'
|
include_dem |
bool
|
Include the digital elevation model GeoTIFF in the product package |
False
|
include_wrapped_phase |
bool
|
Include the wrapped phase GeoTIFF in the product package |
False
|
apply_water_mask |
bool
|
Sets pixels over coastal waters and large inland waterbodies as invalid for phase unwrapping |
False
|
include_displacement_maps |
bool
|
Include displacement maps (line-of-sight and vertical) in the product package |
False
|
Returns:
Type | Description |
---|---|
dict
|
A dictionary containing the prepared InSAR job |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 |
|
prepare_rtc_job(granule, name=None, dem_matching=False, include_dem=False, include_inc_map=False, include_rgb=False, include_scattering_area=False, radiometry='gamma0', resolution=30, scale='power', speckle_filter=False, dem_name='copernicus')
classmethod
¶
Submit an RTC job
Parameters:
Name | Type | Description | Default |
---|---|---|---|
granule |
str
|
The granule (scene) to use |
required |
name |
Optional[str]
|
A name for the job |
None
|
dem_matching |
bool
|
Coregisters SAR data to the DEM, rather than using dead reckoning based on orbit files |
False
|
include_dem |
bool
|
Include the DEM file in the product package |
False
|
include_inc_map |
bool
|
Include the local incidence angle map in the product package |
False
|
include_rgb |
bool
|
Include a false-color RGB decomposition in the product package for dual-pol granules (ignored for single-pol granules) |
False
|
include_scattering_area |
bool
|
Include the scattering area in the product package |
False
|
radiometry |
Literal['sigma0', 'gamma0']
|
Backscatter coefficient normalization, either by ground area (sigma0) or illuminated area projected into the look direction (gamma0) |
'gamma0'
|
resolution |
Literal[10, 20, 30]
|
Desired output pixel spacing in meters |
30
|
scale |
Literal['amplitude', 'decibel', 'power']
|
Scale of output image; power, decibel or amplitude |
'power'
|
speckle_filter |
bool
|
Apply an Enhanced Lee speckle filter |
False
|
dem_name |
Literal['copernicus', 'legacy']
|
Name of the DEM to use for processing. |
'copernicus'
|
Returns:
Type | Description |
---|---|
dict
|
A dictionary containing the prepared RTC job |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 |
|
refresh(job_or_batch)
¶
Refresh each jobs' information
Parameters:
Name | Type | Description | Default |
---|---|---|---|
job_or_batch |
Union[Batch, Job]
|
A Batch of Job object to refresh |
required |
Returns:
Type | Description |
---|---|
Union[Batch, Job]
|
A Batch or Job object with refreshed information |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
159 160 161 162 163 164 165 166 167 168 169 |
|
submit_autorift_job(granule1, granule2, name=None)
¶
Submit an autoRIFT job
Parameters:
Name | Type | Description | Default |
---|---|---|---|
granule1 |
str
|
The first granule (scene) to use |
required |
granule2 |
str
|
The second granule (scene) to use |
required |
name |
Optional[str]
|
A name for the job |
None
|
Returns:
Type | Description |
---|---|
Batch
|
A Batch object containing the autoRIFT job |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
204 205 206 207 208 209 210 211 212 213 214 215 216 |
|
submit_insar_job(granule1, granule2, name=None, include_look_vectors=False, include_los_displacement=False, include_inc_map=False, looks='20x4', include_dem=False, include_wrapped_phase=False, apply_water_mask=False, include_displacement_maps=False)
¶
Submit an InSAR job
Parameters:
Name | Type | Description | Default |
---|---|---|---|
granule1 |
str
|
The first granule (scene) to use |
required |
granule2 |
str
|
The second granule (scene) to use |
required |
name |
Optional[str]
|
A name for the job |
None
|
include_look_vectors |
bool
|
Include the look vector theta and phi files in the product package |
False
|
include_los_displacement |
bool
|
Include a GeoTIFF in the product package containing displacement values
along the Line-Of-Sight (LOS). This parameter has been deprecated in favor of
|
False
|
include_inc_map |
bool
|
Include the local and ellipsoidal incidence angle maps in the product package |
False
|
looks |
Literal['20x4', '10x2']
|
Number of looks to take in range and azimuth |
'20x4'
|
include_dem |
bool
|
Include the digital elevation model GeoTIFF in the product package |
False
|
include_wrapped_phase |
bool
|
Include the wrapped phase GeoTIFF in the product package |
False
|
apply_water_mask |
bool
|
Sets pixels over coastal waters and large inland waterbodies as invalid for phase unwrapping |
False
|
include_displacement_maps |
bool
|
Include displacement maps (line-of-sight and vertical) in the product package |
False
|
Returns:
Type | Description |
---|---|
Batch
|
A Batch object containing the InSAR job |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 |
|
submit_prepared_jobs(prepared_jobs)
¶
Submit a prepared job dictionary, or list of prepared job dictionaries
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prepared_jobs |
Union[dict, List[dict]]
|
A prepared job dictionary, or list of prepared job dictionaries |
required |
Returns:
Type | Description |
---|---|
Batch
|
A Batch object containing the submitted job(s) |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
|
submit_rtc_job(granule, name=None, dem_matching=False, include_dem=False, include_inc_map=False, include_rgb=False, include_scattering_area=False, radiometry='gamma0', resolution=30, scale='power', speckle_filter=False, dem_name='copernicus')
¶
Submit an RTC job
Parameters:
Name | Type | Description | Default |
---|---|---|---|
granule |
str
|
The granule (scene) to use |
required |
name |
Optional[str]
|
A name for the job |
None
|
dem_matching |
bool
|
Coregisters SAR data to the DEM, rather than using dead reckoning based on orbit files |
False
|
include_dem |
bool
|
Include the DEM file in the product package |
False
|
include_inc_map |
bool
|
Include the local incidence angle map in the product package |
False
|
include_rgb |
bool
|
Include a false-color RGB decomposition in the product package for dual-pol granules (ignored for single-pol granules) |
False
|
include_scattering_area |
bool
|
Include the scattering area in the product package |
False
|
radiometry |
Literal['sigma0', 'gamma0']
|
Backscatter coefficient normalization, either by ground area (sigma0) or illuminated area projected into the look direction (gamma0) |
'gamma0'
|
resolution |
Literal[10, 20, 30]
|
Desired output pixel spacing in meters |
30
|
scale |
Literal['amplitude', 'decibel', 'power']
|
Scale of output image; power, decibel or amplitude |
'power'
|
speckle_filter |
bool
|
Apply an Enhanced Lee speckle filter |
False
|
dem_name |
Literal['copernicus', 'legacy']
|
Name of the DEM to use for processing. |
'copernicus'
|
Returns:
Type | Description |
---|---|
Batch
|
A Batch object containing the RTC job |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 |
|
watch(job_or_batch, timeout=10800, interval=60)
¶
Watch jobs until they complete
Parameters:
Name | Type | Description | Default |
---|---|---|---|
job_or_batch |
Union[Batch, Job]
|
A Batch or Job object of jobs to watch |
required |
timeout |
int
|
How long to wait until exiting in seconds |
10800
|
interval |
Union[int, float]
|
How often to check for updates in seconds |
60
|
Returns:
Type | Description |
---|---|
Union[Batch, Job]
|
A Batch or Job object with refreshed watched jobs |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
|
Job
¶
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/jobs.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
|
download_files(location='.', create=True)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
location |
Union[Path, str]
|
Directory location to put files into |
'.'
|
create |
bool
|
Create |
True
|
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/jobs.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
|
exceptions
¶
Errors and exceptions to raise when the SDK runs into problems
ASFSearchError
¶
Bases: HyP3SDKError
Raise for errors when using the ASF Search module
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/exceptions.py
15 16 |
|
AuthenticationError
¶
Bases: HyP3SDKError
Raise when authentication does not succeed
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/exceptions.py
23 24 |
|
HyP3Error
¶
Bases: HyP3SDKError
Raise for errors when using the HyP3 module
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/exceptions.py
11 12 |
|
HyP3SDKError
¶
Bases: Exception
Base Exception for the HyP3 SDK
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/exceptions.py
7 8 |
|
ServerError
¶
Bases: HyP3SDKError
Raise when the HyP3 SDK encounters a server error
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/exceptions.py
19 20 |
|
hyp3
¶
HyP3
¶
A python wrapper around the HyP3 API.
Warning: All jobs submitted to HyP3 are publicly visible. For more information, see https://hyp3-docs.asf.alaska.edu/#public-visibility-of-jobs
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 |
|
__init__(api_url=PROD_API, username=None, password=None, prompt=False)
¶
If username and password are not provided, attempts to use credentials from a .netrc
file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
api_url |
str
|
Address of the HyP3 API |
PROD_API
|
username |
Optional[str]
|
Username for authenticating to |
None
|
password |
Optional[str]
|
Password for authenticating to |
None
|
prompt |
bool
|
Prompt for username and/or password interactively when they are not provided as keyword parameters |
False
|
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
check_quota()
¶
Returns:
Type | Description |
---|---|
Optional[int]
|
The number of jobs left in your quota, or None if you have no quota |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
423 424 425 426 427 428 429 |
|
find_jobs(start=None, end=None, status_code=None, name=None, job_type=None, user_id=None)
¶
Gets a Batch of jobs from HyP3 matching the provided search criteria
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start |
Optional[datetime]
|
only jobs submitted after given time |
None
|
end |
Optional[datetime]
|
only jobs submitted before given time |
None
|
status_code |
Optional[str]
|
only jobs matching this status (SUCCEEDED, FAILED, RUNNING, PENDING) |
None
|
name |
Optional[str]
|
only jobs with this name |
None
|
job_type |
Optional[str]
|
only jobs with this job_type |
None
|
user_id |
Optional[str]
|
only jobs submitted by this user (defaults to the current user) |
None
|
Returns:
Type | Description |
---|---|
Batch
|
A Batch object containing the found jobs |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
|
get_job_by_id(job_id)
¶
Get job by job ID
Parameters:
Name | Type | Description | Default |
---|---|---|---|
job_id |
str
|
A job ID |
required |
Returns:
Type | Description |
---|---|
Job
|
A Job object |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
92 93 94 95 96 97 98 99 100 101 102 103 104 |
|
my_info()
¶
Returns:
Type | Description |
---|---|
dict
|
Your user information |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
414 415 416 417 418 419 420 421 |
|
prepare_autorift_job(granule1, granule2, name=None)
classmethod
¶
Submit an autoRIFT job
Parameters:
Name | Type | Description | Default |
---|---|---|---|
granule1 |
str
|
The first granule (scene) to use |
required |
granule2 |
str
|
The second granule (scene) to use |
required |
name |
Optional[str]
|
A name for the job |
None
|
Returns:
Type | Description |
---|---|
dict
|
A dictionary containing the prepared autoRIFT job |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
|
prepare_insar_job(granule1, granule2, name=None, include_look_vectors=False, include_los_displacement=False, include_inc_map=False, looks='20x4', include_dem=False, include_wrapped_phase=False, apply_water_mask=False, include_displacement_maps=False)
classmethod
¶
Submit an InSAR job
Parameters:
Name | Type | Description | Default |
---|---|---|---|
granule1 |
str
|
The first granule (scene) to use |
required |
granule2 |
str
|
The second granule (scene) to use |
required |
name |
Optional[str]
|
A name for the job |
None
|
include_look_vectors |
bool
|
Include the look vector theta and phi files in the product package |
False
|
include_los_displacement |
bool
|
Include a GeoTIFF in the product package containing displacement values
along the Line-Of-Sight (LOS). This parameter has been deprecated in favor of
|
False
|
include_inc_map |
bool
|
Include the local and ellipsoidal incidence angle maps in the product package |
False
|
looks |
Literal['20x4', '10x2']
|
Number of looks to take in range and azimuth |
'20x4'
|
include_dem |
bool
|
Include the digital elevation model GeoTIFF in the product package |
False
|
include_wrapped_phase |
bool
|
Include the wrapped phase GeoTIFF in the product package |
False
|
apply_water_mask |
bool
|
Sets pixels over coastal waters and large inland waterbodies as invalid for phase unwrapping |
False
|
include_displacement_maps |
bool
|
Include displacement maps (line-of-sight and vertical) in the product package |
False
|
Returns:
Type | Description |
---|---|
dict
|
A dictionary containing the prepared InSAR job |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 |
|
prepare_rtc_job(granule, name=None, dem_matching=False, include_dem=False, include_inc_map=False, include_rgb=False, include_scattering_area=False, radiometry='gamma0', resolution=30, scale='power', speckle_filter=False, dem_name='copernicus')
classmethod
¶
Submit an RTC job
Parameters:
Name | Type | Description | Default |
---|---|---|---|
granule |
str
|
The granule (scene) to use |
required |
name |
Optional[str]
|
A name for the job |
None
|
dem_matching |
bool
|
Coregisters SAR data to the DEM, rather than using dead reckoning based on orbit files |
False
|
include_dem |
bool
|
Include the DEM file in the product package |
False
|
include_inc_map |
bool
|
Include the local incidence angle map in the product package |
False
|
include_rgb |
bool
|
Include a false-color RGB decomposition in the product package for dual-pol granules (ignored for single-pol granules) |
False
|
include_scattering_area |
bool
|
Include the scattering area in the product package |
False
|
radiometry |
Literal['sigma0', 'gamma0']
|
Backscatter coefficient normalization, either by ground area (sigma0) or illuminated area projected into the look direction (gamma0) |
'gamma0'
|
resolution |
Literal[10, 20, 30]
|
Desired output pixel spacing in meters |
30
|
scale |
Literal['amplitude', 'decibel', 'power']
|
Scale of output image; power, decibel or amplitude |
'power'
|
speckle_filter |
bool
|
Apply an Enhanced Lee speckle filter |
False
|
dem_name |
Literal['copernicus', 'legacy']
|
Name of the DEM to use for processing. |
'copernicus'
|
Returns:
Type | Description |
---|---|
dict
|
A dictionary containing the prepared RTC job |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 |
|
refresh(job_or_batch)
¶
Refresh each jobs' information
Parameters:
Name | Type | Description | Default |
---|---|---|---|
job_or_batch |
Union[Batch, Job]
|
A Batch of Job object to refresh |
required |
Returns:
Type | Description |
---|---|
Union[Batch, Job]
|
A Batch or Job object with refreshed information |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
159 160 161 162 163 164 165 166 167 168 169 |
|
submit_autorift_job(granule1, granule2, name=None)
¶
Submit an autoRIFT job
Parameters:
Name | Type | Description | Default |
---|---|---|---|
granule1 |
str
|
The first granule (scene) to use |
required |
granule2 |
str
|
The second granule (scene) to use |
required |
name |
Optional[str]
|
A name for the job |
None
|
Returns:
Type | Description |
---|---|
Batch
|
A Batch object containing the autoRIFT job |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
204 205 206 207 208 209 210 211 212 213 214 215 216 |
|
submit_insar_job(granule1, granule2, name=None, include_look_vectors=False, include_los_displacement=False, include_inc_map=False, looks='20x4', include_dem=False, include_wrapped_phase=False, apply_water_mask=False, include_displacement_maps=False)
¶
Submit an InSAR job
Parameters:
Name | Type | Description | Default |
---|---|---|---|
granule1 |
str
|
The first granule (scene) to use |
required |
granule2 |
str
|
The second granule (scene) to use |
required |
name |
Optional[str]
|
A name for the job |
None
|
include_look_vectors |
bool
|
Include the look vector theta and phi files in the product package |
False
|
include_los_displacement |
bool
|
Include a GeoTIFF in the product package containing displacement values
along the Line-Of-Sight (LOS). This parameter has been deprecated in favor of
|
False
|
include_inc_map |
bool
|
Include the local and ellipsoidal incidence angle maps in the product package |
False
|
looks |
Literal['20x4', '10x2']
|
Number of looks to take in range and azimuth |
'20x4'
|
include_dem |
bool
|
Include the digital elevation model GeoTIFF in the product package |
False
|
include_wrapped_phase |
bool
|
Include the wrapped phase GeoTIFF in the product package |
False
|
apply_water_mask |
bool
|
Sets pixels over coastal waters and large inland waterbodies as invalid for phase unwrapping |
False
|
include_displacement_maps |
bool
|
Include displacement maps (line-of-sight and vertical) in the product package |
False
|
Returns:
Type | Description |
---|---|
Batch
|
A Batch object containing the InSAR job |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 |
|
submit_prepared_jobs(prepared_jobs)
¶
Submit a prepared job dictionary, or list of prepared job dictionaries
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prepared_jobs |
Union[dict, List[dict]]
|
A prepared job dictionary, or list of prepared job dictionaries |
required |
Returns:
Type | Description |
---|---|
Batch
|
A Batch object containing the submitted job(s) |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
|
submit_rtc_job(granule, name=None, dem_matching=False, include_dem=False, include_inc_map=False, include_rgb=False, include_scattering_area=False, radiometry='gamma0', resolution=30, scale='power', speckle_filter=False, dem_name='copernicus')
¶
Submit an RTC job
Parameters:
Name | Type | Description | Default |
---|---|---|---|
granule |
str
|
The granule (scene) to use |
required |
name |
Optional[str]
|
A name for the job |
None
|
dem_matching |
bool
|
Coregisters SAR data to the DEM, rather than using dead reckoning based on orbit files |
False
|
include_dem |
bool
|
Include the DEM file in the product package |
False
|
include_inc_map |
bool
|
Include the local incidence angle map in the product package |
False
|
include_rgb |
bool
|
Include a false-color RGB decomposition in the product package for dual-pol granules (ignored for single-pol granules) |
False
|
include_scattering_area |
bool
|
Include the scattering area in the product package |
False
|
radiometry |
Literal['sigma0', 'gamma0']
|
Backscatter coefficient normalization, either by ground area (sigma0) or illuminated area projected into the look direction (gamma0) |
'gamma0'
|
resolution |
Literal[10, 20, 30]
|
Desired output pixel spacing in meters |
30
|
scale |
Literal['amplitude', 'decibel', 'power']
|
Scale of output image; power, decibel or amplitude |
'power'
|
speckle_filter |
bool
|
Apply an Enhanced Lee speckle filter |
False
|
dem_name |
Literal['copernicus', 'legacy']
|
Name of the DEM to use for processing. |
'copernicus'
|
Returns:
Type | Description |
---|---|
Batch
|
A Batch object containing the RTC job |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 |
|
watch(job_or_batch, timeout=10800, interval=60)
¶
Watch jobs until they complete
Parameters:
Name | Type | Description | Default |
---|---|---|---|
job_or_batch |
Union[Batch, Job]
|
A Batch or Job object of jobs to watch |
required |
timeout |
int
|
How long to wait until exiting in seconds |
10800
|
interval |
Union[int, float]
|
How often to check for updates in seconds |
60
|
Returns:
Type | Description |
---|---|
Union[Batch, Job]
|
A Batch or Job object with refreshed watched jobs |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/hyp3.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
|
jobs
¶
Batch
¶
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/jobs.py
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
|
any_expired()
¶
Check succeeded jobs for expiration
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/jobs.py
244 245 246 247 248 249 250 251 252 |
|
complete()
¶
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/jobs.py
209 210 211 212 213 214 215 216 |
|
download_files(location='.', create=True)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
location |
Union[Path, str]
|
Directory location to put files into |
'.'
|
create |
bool
|
Create |
True
|
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/jobs.py
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
|
filter_jobs(succeeded=True, running=True, failed=False, include_expired=True)
¶
Filter jobs by status. By default, only succeeded and still running jobs will be in the returned batch.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
succeeded |
bool
|
Include all succeeded jobs |
True
|
running |
bool
|
Include all running jobs |
True
|
failed |
bool
|
Include all failed jobs |
False
|
include_expired |
bool
|
Include expired jobs in the result |
True
|
Returns:
Name | Type | Description |
---|---|---|
batch |
Batch
|
A batch object containing jobs matching all the selected statuses |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/jobs.py
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
|
succeeded()
¶
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/jobs.py
218 219 220 221 222 223 224 225 |
|
Job
¶
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/jobs.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
|
download_files(location='.', create=True)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
location |
Union[Path, str]
|
Directory location to put files into |
'.'
|
create |
bool
|
Create |
True
|
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/jobs.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
|
util
¶
Extra utilities for working with HyP3
chunk(itr, n=200)
¶
Split a sequence into small chunks
Parameters:
Name | Type | Description | Default |
---|---|---|---|
itr |
Sequence[Any]
|
A sequence object to chunk |
required |
n |
int
|
Size of the chunks to return |
200
|
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/util.py
43 44 45 46 47 48 49 50 51 52 53 54 |
|
download_file(url, filepath, chunk_size=None, retries=2, backoff_factor=1)
¶
Download a file
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
str
|
URL of the file to download |
required |
filepath |
Union[Path, str]
|
Location to place file into |
required |
chunk_size |
Size to chunk the download into |
None
|
|
retries |
Number of retries to attempt |
2
|
|
backoff_factor |
Factor for calculating time between retries |
1
|
Returns:
Name | Type | Description |
---|---|---|
download_path |
Path
|
The path to the downloaded file |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/util.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
|
extract_zipped_product(zip_file, delete=True)
¶
Extract a zipped HyP3 product
Extract a zipped HyP3 product to the same directory as the zipped HyP3 product, optionally
deleting zip file
afterward.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
zip_file |
Union[str, Path]
|
Zipped HyP3 product to extract |
required |
delete |
bool
|
Delete |
True
|
Returns:
Type | Description |
---|---|
Path
|
Path to the HyP3 product folder containing the product files |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/util.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
get_authenticated_session(username, password)
¶
Log into HyP3 using credentials for urs.earthdata.nasa.gov
from either the provided
credentials or a .netrc
file.
Returns:
Type | Description |
---|---|
requests.Session
|
An authenticated HyP3 Session |
Source code in /usr/share/miniconda/envs/hyp3-docs/lib/python3.8/site-packages/hyp3_sdk/util.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
|