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

Bugfix - slstr not yet properly supported #92

Merged

Conversation

adybbroe
Copy link
Contributor

@adybbroe adybbroe commented Nov 19, 2024

A very rudimentary implementation for the SLSTR instrument was implemented, however, a bug (not providing the maximum scan angle) results in failed tests, see #91 for instance!

The SLSTR instrument is not a cross track scanner, and it seems misleading to have it implemented as if it was. We need to make a more adequate implementation, rather than define an artificial "maximum scan angle" to make it look like an AVHRR.

Until then I propose to remove its "support" and raise an exception.

  • Closes #xxxx
  • Tests added
  • Tests passed
  • Passes git diff origin/main **/*py | flake8 --diff
  • Fully documented

@adybbroe adybbroe added bug PCW Pytroll Contributers Week labels Nov 19, 2024
@adybbroe adybbroe self-assigned this Nov 19, 2024
Copy link

codecov bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.71%. Comparing base (0e1319e) to head (fccd0a5).
Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #92      +/-   ##
==========================================
+ Coverage   55.52%   55.71%   +0.19%     
==========================================
  Files          15       14       -1     
  Lines        2100     2107       +7     
==========================================
+ Hits         1166     1174       +8     
+ Misses        934      933       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@adybbroe
Copy link
Contributor Author

This was the kind of error I got in the unittests offline in main!

        elif instrument.startswith("slstr"):
            instrument = "slstr"
        elif overpass.satellite.name.startswith("aws"):
            scan_angle = 55.25
            instrument = "avhrr"
        else:
            scan_angle = 55.25
>       return instrument, scan_angle
E       UnboundLocalError: cannot access local variable 'scan_angle' where it is not associated with a value

trollsched/boundary.py:88: UnboundLocalError

@adybbroe
Copy link
Contributor Author

@pnuu @mraspaud Any opinion on this one?

Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but didn't we add slstr recently?

@@ -38,6 +38,10 @@
"avhrr-3": "avhrr",
"mwhs-2": "mwhs2"}

class InstrumentNotSupported(Exception):
"""Exception to capture cases when instrument are (yet) not supported."""
pass
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need pass :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Signed-off-by: Adam.Dybbroe <[email protected]>
@adybbroe
Copy link
Contributor Author

@TAlonglong I suppose you would not be happy about this?
Do you have a suggested solution or are you okay with this as is, removing the SLSTR support just added by the old PR #70 ?

Copy link
Collaborator

@TAlonglong TAlonglong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good with this.

@TAlonglong TAlonglong merged commit 9dc25cb into pytroll:main Nov 19, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug PCW Pytroll Contributers Week
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants