Skip to content

[New Feature]: default arguments for load_bursts #74

@scottstanie

Description

@scottstanie

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestneeds triageIssue requires triage to proceed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions