isce-framework / isce-framework/s1-reader

[New Feature]: default arguments for `load_bursts`

Open
#74 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement needs triage
Dominant language
Python
Stars
34
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Checked for duplicates

Yes - I've already checked

Alternatives considered

Yes - and alternatives don't suffice

Related problems

I've been playing around with changing the defaults and acceptable parameters of load_bursts. I wanted to check if others found this useful or not before I decided to open a PR or scrap it.

https://github.com/opera-adt/s1-reader/compare/main...scottstanie:load-burst-defaults?expand=1

Describe the feature request

I wanted to be able to get all the burst metadata with as few lines as possible. Right now that looks like

In [1]: import s1reader
In [2]: zip_path = "data/S1A_IW_SLC__1SDV_20220226T124745_20220226T124812_042084_050378_F69A.zip"
In [3]: orbit_dir = "orbits"
In [4]: s1reader.load_bursts(zip_path, orbit_dir)

[[Sentinel1BurstSlc(burst_id=t012_24518_iw1),
  Sentinel1BurstSlc(burst_id=t012_24519_iw1),
  Sentinel1BurstSlc(burst_id=t012_24520_iw1),
  Sentinel1BurstSlc(burst_id=t012_24521_iw1),
  Sentinel1BurstSlc(burst_id=t012_24522_iw1),
  Sentinel1BurstSlc(burst_id=t012_24523_iw1),
  Sentinel1BurstSlc(burst_id=t012_24524_iw1),
  Sentinel1BurstSlc(burst_id=t012_24525_iw1),
  Sentinel1BurstSlc(burst_id=t012_24526_iw1)],
 [Sentinel1BurstSlc(burst_id=t012_24518_iw2),
  Sentinel1BurstSlc(burst_id=t012_24519_iw2),
  Sentinel1BurstSlc(burst_id=t012_24520_iw2),
  Sentinel1BurstSlc(burst_id=t012_24521_iw2),
  Sentinel1BurstSlc(burst_id=t012_24522_iw2),
  Sentinel1BurstSlc(burst_id=t012_24523_iw2),
  Sentinel1BurstSlc(burst_id=t012_24524_iw2),
  Sentinel1BurstSlc(burst_id=t012_24525_iw2),
  Sentinel1BurstSlc(burst_id=t012_24526_iw2)],
 [Sentinel1BurstSlc(burst_id=t012_24519_iw3),
  Sentinel1BurstSlc(burst_id=t012_24520_iw3),
  Sentinel1BurstSlc(burst_id=t012_24521_iw3),
  Sentinel1BurstSlc(burst_id=t012_24522_iw3),
  Sentinel1BurstSlc(burst_id=t012_24523_iw3),
  Sentinel1BurstSlc(burst_id=t012_24524_iw3),
  Sentinel1BurstSlc(burst_id=t012_24525_iw3),
  Sentinel1BurstSlc(burst_id=t012_24526_iw3),
  Sentinel1BurstSlc(burst_id=t012_24527_iw3)]]

The differences are

  1. The default is to load all subswaths instead of requiring the user to pass one. When you ask for multiple, you get a list of lists.
  2. add the ability to just pass the directory holding orbits instead of needing to get the full orbit path in advance (this just takes the example call of get_orbit_file_from_dir and moves it into load_bursts)
  • relatedly, auto_download=True seems like a nice default to me

I believe this wouldn't break anyone's calls to how their currently using load_bursts, but would just expand what you're allowed to pass in.
If this seems useful to orders, i'll make a PR; otherwise I can close this

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the s1reader.load_bursts entry point and compare the proposed behavior in the linked load-burst-defaults branch. Review how get_orbit_file_from_dir is currently used, then verify that omitted subswaths, an orbit directory, and auto_download=True produce the requested burst metadata without changing existing calls.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.