s1_geocode_stack
create_runconfig(burst_map_row, dem_file, work_dir, flatten, pol, x_spac, y_spac, enable_corrections, burst_db_file)
Create runconfig to process geocoded bursts
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
burst_map_row
|
one row from the dataframe method |
required | |
dem_file
|
Path to DEM to use for processing |
required | |
work_dir
|
Path to working directory for temp and final results |
required | |
flatten
|
Flag to enable/disable flattening |
required | |
pol
|
Polarizations to process. Choices: co-pol, cross-pol, dual-pol |
required | |
x_spac
|
Spacing of geocoded burst along X-direction |
required | |
y_spac
|
Spacing of geocoded burst along Y-direction |
required | |
enable_corrections
|
Flag to enable/disable applying corrections to burst stacks. |
required | |
burst_db_file
|
Path to burst database file to use for burst bounding boxes. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
runconfig |
str
|
Path to runconfig file |
Source code in src/compass/s1_geocode_stack.py
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 | |
generate_burst_map(zip_files, orbit_dir, output_epsg=None, bbox=None, bbox_epsg=4326, burst_db_file=DEFAULT_BURST_DB_FILE)
Generates a dataframe of geogrid infos for each burst ID in zip_files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
zip_files
|
List of S1-A/B SAFE (zip) files |
required | |
orbit_dir
|
Directory containing sensor orbit ephemerides |
required | |
output_epsg
|
EPSG code identifying output product projection system |
None
|
|
bbox
|
Desired bounding box of the geocoded bursts as (left, bottom, right, top). If not provided, the bounding box is computed for each burst. |
None
|
|
bbox_epsg
|
EPSG code of the bounding box. If 4326, the bounding box is assumed to be lon/lat degrees (default: 4326). |
4326
|
|
burst_db_file
|
Path to the burst database file to load bounding boxes. |
DEFAULT_BURST_DB_FILE
|
Returns:
| Name | Type | Description |
|---|---|---|
burst_map |
Dataframe
|
Pandas dataframe containing geogrid info (e.g. top-left, bottom-right x and y coordinates) for each burst to process |
Source code in src/compass/s1_geocode_stack.py
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 | |
get_common_burst_ids(data)
Get list of burst IDs common among all processed dates
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Dataframe containing info for stitching (e.g. burst IDs) |
required |
Returns:
| Name | Type | Description |
|---|---|---|
common_id |
list
|
List containing common burst IDs among all the dates |
Source code in src/compass/s1_geocode_stack.py
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | |
main()
Create the command line interface and run the script.
Source code in src/compass/s1_geocode_stack.py
467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 | |
prune_dataframe(data, id_col, id_list)
Prune dataframe based on column ID and list of value
Parameters:
data: pandas.DataFrame
dataframe that needs to be pruned
id_col: str
column identification for 'data' (e.g. 'burst_id')
id_list: list
List of elements to consider when pruning.
If exclude_items is False (default), then all elements in data
will be kept except for those in id_list.
If exclude_items is True, the items in id_list will be removed from data.
Returns:
data: pandas.DataFrame Pruned dataframe with rows in 'id_list'
Source code in src/compass/s1_geocode_stack.py
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | |
run(slc_dir, dem_file, burst_id=None, common_bursts_only=False, start_date=None, end_date=None, exclude_dates=None, orbit_dir=None, work_dir='stack', pol='co-pol', x_spac=5, y_spac=10, bbox=None, bbox_epsg=4326, output_epsg=None, burst_db_file=DEFAULT_BURST_DB_FILE, flatten=True, enable_corrections=True, using_zipped=True)
Create runconfigs and runfiles generating geocoded bursts for a static stack of Sentinel-1 A/B SAFE files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
slc_dir
|
Directory containing S1-A/B SAFE files |
required | |
dem_file
|
File path to DEM to use for processing |
required | |
burst_id
|
List of burst IDs to process (default: None) |
None
|
|
common_bursts_only
|
Flag to only process bursts common to all SAFE files (default: False) |
False
|
|
start_date
|
Date of the start acquisition of the stack (format: YYYYMMDD) |
None
|
|
end_date
|
Date of the end acquisition of the stack (format: YYYYMMDD) |
None
|
|
exclude_dates
|
List of dates to exclude from the stack (format: YYYYMMDD) |
None
|
|
orbit_dir
|
Directory containing orbit files |
None
|
|
work_dir
|
Working directory to store temp and final files |
'stack'
|
|
pol
|
Polarization to process (default: co-pol). |
'co-pol'
|
|
x_spac
|
Spacing of geocoded burst along X-direction. Default: 5 (meters) |
5
|
|
y_spac
|
Spacing of geocoded burst along Y-direction. Default: 10 (meters) |
10
|
|
bbox
|
Bounding box of the area to geocode: (xmin, ymin, xmax, ymax) in degrees. Used to filter bursts which do not overlap. |
None
|
|
bbox_epsg
|
EPSG code of the bounding box coordinates (default: 4326) If using EPSG:4326, the bounding box coordinates are in degrees. |
4326
|
|
output_epsg
|
EPSG code identifying projection system to use for output. If not specified, will search for each burst center's EPSG from the burst database. |
None
|
|
burst_db_file
|
str
|
File path to burst database containing EPSG/extent information. |
DEFAULT_BURST_DB_FILE
|
flatten
|
Enable/disable flattening (removal of the DEM phase) of geocoded burst. |
True
|
|
enable_corrections
|
Enable/disable generation/usage of correction LUTs during geocoding. |
True
|
|
using_zipped
|
Flag to indicate if SAFE files are zipped or not (default: True). Will search for .zip files if True, and .SAFE directories if False. |
True
|
Source code in src/compass/s1_geocode_stack.py
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 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 | |