-
Notifications
You must be signed in to change notification settings - Fork 289
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 for Sentinel-2 radiance calculation #2896
base: main
Are you sure you want to change the base?
Conversation
…ance calculation.
49e1780
to
c1348f6
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2896 +/- ##
=======================================
Coverage 96.05% 96.05%
=======================================
Files 370 370
Lines 54320 54356 +36
=======================================
+ Hits 52177 52212 +35
- Misses 2143 2144 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Pull Request Test Coverage Report for Build 10740356237Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, some comments inline.
#else: | ||
# For L1B the radiances can be directly computed from the digital counts. | ||
#return self._mda.calibrate_to_radiances_l1b(proj, self._channel) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to leave that there as a placeholder. Soon the L1b data will be made available to users, and this section of code will then become useful :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we uncomment it then?
if irrads is not None: | ||
solar_irrad = {int(irr.attrib["bandId"]): float(irr.text) for irr in irrads} | ||
else: | ||
solar_irrad = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be tested?
sed = self.root.find(".//U") | ||
if sed is not None: | ||
return float(sed.text) | ||
return -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really found of this. Would it be possible to raise an error here and catch it downstream?
This PR fixes the radiance calculation for Sentinel-2 data. Currently, the code uses the method suitable for L1b counts -> radiance computation. However, L1b data is not (yet) available to users and the procedure is different for L1c data that's available via the Copernicus data ecosystem.
This PR switches to use the correct calculation.
In addition, I made some changes to the reader code in preparation for the upcoming availability of L1B data for Sentinel-2. This data isn't yet supported by the reader, though, so I have added an explicit error message / reader failure mode if the user tries to process L1B data.