Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eo:cloud_cover is never added to Assets #90

Closed
pjhartzell opened this issue Jan 18, 2023 · 0 comments · Fixed by #91
Closed

eo:cloud_cover is never added to Assets #90

pjhartzell opened this issue Jan 18, 2023 · 0 comments · Fixed by #91
Assignees
Labels
bug Something isn't working
Milestone

Comments

@pjhartzell
Copy link
Contributor

When generating Items from XML files, eo:cloud_cover values are (supposed to be) drawn from two locations: The QAPERCENTNOTPRODUCEDCLOUD value in the PSAs element and the QAPercentCloudCover value(s) in the MeasuredParameter element. QAPERCENTNOTPRODUCEDCLOUD is assigned to the Item properties and the parameter/band QAPercentCloudCover values to the appropriate Item Asset.

There are a few bugs, though, that prevent the Asset eo values from ever being stored.

  • Not stored because qa_percent_cloud_cover will always be empty/false:
    qa_percent_cloud_cover: Dict[str, int] = {}
    measured_parameters = metadata.findall(
    "MeasuredParameter/MeasuredParameterContainer"
    )
    for measured_parameter in measured_parameters:
    name = measured_parameter.find_text_or_throw(
    "ParameterName", missing_element("ParameterName")
    ).replace(" ", "_")
    band_qa_percent_cloud_cover = measured_parameter.find_text(
    "QAPercentCloudCover"
    )
    if qa_percent_cloud_cover:
    qa_percent_cloud_cover[name] = int(band_qa_percent_cloud_cover)
  • Assuming the above bug is fixed, assignment fails for assets not having an eo cloud_cover value (the key does not exist):
    if self.metadata.qa_percent_cloud_cover:
    asset_info.eo = {"cloud_cover": self.metadata.qa_percent_cloud_cover[key]}
@pjhartzell pjhartzell added the bug Something isn't working label Jan 18, 2023
@gadomski gadomski added this to the v0.3.0 milestone Jan 19, 2023
@pjhartzell pjhartzell self-assigned this Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants