Replies: 1 comment
-
I think the following half-baked ideas could be useful:
@dataclass
class BurstSlc:
id: str
@classmethod
def burst_from_file(cls, zip_path):
# do ZIP/XML parsing
return cls(id)
burst = BurstSlc.burst_from_file("some_SAFE.zip") I haven't worked how to eliminate code duplication between this I'll keep examining the code for a more concrete solution. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, we read and calculate a lot of parameters in the
burst_from_xml
, but only part of them are passed toSentinel1BurstSlc
class and available to the user. It would be more convenient if we could expose more, or maybe all of them, to the user.Related, we would also expect the list of parameters to grow and be grouped in the long term, as the users might want more parameters, and the data providers, e.g. ESA, may provide more annotation data.
The long list of parameters between
burst_from_xml()
andSentienl1BurstSlc
could be error-prone and not friendly to maintain in the long term. How about moving the majority of XML parsing into the burst SLC class, as outlined below?burst_from_xml()
:slc_burst.populate_metadata()
for the actual extraction.Sentinel1BurstSlc
:populate_metadata()
, to extract the parameters from the annotation files, instead of grabbing them as inputs. In this way, we only need to modify here to add new fields, which will be readily accessible to users.populate_rfi_metadata()
, for the future annotation file.This is just the basic idea, the details are surely to be determined. What do you think @opera-adt/opera-adt ?
Beta Was this translation helpful? Give feedback.
All reactions